From: Geliang Tang <tanggeliang@kylinos.cn>
Introduce -i option to enable TCP_INQ testing. This prepares for
consolidating TCP_INQ tests into a single binary by adding the necessary
command-line interface.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
tools/testing/selftests/net/mptcp/mptcp_sockopt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
index d6c1d746f12e..9558c68a62e7 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
@@ -30,6 +30,7 @@
static int pf = AF_INET;
static int proto_tx = IPPROTO_MPTCP;
static int proto_rx = IPPROTO_MPTCP;
+static bool inq;
#ifndef IPPROTO_MPTCP
#define IPPROTO_MPTCP 262
@@ -138,7 +139,7 @@ static void die_perror(const char *msg)
static void die_usage(int r)
{
- fprintf(stderr, "Usage: mptcp_sockopt [-6] [ -t tcp|mptcp ] [ -r tcp|mptcp]\n");
+ fprintf(stderr, "Usage: mptcp_sockopt [-6] [ -t tcp|mptcp ] [ -r tcp|mptcp] [ -i]\n");
exit(r);
}
@@ -277,7 +278,7 @@ static void parse_opts(int argc, char **argv)
{
int c;
- while ((c = getopt(argc, argv, "h6t:r:")) != -1) {
+ while ((c = getopt(argc, argv, "h6t:r:i")) != -1) {
switch (c) {
case 'h':
die_usage(0);
@@ -291,6 +292,9 @@ static void parse_opts(int argc, char **argv)
case 'r':
proto_rx = protostr_to_num(optarg);
break;
+ case 'i':
+ inq = true;
+ break;
default:
die_usage(1);
break;
--
2.48.1