From: "Asbjørn Sloth Tønnesen" <asbjorn@asbjorn.st>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: James Chapman <jchapman@katalix.com>, netdev@vger.kernel.org
Subject: [PATCH iproute2 5/7] l2tp: support sequence numbering
Date: Fri, 4 Nov 2016 23:11:09 +0000 [thread overview]
Message-ID: <20161104231111.14677-5-asbjorn@asbjorn.st> (raw)
In-Reply-To: <20161104231111.14677-1-asbjorn@asbjorn.st>
Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@asbjorn.st>
---
ip/ipl2tp.c | 23 +++++++++++++++++++++++
man/man8/ip-l2tp.8 | 15 +++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
index af89e2f..6d00d09 100644
--- a/ip/ipl2tp.c
+++ b/ip/ipl2tp.c
@@ -246,6 +246,12 @@ static void print_session(struct l2tp_data *data)
printf(" reorder timeout: %u\n", p->reorder_timeout);
else
printf("\n");
+ if (p->send_seq || p->recv_seq) {
+ printf(" sequence numbering:");
+ if (p->send_seq) printf(" send");
+ if (p->recv_seq) printf(" recv");
+ printf("\n");
+ }
}
static int get_response(struct nlmsghdr *n, void *arg)
@@ -483,6 +489,7 @@ static void usage(void)
fprintf(stderr, " session_id ID peer_session_id ID\n");
fprintf(stderr, " [ cookie HEXSTR ] [ peer_cookie HEXSTR ]\n");
fprintf(stderr, " [ offset OFFSET ] [ peer_offset OFFSET ]\n");
+ fprintf(stderr, " [ seq { none | send | recv | both } ]\n");
fprintf(stderr, " [ l2spec_type L2SPEC ]\n");
fprintf(stderr, " ip l2tp del tunnel tunnel_id ID\n");
fprintf(stderr, " ip l2tp del session tunnel_id ID session_id ID\n");
@@ -653,6 +660,22 @@ static int parse_args(int argc, char **argv, int cmd, struct l2tp_parm *p)
fprintf(stderr, "Unknown layer2specific header type \"%s\"\n", *argv);
exit(-1);
}
+ } else if (strcmp(*argv, "seq") == 0) {
+ NEXT_ARG();
+ if (strcasecmp(*argv, "both") == 0) {
+ p->recv_seq = 1;
+ p->send_seq = 1;
+ } else if (strcasecmp(*argv, "recv") == 0) {
+ p->recv_seq = 1;
+ } else if (strcasecmp(*argv, "send") == 0) {
+ p->send_seq = 1;
+ } else if (strcasecmp(*argv, "none") == 0) {
+ p->recv_seq = 0;
+ p->send_seq = 0;
+ } else {
+ fprintf(stderr, "Unknown seq value \"%s\"\n", *argv);
+ exit(-1);
+ }
} else if (strcmp(*argv, "tunnel") == 0) {
p->tunnel = 1;
} else if (strcmp(*argv, "session") == 0) {
diff --git a/man/man8/ip-l2tp.8 b/man/man8/ip-l2tp.8
index 991d097..d4e7270 100644
--- a/man/man8/ip-l2tp.8
+++ b/man/man8/ip-l2tp.8
@@ -51,6 +51,8 @@ ip-l2tp - L2TPv3 static unmanaged tunnel configuration
.br
.RB "[ " l2spec_type " { " none " | " default " } ]"
.br
+.RB "[ " seq " { " none " | " send " | " recv " | " both " } ]"
+.br
.RB "[ " offset
.IR OFFSET
.RB " ] [ " peer_offset
@@ -238,6 +240,19 @@ set the layer2specific header type of the session.
Valid values are:
.BR none ", " default "."
.TP
+.BI seq " SEQ"
+controls sequence numbering to prevent or detect out of order packets.
+.B send
+puts a sequence number in the default layer2specific header of each
+outgoing packet.
+.B recv
+reorder packets if they are received out of order.
+Default is
+.BR none "."
+.br
+Valid values are:
+.BR none ", " send ", " recv ", " both "."
+.TP
.BI offset " OFFSET"
sets the byte offset from the L2TP header where user data starts in
transmitted L2TP data packets. This is hardly ever used. If set, the
--
2.10.1
next prev parent reply other threads:[~2016-11-04 23:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-04 23:11 [PATCH iproute2 1/7] man: ip-l2tp.8: fix l2spec_type documentation Asbjørn Sloth Tønnesen
2016-11-04 23:11 ` [PATCH iproute2 2/7] man: ip-l2tp.8: remove non-existent tunnel parameter name Asbjørn Sloth Tønnesen
2016-11-04 23:11 ` [PATCH iproute2 3/7] l2tp: fix integers with too few significant bits Asbjørn Sloth Tønnesen
2016-11-04 23:11 ` [PATCH iproute2 4/7] l2tp: fix L2TP_ATTR_{RECV,SEND}_SEQ handling Asbjørn Sloth Tønnesen
2016-11-04 23:11 ` Asbjørn Sloth Tønnesen [this message]
2016-11-04 23:11 ` [PATCH iproute2 6/7] l2tp: read IPv6 UDP checksum attributes from kernel Asbjørn Sloth Tønnesen
2016-11-04 23:11 ` [PATCH iproute2 7/7] l2tp: show tunnel: expose UDP checksum state Asbjørn Sloth Tønnesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161104231111.14677-5-asbjorn@asbjorn.st \
--to=asbjorn@asbjorn.st \
--cc=jchapman@katalix.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).