亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ipcp.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* ipcp.c - PPP IP Control Protocol *//* Copyright 1995 Wind River Systems, Inc. */#include "copyright_wrs.h"/* * Copyright (c) 1989 Carnegie Mellon University. * All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the above copyright notice and this paragraph are * duplicated in all such forms and that any documentation, * advertising materials, and other materials related to such * distribution and use acknowledge that the software was developed * by Carnegie Mellon University.  The name of the * University may not be used to endorse or promote products derived * from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. *//*modification history--------------------01e,16jun95,dzb  header file consolidation.01d,08jun95,dzb  made LOG_NOTICE message printed even w/o debug option.01c,07feb95,dab  die() if IP address reject (SPR #4038).01b,16jan95,dab  removed ipcp_script call.  removed pathname.h inclusion.01a,21dec94,dab  VxWorks port - first WRS version.	   +dzb  added: path for ppp header files, WRS copyright.*/#include <vxWorks.h>#include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include "pppLib.h"/* * Callbacks for fsm code.  (CI = Configuration Information) */static void ipcp_resetci __ARGS((fsm *));	/* Reset our CI */static int  ipcp_cilen __ARGS((fsm *));	        /* Return length of our CI */static void ipcp_addci __ARGS((fsm *, u_char *, int *)); /* Add our CI */static int  ipcp_ackci __ARGS((fsm *, u_char *, int));	/* Peer ack'd our CI */static int  ipcp_nakci __ARGS((fsm *, u_char *, int));	/* Peer nak'd our CI */static int  ipcp_rejci __ARGS((fsm *, u_char *, int));	/* Peer rej'd our CI */static int  ipcp_reqci __ARGS((fsm *, u_char *, int *, int)); /* Rcv CI */static void ipcp_up __ARGS((fsm *));		/* We're UP */static void ipcp_down __ARGS((fsm *));		/* We're DOWN */static fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */    ipcp_resetci,		/* Reset our Configuration Information */    ipcp_cilen,			/* Length of our Configuration Information */    ipcp_addci,			/* Add our Configuration Information */    ipcp_ackci,			/* ACK our Configuration Information */    ipcp_nakci,			/* NAK our Configuration Information */    ipcp_rejci,			/* Reject our Configuration Information */    ipcp_reqci,			/* Request peer's Configuration Information */    ipcp_up,			/* Called when fsm reaches OPENED state */    ipcp_down,			/* Called when fsm leaves OPENED state */    NULL,			/* Called when we want the lower layer up */    NULL,			/* Called when we want the lower layer down */    NULL,			/* Called when Protocol-Reject received */    NULL,			/* Retransmission is necessary */    NULL,			/* Called to handle protocol-specific codes */    "IPCP"			/* String name of protocol */};/* * Lengths of configuration options. */#define CILEN_VOID	2#define CILEN_COMPRESS	4	/* min length for compression protocol opt. */#define CILEN_VJ	6	/* length for RFC1332 Van-Jacobson opt. */#define CILEN_ADDR	6	/* new-style single address option */#define CILEN_ADDRS	10	/* old-style dual address option */#define CODENAME(x)	((x) == CONFACK ? "ACK" : \			 (x) == CONFNAK ? "NAK" : "REJ")/* * Make a string representation of a network IP address. */char *ip_ntoa(ipaddr)    u_long ipaddr;{    static char b[64];    ipaddr = ntohl(ipaddr);    sprintf(b, "%d.%d.%d.%d",	    (u_char)(ipaddr >> 24),	    (u_char)(ipaddr >> 16),	    (u_char)(ipaddr >> 8),	    (u_char)(ipaddr));    return b;}/* * ipcp_init - Initialize IPCP. */voidipcp_init(unit)    int unit;{    fsm *f = &ppp_if[unit]->ipcp_fsm;    ipcp_options *wo = &ppp_if[unit]->ipcp_wantoptions;    ipcp_options *ao = &ppp_if[unit]->ipcp_allowoptions;    f->unit = unit;    f->protocol = IPCP;    f->callbacks = &ipcp_callbacks;    fsm_init(&ppp_if[unit]->ipcp_fsm);    wo->neg_addr = 1;    wo->old_addrs = 0;    wo->ouraddr = 0;    wo->hisaddr = 0;    wo->neg_vj = 1;    wo->old_vj = 0;    wo->vj_protocol = IPCP_VJ_COMP;    wo->maxslotindex = MAX_STATES - 1; /* really max index */    wo->cflag = 1;    /* max slots and slot-id compression are currently hardwired in */    /* ppp_if.c to 16 and 1, this needs to be changed (among other */    /* things) gmc */    ao->neg_addr = 1;    ao->neg_vj = 1;    ao->maxslotindex = MAX_STATES - 1;    ao->cflag = 1;}/* * ipcp_open - IPCP is allowed to come up. */voidipcp_open(unit)    int unit;{    fsm_open(&ppp_if[unit]->ipcp_fsm);}/* * ipcp_close - Take IPCP down. */voidipcp_close(unit)    int unit;{    fsm_close(&ppp_if[unit]->ipcp_fsm);    /*     * NB     * Since the only NCP supported by VxWorks is IPCP, this routine should     * also take down the entire link if IPCP is going down... Thus,     * an LCP should occur so that an LCP terminate request is sent to the     * peer.  This is *not* usual behavior, especially in regard to the     * RFC's protocol specification, but it makes sense for VxWorks.     * Users should not mind, since the link is useless without IPCP.     * -dzb     */     die(unit, 1);}/* * ipcp_lowerup - The lower layer is up. */voidipcp_lowerup(unit)    int unit;{    fsm_lowerup(&ppp_if[unit]->ipcp_fsm);}/* * ipcp_lowerdown - The lower layer is down. */voidipcp_lowerdown(unit)    int unit;{    fsm_lowerdown(&ppp_if[unit]->ipcp_fsm);}/* * ipcp_input - Input IPCP packet. */voidipcp_input(unit, p, len)    int unit;    u_char *p;    int len;{    fsm_input(&ppp_if[unit]->ipcp_fsm, p, len);}/* * ipcp_protrej - A Protocol-Reject was received for IPCP. * * Pretend the lower layer went down, so we shut up. */voidipcp_protrej(unit)    int unit;{    fsm_lowerdown(&ppp_if[unit]->ipcp_fsm);}/* * ipcp_resetci - Reset our CI. */static voidipcp_resetci(f)    fsm *f;{    ipcp_options *wo = &ppp_if[f->unit]->ipcp_wantoptions;    wo->req_addr = wo->neg_addr && ppp_if[f->unit]->ipcp_allowoptions.neg_addr;    if (wo->ouraddr == 0)        wo->accept_local = 1;    if (wo->hisaddr == 0)        wo->accept_remote = 1;    ppp_if[f->unit]->ipcp_gotoptions = *wo;    ppp_if[f->unit]->cis_received = 0;}/* * ipcp_cilen - Return length of our CI. */static intipcp_cilen(f)    fsm *f;{    ipcp_options *go = &ppp_if[f->unit]->ipcp_gotoptions;#define LENCIVJ(neg, old)	(neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0)#define LENCIADDR(neg, old)	(neg ? (old? CILEN_ADDRS : CILEN_ADDR) : 0)    return (LENCIADDR(go->neg_addr, go->old_addrs) +	    LENCIVJ(go->neg_vj, go->old_vj));}/* * ipcp_addci - Add our desired CIs to a packet. */static voidipcp_addci(f, ucp, lenp)    fsm *f;    u_char *ucp;    int *lenp;{    ipcp_options *wo = &ppp_if[f->unit]->ipcp_wantoptions;    ipcp_options *go = &ppp_if[f->unit]->ipcp_gotoptions;    ipcp_options *ho = &ppp_if[f->unit]->ipcp_hisoptions;    int len = *lenp;#define ADDCIVJ(opt, neg, val, old, maxslotindex, cflag) \    if (neg) { \	int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \	if (len >= vjlen) { \	    PUTCHAR(opt, ucp); \	    PUTCHAR(vjlen, ucp); \	    PUTSHORT(val, ucp); \	    if (!old) { \		PUTCHAR(maxslotindex, ucp); \		PUTCHAR(cflag, ucp); \	    } \	    len -= vjlen; \	} else \	    neg = 0; \    }#define ADDCIADDR(opt, neg, old, val1, val2) \    if (neg) { \	int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \	if (len >= addrlen) { \	    u_long l; \	    PUTCHAR(opt, ucp); \	    PUTCHAR(addrlen, ucp); \	    l = ntohl(val1); \	    PUTLONG(l, ucp); \	    if (old) { \		l = ntohl(val2); \		PUTLONG(l, ucp); \	    } \	    len -= addrlen; \	} else \	    neg = 0; \    }    /*     * First see if we want to change our options to the old     * forms because we have received old forms from the peer.     */    if (wo->neg_addr && !go->neg_addr && !go->old_addrs) {	/* use the old style of address negotiation */	go->neg_addr = 1;	go->old_addrs = 1;    }    if (wo->neg_vj && !go->neg_vj && !go->old_vj) {	/* try an older style of VJ negotiation */	if (ppp_if[f->unit]->cis_received == 0) {	    /* keep trying the new style until we see some CI from the peer */	    go->neg_vj = 1;	} else {	    /* use the old style only if the peer did */	    if (ho->neg_vj && ho->old_vj) {		go->neg_vj = 1;		go->old_vj = 1;		go->vj_protocol = ho->vj_protocol;	    }	}    }    ADDCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), go->neg_addr,	      go->old_addrs, go->ouraddr, go->hisaddr);    ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj,	    go->maxslotindex, go->cflag);    *lenp -= len;}/* * ipcp_ackci - Ack our CIs. * * Returns: *	0 - Ack was bad. *	1 - Ack was good. */static intipcp_ackci(f, p, len)    fsm *f;    u_char *p;    int len;{    ipcp_options *go = &ppp_if[f->unit]->ipcp_gotoptions;    u_short cilen, citype, cishort;    u_long cilong;    u_char cimaxslotindex, cicflag;    /*     * CIs must be in exactly the same order that we sent...     * Check packet length and CI length at each step.     * If we find any deviations, then this packet is bad.     */#define ACKCIVJ(opt, neg, val, old, maxslotindex, cflag) \    if (neg) { \	int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \	if ((len -= vjlen) < 0) \	    goto bad; \	GETCHAR(citype, p); \	GETCHAR(cilen, p); \	if (cilen != vjlen || \	    citype != opt)  \	    goto bad; \	GETSHORT(cishort, p); \	if (cishort != val) \	    goto bad; \	if (!old) { \	    GETCHAR(cimaxslotindex, p); \	    if (cimaxslotindex != maxslotindex) \		goto bad; \	    GETCHAR(cicflag, p); \	    if (cicflag != cflag) \		goto bad; \	} \    }#define ACKCIADDR(opt, neg, old, val1, val2) \    if (neg) { \	int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \	u_long l; \	if ((len -= addrlen) < 0) \	    goto bad; \

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美伦理视频网站| 欧美视频自拍偷拍| 91在线精品一区二区三区| 在线观看精品一区| 亚洲美女淫视频| 午夜av区久久| 99精品热视频| 久久青草欧美一区二区三区| 亚洲国产欧美另类丝袜| 粉嫩久久99精品久久久久久夜| 欧美美女一区二区三区| 综合久久久久久久| 国产成人免费视频网站高清观看视频 | 日韩午夜激情av| 亚洲久本草在线中文字幕| 国产成人免费在线视频| 亚洲精品一区二区精华| 五月婷婷另类国产| 色综合一个色综合| 亚洲国产精品成人综合| 国产一区美女在线| 欧美一区二区精品在线| 亚洲一区在线观看网站| eeuss鲁片一区二区三区在线看| 精品毛片乱码1区2区3区| 午夜精品在线看| 欧美性欧美巨大黑白大战| 中文字幕中文字幕一区二区| 国产成人在线看| 久久久影视传媒| 国产一区二区三区电影在线观看| 欧美一卡2卡3卡4卡| 日本亚洲免费观看| 日韩一卡二卡三卡四卡| 青青草精品视频| 日韩一区二区三区四区| 捆绑调教一区二区三区| 日韩欧美电影在线| 国内精品视频一区二区三区八戒| 日韩视频123| 美女任你摸久久| 精品国产乱子伦一区| 精品一区二区三区免费毛片爱| 日韩精品影音先锋| 黄网站免费久久| 久久色中文字幕| 成人午夜视频网站| 1区2区3区国产精品| 色综合久久中文综合久久牛| 亚洲一区视频在线| 91精品免费在线| 久久99这里只有精品| 欧美变态口味重另类| 国产精品一区二区不卡| 中文字幕一区二区在线观看| 91蜜桃在线观看| 一区二区三区日韩精品| 欧美剧情片在线观看| 老司机免费视频一区二区 | 一区二区三区免费观看| 欧美性色黄大片手机版| 久色婷婷小香蕉久久| 国产午夜精品在线观看| 99视频一区二区三区| 午夜欧美视频在线观看| www欧美成人18+| 91麻豆精品一区二区三区| 午夜精品福利一区二区三区av| 精品国产免费人成在线观看| 99国产麻豆精品| 免费观看日韩av| 国产精品白丝在线| 欧美一区二区三区四区在线观看| 国产毛片一区二区| 亚洲1区2区3区视频| 久久久久久毛片| 欧美挠脚心视频网站| 国产成人av电影在线| 亚洲国产一区二区a毛片| 亚洲精品一区二区三区精华液| 99久久精品99国产精品| 久久精品国内一区二区三区| 亚洲同性gay激情无套| 日韩欧美一区二区视频| 国产乱人伦偷精品视频不卡 | 欧美电影免费观看高清完整版在线 | 一本色道**综合亚洲精品蜜桃冫| 日日摸夜夜添夜夜添亚洲女人| 久久精子c满五个校花| 欧美日韩精品一区二区天天拍小说| 精品影视av免费| 亚洲午夜成aⅴ人片| 国产精品视频看| 精品国产乱码久久久久久牛牛| 在线视频中文字幕一区二区| 福利一区二区在线观看| 美女精品一区二区| 亚洲国产综合色| 亚洲柠檬福利资源导航| 国产欧美一二三区| 久久久久成人黄色影片| 日韩一区二区精品葵司在线| 欧美日韩国产a| 日本电影亚洲天堂一区| 成人免费福利片| 国产精品一卡二卡在线观看| 麻豆精品久久精品色综合| 午夜在线成人av| 高清beeg欧美| 国产乱人伦偷精品视频免下载 | 亚洲精品久久久蜜桃| 国产精品人人做人人爽人人添| 久久综合精品国产一区二区三区| 欧美一区二区在线视频| 7777精品伊人久久久大香线蕉| 欧美视频一区二区三区四区| 欧美性猛交xxxx黑人交| 在线视频欧美精品| 欧美羞羞免费网站| 欧美色图一区二区三区| 欧美在线观看视频一区二区三区| 色婷婷亚洲综合| 欧美私人免费视频| 欧美一区二区视频在线观看2020| 欧美区视频在线观看| 91精品国产色综合久久久蜜香臀| 7777精品伊人久久久大香线蕉的 | 精品在线播放免费| 国产一区二区伦理片| 国产综合色在线| 国产精品一二三四区| 国产精品99久久久久久久女警| 国内精品国产成人| 成人午夜免费视频| 在线观看欧美黄色| 91精品国产欧美一区二区18| 精品国产欧美一区二区| 国产精品视频线看| 亚洲第一综合色| 日本sm残虐另类| 国产精品综合一区二区三区| 成人av第一页| 欧美日韩国产美| 国产亚洲一区二区三区在线观看| 国产精品色在线| 亚洲h精品动漫在线观看| 久久 天天综合| av综合在线播放| 7777精品伊人久久久大香线蕉超级流畅 | 色综合激情五月| 国产精品 欧美精品| 97久久超碰国产精品| 99re在线精品| 国产欧美一区二区精品性| 欧美激情一二三区| 一区二区三区四区不卡在线 | 石原莉奈在线亚洲二区| 成人动漫av在线| 精品中文字幕一区二区| 岛国一区二区三区| 欧洲精品中文字幕| 久久在线观看免费| 亚洲一区中文在线| 国产精品一色哟哟哟| 精品视频一区二区三区免费| 中文字幕巨乱亚洲| 男男gaygay亚洲| 欧美综合欧美视频| 亚洲高清免费在线| 国产一区二区伦理| 欧美一级片在线观看| 亚洲色图在线播放| 国产一区二区精品在线观看| 欧美日韩国产首页| 《视频一区视频二区| 国产在线一区观看| 欧美日本一区二区在线观看| 亚洲美女淫视频| 成人免费视频网站在线观看| 日韩欧美综合一区| 亚洲成人午夜电影| 91视频你懂的| 国产午夜精品福利| 国模冰冰炮一区二区| 欧美电影一区二区三区| 亚洲欧美日韩精品久久久久| 成人在线视频首页| 久久久午夜精品| 精品一区二区三区在线视频| 91精品国产综合久久久久久久 | 成人永久免费视频| 欧美不卡一区二区三区| 日韩国产成人精品| 在线不卡a资源高清| 亚洲福利视频导航| 欧美影视一区在线| 一区二区三区加勒比av| 色综合久久中文综合久久97| 亚洲欧美日韩在线| 95精品视频在线|