Re: [PATCH] TCPOPTSTRIP 20071006 (iptables)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Sat, 6 Oct 2007, Jan Engelhardt wrote:

+struct tcp_optionmap_struct {
+	const char *name;
+	const int option;
+	const char *desc;
+};

+static const struct tcp_optionmap_struct tcp_optionmap[] = {
+	{"wscale",         TCPOPT_WINDOW},
+	{"mss",            TCPOPT_MAXSEG},
+	{"sack-permitted", TCPOPT_SACK_PERMITTED},
+	{"sack",           TCPOPT_SACK},
+	{"timestamp",      TCPOPT_TIMESTAMP},
+	{"md5",            TCPOPT_MD5SIG},
+	{NULL},
+};

We could convert spaces into tabs here, plus:

+	{"mss",			TCPOPT_MAXSEG,		"Maximum Segment Size"},
+	{"wscale",		TCPOPT_WINDOW,		"Window Scale"},
+	{"sack-permitted",	TCPOPT_SACK_PERMITTED,	"SACK Permitted"},
+	{"sack",		TCPOPT_SACK,		"SACK"},
+	{"timestamp",		TCPOPT_TIMESTAMP,	"Time Stamp"},
+	{"md5",			TCPOPT_MD5SIG,		"MD5 Signature"},
+	{NULL},

...

+static void tcpoptstrip_help(void)
+{
+	int i;
+	printf(
+"TCPOPTSTRIP target options:\n"
+"  --strip-options value     strip specified TCP options denoted by value\n"
+"                            (separated by comma) from TCP header\n"
+"  Instead of the numeric value, you can also use the following names:\n"
+	);

+ 	for (i = 0; tcp_optionmap[i].name != NULL; ++i) {
+		printf("\t%s\t%s\n", tcp_optionmap[i].name, tcp_optionmap[i].desc);
+	};

And remove this:
+"    mss               strip MSS option\n"
+"    wscale            strip window scaling option\n"
+"    sack-permitted    strip \"SACK permitted\" option\n"
+"    sack              strip SACK option\n"
+"    timestamp         strip timestamp option\n"
+"    md5               strip MD5 signature option (RFC2385)\n"
+	);

Best regsrds,

				Krzysztof Olędzki

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux