lcp.c (46828) | lcp.c (47695) |
---|---|
1/* 2 * PPP Link Control Protocol (LCP) Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * PPP Link Control Protocol (LCP) Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: lcp.c,v 1.73 1999/05/08 11:06:51 brian Exp $ | 20 * $Id: lcp.c,v 1.74 1999/05/09 20:02:21 brian Exp $ |
21 * 22 */ 23 24#include <sys/param.h> 25#include <netinet/in.h> 26#include <netinet/in_systm.h> 27#include <netinet/ip.h> 28#include <sys/un.h> --- 396 unchanged lines hidden (view full) --- 425 426 mp = &lcp->fsm.bundle->ncp.mp; 427 if (mp->cfg.enddisc.class != 0 && !REJECTED(lcp, TY_ENDDISC)) { 428 *o->data = mp->cfg.enddisc.class; 429 memcpy(o->data+1, mp->cfg.enddisc.address, mp->cfg.enddisc.len); 430 INC_LCP_OPT(TY_ENDDISC, mp->cfg.enddisc.len + 3, o); 431 } 432 | 21 * 22 */ 23 24#include <sys/param.h> 25#include <netinet/in.h> 26#include <netinet/in_systm.h> 27#include <netinet/ip.h> 28#include <sys/un.h> --- 396 unchanged lines hidden (view full) --- 425 426 mp = &lcp->fsm.bundle->ncp.mp; 427 if (mp->cfg.enddisc.class != 0 && !REJECTED(lcp, TY_ENDDISC)) { 428 *o->data = mp->cfg.enddisc.class; 429 memcpy(o->data+1, mp->cfg.enddisc.address, mp->cfg.enddisc.len); 430 INC_LCP_OPT(TY_ENDDISC, mp->cfg.enddisc.len + 3, o); 431 } 432 |
433 fsm_Output(fp, CODE_CONFIGREQ, fp->reqid, buff, (u_char *)o - buff); | 433 fsm_Output(fp, CODE_CONFIGREQ, fp->reqid, buff, (u_char *)o - buff, 434 MB_LCPOUT); |
434} 435 436void 437lcp_SendProtoRej(struct lcp *lcp, u_char *option, int count) 438{ 439 /* Don't understand `option' */ | 435} 436 437void 438lcp_SendProtoRej(struct lcp *lcp, u_char *option, int count) 439{ 440 /* Don't understand `option' */ |
440 fsm_Output(&lcp->fsm, CODE_PROTOREJ, lcp->fsm.reqid, option, count); | 441 fsm_Output(&lcp->fsm, CODE_PROTOREJ, lcp->fsm.reqid, option, count, 442 MB_LCPOUT); |
441} 442 443static void 444LcpSentTerminateReq(struct fsm *fp) 445{ 446 /* Term REQ just sent by FSM */ 447} 448 449static void 450LcpSendTerminateAck(struct fsm *fp, u_char id) 451{ 452 /* Send Term ACK please */ 453 struct physical *p = link2physical(fp->link); 454 455 if (p && p->dl->state == DATALINK_CBCP) 456 cbcp_ReceiveTerminateReq(p); 457 | 443} 444 445static void 446LcpSentTerminateReq(struct fsm *fp) 447{ 448 /* Term REQ just sent by FSM */ 449} 450 451static void 452LcpSendTerminateAck(struct fsm *fp, u_char id) 453{ 454 /* Send Term ACK please */ 455 struct physical *p = link2physical(fp->link); 456 457 if (p && p->dl->state == DATALINK_CBCP) 458 cbcp_ReceiveTerminateReq(p); 459 |
458 fsm_Output(fp, CODE_TERMACK, id, NULL, 0); | 460 fsm_Output(fp, CODE_TERMACK, id, NULL, 0, MB_LCPOUT); |
459} 460 461static void 462LcpLayerStart(struct fsm *fp) 463{ 464 /* We're about to start up ! */ 465 struct lcp *lcp = fsm2lcp(fp); 466 --- 676 unchanged lines hidden (view full) --- 1143 dec->ackend = dec->ack; 1144 } 1145} 1146 1147extern struct mbuf * 1148lcp_Input(struct bundle *bundle, struct link *l, struct mbuf *bp) 1149{ 1150 /* Got PROTO_LCP from link */ | 461} 462 463static void 464LcpLayerStart(struct fsm *fp) 465{ 466 /* We're about to start up ! */ 467 struct lcp *lcp = fsm2lcp(fp); 468 --- 676 unchanged lines hidden (view full) --- 1145 dec->ackend = dec->ack; 1146 } 1147} 1148 1149extern struct mbuf * 1150lcp_Input(struct bundle *bundle, struct link *l, struct mbuf *bp) 1151{ 1152 /* Got PROTO_LCP from link */ |
1153 mbuf_SetType(bp, MB_LCPIN); |
|
1151 fsm_Input(&l->lcp.fsm, bp); 1152 return NULL; 1153} | 1154 fsm_Input(&l->lcp.fsm, bp); 1155 return NULL; 1156} |