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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ipxcp.c

?? 自己精簡過的PPPD代碼。在嵌入中應用可以更好的發(fā)揮。比原先的小了很多
?? 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一区二区三区免费野_久草精品视频
国产日韩精品一区二区三区| 99热在这里有精品免费| 91精品国产乱| 青娱乐精品在线视频| 欧美精品高清视频| 美腿丝袜一区二区三区| 久久天天做天天爱综合色| 国产一区二区视频在线播放| 亚洲国产精品v| 91丨九色porny丨蝌蚪| 亚洲国产一区二区在线播放| 欧美一三区三区四区免费在线看| 久久爱www久久做| 国产精品美女久久福利网站| 99精品欧美一区二区三区综合在线| 国产精品的网站| 欧美日韩视频在线第一区| 蜜桃精品视频在线| 国产精品网站导航| 欧美日韩免费一区二区三区视频| 日本午夜精品视频在线观看| 国产免费观看久久| 欧美熟乱第一页| 国产乱子伦视频一区二区三区| 18成人在线观看| 欧美成人在线直播| 成人动漫一区二区在线| 亚洲午夜视频在线观看| 精品福利在线导航| 在线观看视频一区二区 | 日本一区二区成人| 在线视频你懂得一区二区三区| 老鸭窝一区二区久久精品| 国产精品免费aⅴ片在线观看| 日本精品一区二区三区高清| 久久99国产精品尤物| 亚洲欧美日韩精品久久久久| 在线综合+亚洲+欧美中文字幕| 丁香亚洲综合激情啪啪综合| 午夜精品成人在线| 国产精品美女久久久久av爽李琼| 欧美人狂配大交3d怪物一区| 国产成人免费视频| 日韩在线一二三区| 日韩理论片在线| 久久综合久久综合九色| 欧美日韩国产高清一区二区| av亚洲精华国产精华精| 国内成人免费视频| 日韩—二三区免费观看av| 亚洲精品中文在线| 中文久久乱码一区二区| 精品免费日韩av| 欧美顶级少妇做爰| 欧美专区亚洲专区| 972aa.com艺术欧美| 国产激情视频一区二区三区欧美| 蜜桃精品视频在线观看| 丝袜亚洲另类丝袜在线| 亚洲一线二线三线视频| 国产精品国产精品国产专区不片| 精品对白一区国产伦| 欧美电影一区二区| 欧美色倩网站大全免费| 9i在线看片成人免费| 国产成人精品三级| 国产麻豆日韩欧美久久| 国产九色sp调教91| 免费日本视频一区| 日韩激情一区二区| 午夜av电影一区| 三级一区在线视频先锋| 亚洲电影欧美电影有声小说| 亚洲在线成人精品| 一区二区理论电影在线观看| 国产精品色呦呦| 中文字幕精品在线不卡| 国产精品三级av在线播放| 久久精品日韩一区二区三区| 精品va天堂亚洲国产| 欧美不卡视频一区| 欧美xxx久久| 精品福利一区二区三区| 国产日韩视频一区二区三区| 欧美精品一区二区不卡| 26uuuu精品一区二区| 国产午夜精品一区二区三区视频 | 日韩一区二区视频在线观看| 在线电影院国产精品| 538在线一区二区精品国产| 7777精品伊人久久久大香线蕉经典版下载 | 国产麻豆一精品一av一免费| 国产一区二区三区在线观看免费 | 天天综合色天天综合色h| 日韩黄色小视频| 国产资源精品在线观看| 高清不卡一区二区| 91丨九色丨国产丨porny| 欧美午夜精品久久久久久孕妇| 欧美欧美欧美欧美首页| 日韩一区二区三区在线观看| 精品伦理精品一区| 国产精品电影院| 午夜精品福利视频网站| 国产精品正在播放| 91香蕉视频mp4| 欧美精品久久久久久久多人混战 | 欧美精品一区二| 国产精品沙发午睡系列990531| 一区二区三区中文字幕精品精品 | 一区二区三区美女视频| 午夜精品123| 韩国成人精品a∨在线观看| 99视频精品在线| 欧美精品电影在线播放| 国产婷婷色一区二区三区| 亚洲美女屁股眼交3| 美女一区二区三区| 99久久精品国产导航| 91精品在线麻豆| 国产精品丝袜91| 日韩中文欧美在线| 99精品国产一区二区三区不卡| 欧美日韩一卡二卡| 国产日韩精品久久久| 亚洲一区二区精品视频| 国产一区二区日韩精品| 欧洲在线/亚洲| 国产亚洲综合av| 亚洲成人av电影在线| 国产成人在线免费观看| 欧美揉bbbbb揉bbbbb| 中文字幕高清一区| 久久精品噜噜噜成人av农村| 色综合天天视频在线观看| 欧美一区二区在线免费播放| 亚洲免费在线视频一区 二区| 久国产精品韩国三级视频| 欧美亚洲丝袜传媒另类| 中文字幕国产一区| 狠狠色丁香婷婷综合久久片| 欧美网站一区二区| 一区在线观看视频| 国产一本一道久久香蕉| 欧美一区二区三区四区视频| 亚洲精品成人天堂一二三| 国产高清成人在线| 精品剧情v国产在线观看在线| 亚洲国产日韩综合久久精品| 99精品久久只有精品| 久久久久国色av免费看影院| 日本aⅴ免费视频一区二区三区| 色香蕉成人二区免费| 亚洲国产精品二十页| 国产精品一二三四| 日韩美女视频在线| 日日摸夜夜添夜夜添国产精品| 97久久超碰国产精品电影| 国产三区在线成人av| 极品少妇xxxx精品少妇偷拍| 在线播放视频一区| 亚洲国产成人91porn| 在线视频一区二区免费| 亚洲激情在线播放| 色呦呦国产精品| 亚洲日本va午夜在线影院| va亚洲va日韩不卡在线观看| 久久久99久久精品欧美| 国产精品中文有码| 国产亚洲精品7777| 国产乱码精品一区二区三区五月婷| 日韩欧美电影一区| 极品瑜伽女神91| 精品99一区二区三区| 国产一区二区成人久久免费影院| 欧美成人猛片aaaaaaa| 韩国av一区二区| 久久午夜老司机| 成人黄色片在线观看| 国产精品毛片无遮挡高清| 成人一二三区视频| 亚洲欧洲另类国产综合| 91蜜桃在线观看| 亚洲成人你懂的| 日韩欧美激情四射| 国产毛片精品国产一区二区三区| 国产亚洲精品精华液| 99久久99久久精品国产片果冻| 亚洲欧洲av另类| 欧美三级视频在线观看| 奇米影视在线99精品| 精品国产一区二区在线观看| 国产成人高清视频| 亚洲视频每日更新| 91精品国产色综合久久| 国产精品一二三四五| 一区二区视频免费在线观看| 91精品国产色综合久久| 成人免费高清视频在线观看| 一区二区三国产精华液|