Skip to content

Commit

Permalink
Add 'ip6 ifq-maxlen', 'pipex inq-maxlen' and 'pipex outq-maxlen' sysctls
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowman committed May 30, 2016
1 parent 90219c5 commit 05fd95a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
15 changes: 9 additions & 6 deletions commands.c
Expand Up @@ -262,7 +262,7 @@ Menu iptab[] = {
{ "sourceroute", "Process Loose/Strict Source Route Options", CMPL0 0, 0, 0, 0, ipsysctl },
{ "encdebug", "Enable if_enc debugging", CMPL0 0, 0, 0, 0, ipsysctl },
{ "send-redirects", "Send ICMP redirects", CMPL0 0, 0, 0, 0, ipsysctl },
{ "ifq-maxlen", "IP IFQ maxlen", CMPL0 0, 0, 0, 1, ipsysctl },
{ "ifq-maxlen", "IPv4 ifqueue max length", CMPL0 0, 0, 0, 1, ipsysctl },
{ "directed-broadcast", "Allow directed broadcasts", CMPL0 0, 0, 0, 0, ipsysctl },
{ "multipath", "Multipath routing", CMPL0 0, 0, 0, 0, ipsysctl },
#ifdef notyet
Expand All @@ -281,6 +281,7 @@ Menu ip6tab[] = {
{ "maxifprefixes", "Max if IPv6 Prefixes", CMPL0 0, 0, 0, 0, ipsysctl },
{ "maxifdefrouters", "Max if IPv6 Def Routers", CMPL0 0, 0, 0, 0, ipsysctl },
{ "maxdynroutes", "Max IPv6 Dyn Routes", CMPL0 0, 0, 0, 0, ipsysctl },
{ "ifq-maxlen", "IPv6 ifqueue max length", CMPL0 0, 0, 0, 1, ipsysctl },
{ "?", "Help", CMPL0 0, 0, 0, 0, sysctlhelp },
{ 0, 0, 0, 0, 0, 0, 0, 0 }
};
Expand All @@ -294,15 +295,17 @@ Menu mplstab[] = {
};

Menu ddbtab[] = {
{ "panic", "DDB panic", CMPL0 0, 0, 0, 1, ipsysctl },
{ "console", "DDB console", CMPL0 0, 0, 0, 1, ipsysctl },
{ "log", "DDB log", CMPL0 0, 0, 0, 1, ipsysctl },
{ "panic", "DDB panic", CMPL0 0, 0, 0, 0, ipsysctl },
{ "console", "DDB console", CMPL0 0, 0, 0, 0, ipsysctl },
{ "log", "DDB log", CMPL0 0, 0, 0, 0, ipsysctl },
{ "?", "Help", CMPL0 0, 0, 0, 0, sysctlhelp },
{ 0, 0, 0, 0, 0, 0, 0, 0 }
};

Menu pipextab[] = {
{ "enable", "PIPEX enable", CMPL0 0, 0, 0, 1, ipsysctl },
{ "enable", "PIPEX enable", CMPL0 0, 0, 0, 0, ipsysctl },
{ "inq-maxlen", "Input queue max length", CMPL0 0, 0, 0, 1, ipsysctl },
{ "outq-maxlength", "Output queue max length", CMPL0 0, 0, 0, 1, ipsysctl },
{ "?", "Help", CMPL0 0, 0, 0, 0, sysctlhelp },
{ 0, 0, 0, 0, 0, 0, 0, 0 }
};
Expand Down Expand Up @@ -352,7 +355,7 @@ ipcmd(int argc, char **argv)
}
if (((i->minarg + 2) > argc) || ((i->maxarg + 2) < argc)) {
printf("%% Wrong argument%s to '%s %s' command.\n",
argv[0], argc <= 2 ? "" : "s", i->name);
argc <= 2 ? "" : "s", argv[0], i->name);
return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions sysctl.c
Expand Up @@ -127,6 +127,7 @@ struct ipsysctl ip6sysctls[] = {
{ "maxifprefixes", { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_MAXIFPREFIXES, MIB_STOP, 0 }, DEFAULT_MAXIFPREFIXES, 0 },
{ "maxifdefrouters", { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_MAXIFDEFROUTERS, MIB_STOP, 0 }, DEFAULT_MAXIFDEFROUTERS, 0 },
{ "maxdynroutes", { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_MAXDYNROUTES, MIB_STOP, 0 }, DEFAULT_MAXDYNROUTES, 0 },
{ "ifq-maxlen", { CTL_NET, PF_INET6, IPPROTO_IPV6, IPV6CTL_IFQUEUE, IFQCTL_MAXLEN, MIB_STOP }, IFQ_MAXLEN, 0 },
{ 0, { 0, 0, 0, 0, 0, 0 }, 0, 0 }
};

Expand All @@ -146,6 +147,10 @@ struct ipsysctl ddbsysctls[] = {

struct ipsysctl pipexsysctls[] = {
{ "enable", { CTL_NET, PF_PIPEX, PIPEXCTL_ENABLE, MIB_STOP, 0 }, 0, 1 },
{ "inq-maxlen", { CTL_NET, PF_PIPEX, PIPEXCTL_INQ, MIB_STOP, 0 },
IFQ_MAXLEN, 0 },
{ "outq-maxlen", { CTL_NET, PF_PIPEX, PIPEXCTL_OUTQ, MIB_STOP, 0 },
IFQ_MAXLEN, 0 },
{ 0, { 0, 0, 0, 0, 0, 0 }, 0, 0 }
};

Expand Down

0 comments on commit 05fd95a

Please sign in to comment.