diff options
author | marcus <marcus@FreeBSD.org> | 2003-09-23 07:41:55 +0000 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2003-09-23 07:41:55 +0000 |
commit | e19a1e64d248ad6f10230273b0afcd49b570e0ba (patch) | |
tree | dcae4425b97cd670a26f1074a999df062d47d4e1 /sbin/natd/natd.c | |
parent | 1adbd0035e01b5e125de7222da250f6c0cb4634a (diff) | |
download | FreeBSD-src-e19a1e64d248ad6f10230273b0afcd49b570e0ba.zip FreeBSD-src-e19a1e64d248ad6f10230273b0afcd49b570e0ba.tar.gz |
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
Diffstat (limited to 'sbin/natd/natd.c')
-rw-r--r-- | sbin/natd/natd.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index ec123f7..f8ba6a6 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); +} |