l2tp: support sequence numbering
This patch implement and documents the user interface for sequence numbering. Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@asbjorn.st>
This commit is contained in:
parent
35cc6ded4f
commit
8a11421a5d
23
ip/ipl2tp.c
23
ip/ipl2tp.c
|
|
@ -246,6 +246,12 @@ static void print_session(struct l2tp_data *data)
|
||||||
printf(" reorder timeout: %u\n", p->reorder_timeout);
|
printf(" reorder timeout: %u\n", p->reorder_timeout);
|
||||||
else
|
else
|
||||||
printf("\n");
|
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)
|
static int get_response(struct nlmsghdr *n, void *arg)
|
||||||
|
|
@ -482,6 +488,7 @@ static void usage(void)
|
||||||
fprintf(stderr, " session_id ID peer_session_id ID\n");
|
fprintf(stderr, " session_id ID peer_session_id ID\n");
|
||||||
fprintf(stderr, " [ cookie HEXSTR ] [ peer_cookie HEXSTR ]\n");
|
fprintf(stderr, " [ cookie HEXSTR ] [ peer_cookie HEXSTR ]\n");
|
||||||
fprintf(stderr, " [ offset OFFSET ] [ peer_offset OFFSET ]\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, " [ l2spec_type L2SPEC ]\n");
|
||||||
fprintf(stderr, " ip l2tp del tunnel tunnel_id ID\n");
|
fprintf(stderr, " ip l2tp del tunnel tunnel_id ID\n");
|
||||||
fprintf(stderr, " ip l2tp del session tunnel_id ID session_id ID\n");
|
fprintf(stderr, " ip l2tp del session tunnel_id ID session_id ID\n");
|
||||||
|
|
@ -652,6 +659,22 @@ static int parse_args(int argc, char **argv, int cmd, struct l2tp_parm *p)
|
||||||
fprintf(stderr, "Unknown layer2specific header type \"%s\"\n", *argv);
|
fprintf(stderr, "Unknown layer2specific header type \"%s\"\n", *argv);
|
||||||
exit(-1);
|
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) {
|
} else if (strcmp(*argv, "tunnel") == 0) {
|
||||||
p->tunnel = 1;
|
p->tunnel = 1;
|
||||||
} else if (strcmp(*argv, "session") == 0) {
|
} else if (strcmp(*argv, "session") == 0) {
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ ip-l2tp - L2TPv3 static unmanaged tunnel configuration
|
||||||
.br
|
.br
|
||||||
.RB "[ " l2spec_type " { " none " | " default " } ]"
|
.RB "[ " l2spec_type " { " none " | " default " } ]"
|
||||||
.br
|
.br
|
||||||
|
.RB "[ " seq " { " none " | " send " | " recv " | " both " } ]"
|
||||||
|
.br
|
||||||
.RB "[ " offset
|
.RB "[ " offset
|
||||||
.IR OFFSET
|
.IR OFFSET
|
||||||
.RB " ] [ " peer_offset
|
.RB " ] [ " peer_offset
|
||||||
|
|
@ -238,6 +240,19 @@ set the layer2specific header type of the session.
|
||||||
Valid values are:
|
Valid values are:
|
||||||
.BR none ", " default "."
|
.BR none ", " default "."
|
||||||
.TP
|
.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"
|
.BI offset " OFFSET"
|
||||||
sets the byte offset from the L2TP header where user data starts in
|
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
|
transmitted L2TP data packets. This is hardly ever used. If set, the
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue