diff options
author | brian <brian@FreeBSD.org> | 1999-05-12 09:49:12 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-05-12 09:49:12 +0000 |
commit | 89ce3ea906517d4df3f75dc7721280428c5e6159 (patch) | |
tree | 9146deb551e427cf4160888e787361aab1620dd4 /usr.sbin/ppp/ccp.c | |
parent | 174d713c5168fee5dbc7f58d899b5947f191ed9a (diff) | |
download | FreeBSD-src-89ce3ea906517d4df3f75dc7721280428c5e6159.zip FreeBSD-src-89ce3ea906517d4df3f75dc7721280428c5e6159.tar.gz |
Allow ``host:port/udp'' devices and support ``host:port/tcp'' as
being the same as the previous (still supported) ``host:port''
syntax for tcp socket devices.
A udp device uses synchronous ppp rather than async, and avoids
the double-retransmit overhead that comes with ppp over tcp (it's
usually a bad idea to transport IP over a reliable transport that
itself is using an unreliable transport). PPP over UDP provides
througput of ** 1.5Mb per second ** with all compression disabled,
maxing out a PPro/200 when running ppp twice, back-to-back.
This proves that PPPoE is plausable in userland....
This change adds a few more handler functions to struct device and
allows derivations of struct device (which may contain their own
data etc) to pass themselves through the unix domain socket for MP.
** At last **, struct physical has lost all the tty crud !
iov2physical() is now smart enough to restore the correct stack of
layers so that MP servers will work again.
The version number has bumped as our MP link transfer contents have
changed (they now may contain a `struct device').
Don't extract the protocol twice in MP mode (resulting in protocol
rejects for every MP packet). This was broken with my original
layering changes.
Add ``Physical'' and ``Sync'' log levels for logging the relevent
raw packets and add protocol-tracking LogDEBUG stuff in various
LayerPush & LayerPull functions.
Assign our physical device name for incoming tcp connections by
calling getpeername().
Assign our physical device name for incoming udp connections from
the address retrieved by the first recvfrom().
Diffstat (limited to 'usr.sbin/ppp/ccp.c')
-rw-r--r-- | usr.sbin/ppp/ccp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ccp.c b/usr.sbin/ppp/ccp.c index b1082c8..0332864 100644 --- a/usr.sbin/ppp/ccp.c +++ b/usr.sbin/ppp/ccp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: ccp.c,v 1.47 1999/05/08 11:06:12 brian Exp $ + * $Id: ccp.c,v 1.48 1999/05/09 20:02:17 brian Exp $ * * TODO: * o Support other compression protocols @@ -594,6 +594,8 @@ ccp_LayerPull(struct bundle *b, struct link *l, struct mbuf *bp, u_short *proto) */ if (l->ccp.fsm.state == ST_OPENED) { if (*proto == PROTO_COMPD || *proto == PROTO_ICOMPD) { + log_Printf(LogDEBUG, "ccp_LayerPull: PROTO_%sCOMPDP -> PROTO_IP\n", + *proto == PROTO_ICOMPD ? "I" : ""); /* Decompress incoming data */ if (l->ccp.reset_sent != -1) /* Send another REQ and put the packet in the bit bucket */ @@ -603,10 +605,13 @@ ccp_LayerPull(struct bundle *b, struct link *l, struct mbuf *bp, u_short *proto) (l->ccp.in.state, &l->ccp, proto, bp); mbuf_Free(bp); bp = NULL; - } else if (PROTO_COMPRESSIBLE(*proto) && l->ccp.in.state != NULL) + } else if (PROTO_COMPRESSIBLE(*proto) && l->ccp.in.state != NULL) { + log_Printf(LogDEBUG, "ccp_LayerPull: Ignore packet (dict only)\n"); /* Add incoming Network Layer traffic to our dictionary */ (*algorithm[l->ccp.in.algorithm]->i.DictSetup) (l->ccp.in.state, &l->ccp, *proto, bp); + } else + log_Printf(LogDEBUG, "ccp_LayerPull: Ignore packet\n"); } return bp; |