summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/ipcp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-05-08 11:07:56 +0000
committerbrian <brian@FreeBSD.org>1999-05-08 11:07:56 +0000
commitab7d88ae2d8ea955c6193cc242b9cee4d58f8fd4 (patch)
treee79816f983bd5a5be86a78fe0aafbd00a13ac2db /usr.sbin/ppp/ipcp.c
parent713dd62834d401cc7b9b394a4b916ab9e5e3d4d5 (diff)
downloadFreeBSD-src-ab7d88ae2d8ea955c6193cc242b9cee4d58f8fd4.zip
FreeBSD-src-ab7d88ae2d8ea955c6193cc242b9cee4d58f8fd4.tar.gz
o Redesign the layering mechanism and make the aliasing code part of
the layering. We now ``stack'' layers as soon as we open the device (when we figure out what we're dealing with). A static set of `dispatch' routines are also declared for dealing with incoming packets after they've been `pulled' up through the stacked layers. Physical devices are now assigned handlers based on the device type when they're opened. For the moment there are three device types; ttys, execs and tcps. o Increment version number to 2.2 o Make an entry in [uw]tmp for non-tty -direct invocations (after pap/chap authentication). o Make throughput counters quad_t's o Account for the absolute number of mbuf malloc()s and free()s in ``show mem''. o ``show modem'' becomes ``show physical''.
Diffstat (limited to 'usr.sbin/ppp/ipcp.c')
-rw-r--r--usr.sbin/ppp/ipcp.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index aa981ef..c36ef66 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -17,10 +17,11 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.c,v 1.74 1999/04/26 08:54:24 brian Exp $
+ * $Id: ipcp.c,v 1.75 1999/04/26 08:54:34 brian Exp $
*
* TODO:
- * o More RFC1772 backward compatibility
+ * o Support IPADDRS properly
+ * o Validate the length in IpcpDecodeConfig
*/
#include <sys/param.h>
#include <netinet/in_systm.h>
@@ -47,6 +48,7 @@
#include "alias.h"
#endif
#endif
+#include "layer.h"
#include "ua.h"
#include "defs.h"
#include "command.h"
@@ -54,7 +56,7 @@
#include "log.h"
#include "timer.h"
#include "fsm.h"
-#include "lcpproto.h"
+#include "proto.h"
#include "lcp.h"
#include "iplist.h"
#include "throughput.h"
@@ -1007,22 +1009,12 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
switch (mode_type) {
case MODE_REQ:
- ipcp->peer_ip = ipaddr;
- ipcp->my_ip = dstipaddr;
- memcpy(dec->ackend, cp, length);
- dec->ackend += length;
+ memcpy(dec->rejend, cp, length);
+ dec->rejend += length;
break;
case MODE_NAK:
- snprintf(tbuff2, sizeof tbuff2, "%s changing address: %s", tbuff,
- inet_ntoa(ipcp->my_ip));
- log_Printf(LogIPCP, "%s --> %s\n", tbuff2, inet_ntoa(ipaddr));
- ipcp->my_ip = ipaddr;
- ipcp->peer_ip = dstipaddr;
- break;
-
case MODE_REJ:
- ipcp->peer_reject |= (1 << type);
break;
}
break;
@@ -1147,18 +1139,19 @@ IpcpDecodeConfig(struct fsm *fp, u_char * cp, int plen, int mode_type,
}
}
-void
-ipcp_Input(struct ipcp *ipcp, struct bundle *bundle, struct mbuf *bp)
+extern struct mbuf *
+ipcp_Input(struct bundle *bundle, struct link *l, struct mbuf *bp)
{
/* Got PROTO_IPCP from link */
if (bundle_Phase(bundle) == PHASE_NETWORK)
- fsm_Input(&ipcp->fsm, bp);
+ fsm_Input(&bundle->ncp.ipcp.fsm, bp);
else {
if (bundle_Phase(bundle) < PHASE_NETWORK)
log_Printf(LogIPCP, "%s: Error: Unexpected IPCP in phase %s (ignored)\n",
- ipcp->fsm.link->name, bundle_PhaseName(bundle));
+ l->name, bundle_PhaseName(bundle));
mbuf_Free(bp);
}
+ return NULL;
}
int
OpenPOWER on IntegriCloud