summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2001-12-27 16:52:23 +0000
committerjoerg <joerg@FreeBSD.org>2001-12-27 16:52:23 +0000
commit82f548fd196d80b812a968821012bff7642ca42d (patch)
treea75db8e49c67f275b9a2b981111e385bb8298d9d
parent3f447117b167f4507c4f9d61e2bd3dff8eff7335 (diff)
downloadFreeBSD-src-82f548fd196d80b812a968821012bff7642ca42d.zip
FreeBSD-src-82f548fd196d80b812a968821012bff7642ca42d.tar.gz
Implement knobs to enable/disable VJ header compression.
Submitted by: i4b (modified) MFC after: 1 month
-rw-r--r--sbin/spppcontrol/spppcontrol.89
-rw-r--r--sbin/spppcontrol/spppcontrol.c10
2 files changed, 17 insertions, 2 deletions
diff --git a/sbin/spppcontrol/spppcontrol.8 b/sbin/spppcontrol/spppcontrol.8
index d531de9..8db48bc 100644
--- a/sbin/spppcontrol/spppcontrol.8
+++ b/sbin/spppcontrol/spppcontrol.8
@@ -1,4 +1,4 @@
-.\" Copyright (C) 1997 by Joerg Wunsch, Dresden
+.\" Copyright (C) 1997, 2001 by Joerg Wunsch, Dresden
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 11, 1997
+.Dd December 27, 2001
.Os
.Dt SPPPCONTROL 8
.Sh NAME
@@ -164,6 +164,10 @@ through approximately 800 seconds.) This is the default, and will not
be explicitly displayed in
.Ql list
mode.
+.It Ar enable-vj
+Enable negotiation of Van Jacobsen header compression. (Enabled by default.)
+.It Ar disable-vj
+Disable negotiation of Van Jacobsen header compression.
.El
.Sh EXAMPLES
.Bd -literal
@@ -171,6 +175,7 @@ mode.
bppp0: phase=dead
myauthproto=chap myauthname="uriah"
hisauthproto=chap hisauthname="ifb-gw" norechallenge
+ enable-vj
.Ed
.Pp
Display the settings for bppp0. The interface is currently in
diff --git a/sbin/spppcontrol/spppcontrol.c b/sbin/spppcontrol/spppcontrol.c
index fa902f9..e1ddfff 100644
--- a/sbin/spppcontrol/spppcontrol.c
+++ b/sbin/spppcontrol/spppcontrol.c
@@ -32,10 +32,15 @@ static const char rcsid[] =
#include <sys/param.h>
#include <sys/callout.h>
#include <sys/ioctl.h>
+#include <sys/mbuf.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_var.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <net/slcompress.h>
#include <net/if_sppp.h>
#include <err.h>
@@ -160,6 +165,10 @@ main(int argc, char **argv)
spr.defs.hisauth.flags |= AUTHFLAG_NORECHALLENGE;
else if (strcmp(argv[0], "rechallenge") == 0)
spr.defs.hisauth.flags &= ~AUTHFLAG_NORECHALLENGE;
+ else if (strcmp(argv[0], "enable-vj") == 0)
+ spr.defs.enable_vj = 1;
+ else if (strcmp(argv[0], "disable-vj") == 0)
+ spr.defs.enable_vj = 0;
else
errx(EX_DATAERR, "bad parameter: \"%s\"", argv[0]);
@@ -202,6 +211,7 @@ print_vals(const char *ifname, struct spppreq *sp)
AUTHNAMELEN, sp->defs.hisauth.name,
authflags(sp->defs.hisauth.flags));
}
+ printf("\t%sable-vj\n", sp->defs.enable_vj? "en": "dis");
}
const char *
OpenPOWER on IntegriCloud