diff options
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); +} |