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

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

?? ipxcp.c

?? 自己精簡過的PPPD代碼。在嵌入中應用可以更好的發揮。比原先的小了很多
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * ipxcp.c - PPP IPX Control Protocol. * * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. * * 3. The name "Carnegie Mellon University" must not be used to *    endorse or promote products derived from this software without *    prior written permission. For permission or any legal *    details, please contact *      Office of Technology Transfer *      Carnegie Mellon University *      5000 Forbes Avenue *      Pittsburgh, PA  15213-3890 *      (412) 268-4387, fax: (412) 268-7395 *      tech-transfer@andrew.cmu.edu * * 4. Redistributions of any form whatsoever must retain the following *    acknowledgment: *    "This product includes software developed by Computing Services *     at Carnegie Mellon University (http://www.cmu.edu/computing/)." * * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */#ifdef IPX_CHANGE#define RCSID	"$Id: ipxcp.c,v 1.24 2005/08/25 23:59:34 paulus Exp $"/* * TODO: */#include <stdio.h>#include <string.h>#include <unistd.h>#include <ctype.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include "pppd.h"#include "fsm.h"#include "ipxcp.h"#include "pathnames.h"#include "magic.h"static const char rcsid[] = RCSID;/* global vars */ipxcp_options ipxcp_wantoptions[NUM_PPP];	/* Options that we want to request */ipxcp_options ipxcp_gotoptions[NUM_PPP];	/* Options that peer ack'd */ipxcp_options ipxcp_allowoptions[NUM_PPP];	/* Options we allow peer to request */ipxcp_options ipxcp_hisoptions[NUM_PPP];	/* Options that we ack'd */#define wo (&ipxcp_wantoptions[0])#define ao (&ipxcp_allowoptions[0])#define go (&ipxcp_gotoptions[0])#define ho (&ipxcp_hisoptions[0])/* * Callbacks for fsm code.  (CI = Configuration Information) */static void ipxcp_resetci __P((fsm *));	/* Reset our CI */static int  ipxcp_cilen __P((fsm *));		/* Return length of our CI */static void ipxcp_addci __P((fsm *, u_char *, int *)); /* Add our CI */static int  ipxcp_ackci __P((fsm *, u_char *, int));	/* Peer ack'd our CI */static int  ipxcp_nakci __P((fsm *, u_char *, int, int));/* Peer nak'd our CI */static int  ipxcp_rejci __P((fsm *, u_char *, int));	/* Peer rej'd our CI */static int  ipxcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv CI */static void ipxcp_up __P((fsm *));		/* We're UP */static void ipxcp_down __P((fsm *));		/* We're DOWN */static void ipxcp_finished __P((fsm *));	/* Don't need lower layer */static void ipxcp_script __P((fsm *, char *)); /* Run an up/down script */fsm ipxcp_fsm[NUM_PPP];		/* IPXCP fsm structure */static fsm_callbacks ipxcp_callbacks = { /* IPXCP callback routines */    ipxcp_resetci,		/* Reset our Configuration Information */    ipxcp_cilen,		/* Length of our Configuration Information */    ipxcp_addci,		/* Add our Configuration Information */    ipxcp_ackci,		/* ACK our Configuration Information */    ipxcp_nakci,		/* NAK our Configuration Information */    ipxcp_rejci,		/* Reject our Configuration Information */    ipxcp_reqci,		/* Request peer's Configuration Information */    ipxcp_up,			/* Called when fsm reaches OPENED state */    ipxcp_down,			/* Called when fsm leaves OPENED state */    NULL,			/* Called when we want the lower layer up */    ipxcp_finished,		/* 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 */    "IPXCP"			/* String name of protocol */};/* * Command-line options. */static int setipxnode __P((char **));static void printipxnode __P((option_t *,			      void (*)(void *, char *, ...), void *));static int setipxname __P((char **));static option_t ipxcp_option_list[] = {    { "ipx", o_bool, &ipxcp_protent.enabled_flag,      "Enable IPXCP (and IPX)", OPT_PRIO | 1 },    { "+ipx", o_bool, &ipxcp_protent.enabled_flag,      "Enable IPXCP (and IPX)", OPT_PRIOSUB | OPT_ALIAS | 1 },    { "noipx", o_bool, &ipxcp_protent.enabled_flag,      "Disable IPXCP (and IPX)", OPT_PRIOSUB },    { "-ipx", o_bool, &ipxcp_protent.enabled_flag,      "Disable IPXCP (and IPX)", OPT_PRIOSUB | OPT_ALIAS },    { "ipx-network", o_uint32, &ipxcp_wantoptions[0].our_network,      "Set our IPX network number", OPT_PRIO, &ipxcp_wantoptions[0].neg_nn },    { "ipxcp-accept-network", o_bool, &ipxcp_wantoptions[0].accept_network,      "Accept peer IPX network number", 1,      &ipxcp_allowoptions[0].accept_network },    { "ipx-node", o_special, (void *)setipxnode,      "Set IPX node number", OPT_A2PRINTER, (void *)printipxnode },    { "ipxcp-accept-local", o_bool, &ipxcp_wantoptions[0].accept_local,      "Accept our IPX address", 1,      &ipxcp_allowoptions[0].accept_local },    { "ipxcp-accept-remote", o_bool, &ipxcp_wantoptions[0].accept_remote,      "Accept peer's IPX address", 1,      &ipxcp_allowoptions[0].accept_remote },    { "ipx-routing", o_int, &ipxcp_wantoptions[0].router,      "Set IPX routing proto number", OPT_PRIO,      &ipxcp_wantoptions[0].neg_router },    { "ipx-router-name", o_special, setipxname,      "Set IPX router name", OPT_PRIO | OPT_A2STRVAL | OPT_STATIC,       &ipxcp_wantoptions[0].name },    { "ipxcp-restart", o_int, &ipxcp_fsm[0].timeouttime,      "Set timeout for IPXCP", OPT_PRIO },    { "ipxcp-max-terminate", o_int, &ipxcp_fsm[0].maxtermtransmits,      "Set max #xmits for IPXCP term-reqs", OPT_PRIO },    { "ipxcp-max-configure", o_int, &ipxcp_fsm[0].maxconfreqtransmits,      "Set max #xmits for IPXCP conf-reqs", OPT_PRIO },    { "ipxcp-max-failure", o_int, &ipxcp_fsm[0].maxnakloops,      "Set max #conf-naks for IPXCP", OPT_PRIO },    { NULL }};/* * Protocol entry points. */static void ipxcp_init __P((int));static void ipxcp_open __P((int));static void ipxcp_close __P((int, char *));static void ipxcp_lowerup __P((int));static void ipxcp_lowerdown __P((int));static void ipxcp_input __P((int, u_char *, int));static void ipxcp_protrej __P((int));static int  ipxcp_printpkt __P((u_char *, int,				void (*) __P((void *, char *, ...)), void *));struct protent ipxcp_protent = {    PPP_IPXCP,    ipxcp_init,    ipxcp_input,    ipxcp_protrej,    ipxcp_lowerup,    ipxcp_lowerdown,    ipxcp_open,    ipxcp_close,    ipxcp_printpkt,    NULL,    0,    "IPXCP",    "IPX",    ipxcp_option_list,    NULL,    NULL,    NULL};/* * Lengths of configuration options. */#define CILEN_VOID	2#define CILEN_COMPLETE	2	/* length of complete option */#define CILEN_NETN	6	/* network number length option */#define CILEN_NODEN	8	/* node number length option */#define CILEN_PROTOCOL	4	/* Minimum length of routing protocol */#define CILEN_NAME	3	/* Minimum length of router name */#define CILEN_COMPRESS	4	/* Minimum length of compression protocol */#define CODENAME(x)	((x) == CONFACK ? "ACK" : \			 (x) == CONFNAK ? "NAK" : "REJ")static int ipxcp_is_up;static char *ipx_ntoa __P((u_int32_t));/* Used in printing the node number */#define NODE(base) base[0], base[1], base[2], base[3], base[4], base[5]/* Used to generate the proper bit mask */#define BIT(num)   (1 << (num))/* * Convert from internal to external notation */static short intto_external(internal)short int internal;{    short int  external;    if (internal & BIT(IPX_NONE) )        external = IPX_NONE;    else        external = RIP_SAP;    return external;}/* * Make a string representation of a network IP address. */static char *ipx_ntoa(ipxaddr)u_int32_t ipxaddr;{    static char b[64];    slprintf(b, sizeof(b), "%x", ipxaddr);    return b;}static u_char *setipxnodevalue(src,dst)u_char *src, *dst;{    int indx;    int item;    for (;;) {        if (!isxdigit (*src))	    break;		for (indx = 0; indx < 5; ++indx) {	    dst[indx] <<= 4;	    dst[indx] |= (dst[indx + 1] >> 4) & 0x0F;	}	item = toupper (*src) - '0';	if (item > 9)	    item -= 7;	dst[5] = (dst[5] << 4) | item;	++src;    }    return src;}static int ipx_prio_our, ipx_prio_his;static intsetipxnode(argv)    char **argv;{    char *end;    int have_his = 0;    u_char our_node[6];    u_char his_node[6];    memset (our_node, 0, 6);    memset (his_node, 0, 6);    end = setipxnodevalue (*argv, our_node);    if (*end == ':') {	have_his = 1;	end = setipxnodevalue (++end, his_node);    }    if (*end == '\0') {        ipxcp_wantoptions[0].neg_node = 1;	if (option_priority >= ipx_prio_our) {	    memcpy(&ipxcp_wantoptions[0].our_node[0], our_node, 6);	    ipx_prio_our = option_priority;	}	if (have_his && option_priority >= ipx_prio_his) {	    memcpy(&ipxcp_wantoptions[0].his_node[0], his_node, 6);	    ipx_prio_his = option_priority;	}        return 1;    }    option_error("invalid parameter '%s' for ipx-node option", *argv);    return 0;}static voidprintipxnode(opt, printer, arg)    option_t *opt;    void (*printer) __P((void *, char *, ...));    void *arg;{	unsigned char *p;	p = ipxcp_wantoptions[0].our_node;	if (ipx_prio_our)		printer(arg, "%.2x%.2x%.2x%.2x%.2x%.2x",			p[0], p[1], p[2], p[3], p[4], p[5]);	printer(arg, ":");	p = ipxcp_wantoptions[0].his_node;	if (ipx_prio_his)		printer(arg, "%.2x%.2x%.2x%.2x%.2x%.2x",			p[0], p[1], p[2], p[3], p[4], p[5]);}static intsetipxname (argv)    char **argv;{    char *dest = ipxcp_wantoptions[0].name;    char *src  = *argv;    int  count;    char ch;    ipxcp_wantoptions[0].neg_name  = 1;    ipxcp_allowoptions[0].neg_name = 1;    memset (dest, '\0', sizeof (ipxcp_wantoptions[0].name));    count = 0;    while (*src) {        ch = *src++;	if (! isalnum (ch) && ch != '_') {	    option_error("IPX router name must be alphanumeric or _");	    return 0;	}	if (count >= sizeof (ipxcp_wantoptions[0].name) - 1) {	    option_error("IPX router name is limited to %d characters",			 sizeof (ipxcp_wantoptions[0].name) - 1);	    return 0;	}	dest[count++] = toupper (ch);    }    dest[count] = 0;    return 1;}/* * ipxcp_init - Initialize IPXCP. */static voidipxcp_init(unit)    int unit;{    fsm *f = &ipxcp_fsm[unit];    f->unit	 = unit;    f->protocol	 = PPP_IPXCP;    f->callbacks = &ipxcp_callbacks;    fsm_init(&ipxcp_fsm[unit]);    memset (wo->name,	  0, sizeof (wo->name));    memset (wo->our_node, 0, sizeof (wo->our_node));    memset (wo->his_node, 0, sizeof (wo->his_node));    wo->neg_nn	       = 1;    wo->neg_complete   = 1;    wo->network	       = 0;    ao->neg_node       = 1;    ao->neg_nn	       = 1;    ao->neg_name       = 1;    ao->neg_complete   = 1;    ao->neg_router     = 1;    ao->accept_local   = 0;    ao->accept_remote  = 0;    ao->accept_network = 0;    wo->tried_rip      = 0;    wo->tried_nlsp     = 0;}/* * Copy the node number */static voidcopy_node (src, dst)u_char *src, *dst;{    memcpy (dst, src, sizeof (ipxcp_wantoptions[0].our_node));}/* * Compare node numbers */static intcompare_node (src, dst)u_char *src, *dst;{    return memcmp (dst, src, sizeof (ipxcp_wantoptions[0].our_node)) == 0;}/* * Is the node number zero? */static intzero_node (node)u_char *node;{    int indx;    for (indx = 0; indx < sizeof (ipxcp_wantoptions[0].our_node); ++indx)	if (node [indx] != 0)	    return 0;    return 1;}/* * Increment the node number */static voidinc_node (node)u_char *node;{    u_char   *outp;    u_int32_t magic_num;    outp      = node;    magic_num = magic();    *outp++   = '\0';    *outp++   = '\0';    PUTLONG (magic_num, outp);}/* * ipxcp_open - IPXCP is allowed to come up. */static voidipxcp_open(unit)    int unit;{    fsm_open(&ipxcp_fsm[unit]);}/* * ipxcp_close - Take IPXCP down. */static voidipxcp_close(unit, reason)    int unit;    char *reason;{    fsm_close(&ipxcp_fsm[unit], reason);}/* * ipxcp_lowerup - The lower layer is up. */static voidipxcp_lowerup(unit)    int unit;{    fsm_lowerup(&ipxcp_fsm[unit]);}/* * ipxcp_lowerdown - The lower layer is down. */static voidipxcp_lowerdown(unit)    int unit;{    fsm_lowerdown(&ipxcp_fsm[unit]);}/* * ipxcp_input - Input IPXCP packet. */static voidipxcp_input(unit, p, len)    int unit;    u_char *p;    int len;{    fsm_input(&ipxcp_fsm[unit], p, len);}/* * ipxcp_protrej - A Protocol-Reject was received for IPXCP. * * Pretend the lower layer went down, so we shut up. */static voidipxcp_protrej(unit)    int unit;{    fsm_lowerdown(&ipxcp_fsm[unit]);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三级精品三级在线专区| 激情综合网激情| 麻豆久久一区二区| 色偷偷一区二区三区| 日韩一级欧美一级| 亚洲精品国产a久久久久久| 激情五月婷婷综合网| 91国内精品野花午夜精品 | 成人激情开心网| 777欧美精品| 夜夜嗨av一区二区三区网页| 激情综合网av| 日韩午夜av一区| 精品在线观看免费| 欧美裸体bbwbbwbbw| 亚洲欧洲日韩在线| 国产夫妻精品视频| 欧美一区二区三区视频在线观看| 亚洲人快播电影网| 粉嫩久久99精品久久久久久夜| 欧美高清视频一二三区| 亚洲精品videosex极品| av一二三不卡影片| 日本一区二区三区久久久久久久久不| 日韩国产精品91| 777色狠狠一区二区三区| 亚洲综合久久久| 91国偷自产一区二区使用方法| 国产精品久久久久国产精品日日 | 欧美日韩在线免费视频| 中文字幕一区二区5566日韩| 国产ts人妖一区二区| 久久一日本道色综合| 国产综合色视频| 精品成人a区在线观看| 麻豆91免费看| 日韩精品在线网站| 精品一区二区三区免费| 精品国产一区久久| 国产真实乱对白精彩久久| 337p日本欧洲亚洲大胆精品 | 国产成人精品免费视频网站| 欧美精品一区二区久久久| 久久99在线观看| 精品美女一区二区三区| 精品亚洲免费视频| 久久久久免费观看| 国产999精品久久久久久| 国产精品女主播av| 色94色欧美sute亚洲线路一久| 亚洲欧美日韩国产手机在线 | 伊人性伊人情综合网| 欧美最猛黑人xxxxx猛交| 午夜欧美视频在线观看| 日韩欧美一级在线播放| 国产在线看一区| 中文字幕第一区二区| 91福利视频网站| 日韩影院在线观看| 久久免费偷拍视频| 91在线播放网址| 日本视频一区二区| 国产欧美一区二区精品性 | 黑人巨大精品欧美黑白配亚洲| 精品国产一区二区三区久久影院 | 久久一夜天堂av一区二区三区| 国产成人免费视频一区| 亚洲美女视频一区| 在线不卡的av| 国产成人8x视频一区二区| 一区二区三区欧美日韩| 日韩精品自拍偷拍| 91碰在线视频| 国产一区二区在线观看视频| 中文字幕视频一区| 精品免费一区二区三区| 色综合久久66| 国产成人福利片| 五月婷婷久久综合| 亚洲欧洲国产日本综合| 日韩欧美二区三区| 在线欧美一区二区| 国产精品888| 蜜桃av一区二区| 亚洲18色成人| 国产精品短视频| 精品国产凹凸成av人网站| 欧洲亚洲国产日韩| www.性欧美| 国内精品视频一区二区三区八戒| 亚洲一二三四久久| 国产精品欧美一区喷水| 这里只有精品99re| 色噜噜狠狠成人网p站| 国产精品一级二级三级| 日韩一区精品视频| 一区二区三区.www| 成人欧美一区二区三区在线播放| 欧美白人最猛性xxxxx69交| 欧美日韩视频在线观看一区二区三区| 成人综合婷婷国产精品久久免费| 另类综合日韩欧美亚洲| 亚洲成人自拍偷拍| 亚洲乱码国产乱码精品精小说| 国产人妖乱国产精品人妖| 精品久久五月天| 在线不卡中文字幕播放| 欧美精品国产精品| 欧美亚洲愉拍一区二区| 一本一本大道香蕉久在线精品 | 麻豆精品一区二区三区| 亚洲电影视频在线| 亚洲chinese男男1069| 亚洲成人午夜影院| 亚洲一区二区精品久久av| 亚洲黄色av一区| 久久精品久久综合| 免费欧美在线视频| 久久精品国产精品亚洲红杏| 天天综合天天综合色| 日韩精品一级中文字幕精品视频免费观看 | 色婷婷久久久综合中文字幕| 99在线视频精品| av午夜一区麻豆| 色哟哟在线观看一区二区三区| 99精品视频中文字幕| 91首页免费视频| 91成人在线精品| 欧美日本乱大交xxxxx| 欧美精品 日韩| 欧美mv和日韩mv国产网站| 久久综合成人精品亚洲另类欧美| 国产欧美一区二区三区沐欲| 国产精品高清亚洲| 一区二区在线看| 午夜影院久久久| 精品综合久久久久久8888| 国产精品18久久久久久久久久久久 | 国产宾馆实践打屁股91| 91在线观看免费视频| 欧美美女直播网站| 日韩免费一区二区三区在线播放| 久久久精品综合| 亚洲欧美日韩中文字幕一区二区三区| 亚洲成人av电影在线| 国产在线国偷精品产拍免费yy | 九九视频精品免费| 成人国产精品免费| 欧美日韩午夜影院| 久久久91精品国产一区二区三区| 亚洲三级视频在线观看| 日韩精彩视频在线观看| 高清视频一区二区| 欧美美女直播网站| 国产精品素人视频| 香蕉加勒比综合久久| 国产精品亚洲成人| 欧美色图片你懂的| 久久精品视频一区二区三区| 亚洲精品中文字幕乱码三区| 青青草原综合久久大伊人精品优势| 国产精品456| 欧美日韩国产另类不卡| 欧美国产日韩a欧美在线观看| 一区二区三区在线观看欧美| 狠狠色丁香婷婷综合| 欧美专区亚洲专区| 日本一区二区三区四区| 亚洲18女电影在线观看| 成熟亚洲日本毛茸茸凸凹| 欧美日韩亚洲国产综合| 国产精品入口麻豆九色| 奇米色一区二区| 在线视频综合导航| 中文一区在线播放| 久久电影国产免费久久电影| 在线看国产日韩| 亚洲私人影院在线观看| 国产福利一区在线观看| 日韩美女一区二区三区四区| 一区二区三区精品视频| 成人av中文字幕| 精品福利av导航| 日本亚洲视频在线| 色呦呦国产精品| 国产精品免费观看视频| 麻豆精品蜜桃视频网站| 欧美精品aⅴ在线视频| 亚洲激情欧美激情| 成人网页在线观看| 久久综合九色综合97婷婷女人 | 欧美三级蜜桃2在线观看| 亚洲色图都市小说| 不卡的av在线| 中文字幕日韩精品一区 | 亚洲国产精品激情在线观看| 精品制服美女丁香| 欧美成人三级在线| 狠狠色丁香婷婷综合久久片| 日韩一区二区三|