aboutsummaryrefslogtreecommitdiff
path: root/sbin/natd/natd.c
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2003-09-23 07:41:55 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2003-09-23 07:41:55 +0000
commitb07fbc17e9994ab739ffd14ae1d9df38c22fdfea (patch)
treedcae4425b97cd670a26f1074a999df062d47d4e1 /sbin/natd/natd.c
parent6c527f260e2b1433ae7b4b07865cffddf265cce5 (diff)
downloadsrc-b07fbc17e9994ab739ffd14ae1d9df38c22fdfea.tar.gz
src-b07fbc17e9994ab739ffd14ae1d9df38c22fdfea.zip
Add Cisco Skinny Station protocol support to libalias, natd, and ppp.
Skinny is the protocol used by Cisco IP phones to talk to Cisco Call Managers. With this code, one can use a Cisco IP phone behind a FreeBSD NAT gateway. Currently, having the Call Manager behind the NAT gateway is not supported. More information on enabling Skinny support in libalias, natd, and ppp can be found in those applications' manpages. PR: 55843 Reviewed by: ru Approved by: ru MFC after: 30 days
Notes
Notes: svn path=/head/; revision=120372
Diffstat (limited to 'sbin/natd/natd.c')
-rw-r--r--sbin/natd/natd.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c
index ec123f766aa7..f8ba6a66a900 100644
--- a/sbin/natd/natd.c
+++ b/sbin/natd/natd.c
@@ -99,6 +99,7 @@ static int StrToProto (const char* str);
static int StrToAddrAndPortRange (const char* str, struct in_addr* addr, char* proto, port_range *portRange);
static void ParseArgs (int argc, char** argv);
static void SetupPunchFW(const char *strValue);
+static void SetupSkinnyPort(const char *strValue);
/*
* Globals.
@@ -838,6 +839,7 @@ enum Option {
LogDenied,
LogFacility,
PunchFW,
+ SkinnyPort,
LogIpfwDenied,
PidFile
};
@@ -1059,6 +1061,14 @@ static struct OptionInfo optionTable[] = {
"punch_fw",
NULL },
+ { SkinnyPort,
+ 0,
+ String,
+ "port",
+ "set the TCP port for use with the Skinny Station protocol",
+ "skinny_port",
+ NULL },
+
{ LogIpfwDenied,
0,
YesNo,
@@ -1258,6 +1268,10 @@ static void ParseOption (const char* option, const char* parms)
SetupPunchFW(strValue);
break;
+ case SkinnyPort:
+ SetupSkinnyPort(strValue);
+ break;
+
case LogIpfwDenied:
logIpfwDenied = yesNoValue;;
break;
@@ -1705,3 +1719,14 @@ SetupPunchFW(const char *strValue)
PacketAliasSetFWBase(base, num);
(void)PacketAliasSetMode(PKT_ALIAS_PUNCH_FW, PKT_ALIAS_PUNCH_FW);
}
+
+static void
+SetupSkinnyPort(const char *strValue)
+{
+ unsigned int port;
+
+ if (sscanf(strValue, "%u", &port) != 1)
+ errx(1, "skinny_port: port parameter required");
+
+ PacketAliasSetSkinnyPort(port);
+}