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

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

?? ppp.h

?? ppp協議的lwip源代碼
?? H
字號:
/*****************************************************************************
* ppp.h - Network Point to Point Protocol header file.
*
* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
* portions Copyright (c) 1997 Global Election Systems Inc.
*
* The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided
* that existing copyright notices are retained in all copies and that this
* notice and the following disclaimer are included verbatim in any 
* distributions. No written agreement, license, or royalty fee is required
* for any of the authorized uses.
*
* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
* IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
* REVISION HISTORY
*
* 03-01-01 Marc Boucher <marc@mbsi.ca>
*   Ported to lwIP.
* 97-11-05 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
*	Original derived from BSD codes.
*****************************************************************************/

#ifndef PPP_H
#define PPP_H

/*
 * pppd.h - PPP daemon global declarations.
 *
 * 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.
 *
 */
/*
 * ppp_defs.h - PPP definitions.
 *
 * Copyright (c) 1994 The Australian National University.
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation is hereby granted, provided that the above copyright
 * notice appears in all copies.  This software is provided without any
 * warranty, express or implied. The Australian National University
 * makes no representations about the suitability of this software for
 * any purpose.
 *
 * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
 * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
 * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
 * OF SUCH DAMAGE.
 *
 * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
 * OR MODIFICATIONS.
 */

/*
 * Constants and structures defined by the internet system,
 * Per RFC 790, September 1981, and numerous additions.
 */

/*
 * The basic PPP frame.
 */
#define PPP_HDRLEN  4       /* octets for standard ppp header */
#define PPP_FCSLEN  2       /* octets for FCS */


/*
 * Significant octet values.
 */
#define PPP_ALLSTATIONS 0xff    /* All-Stations broadcast address */
#define PPP_UI          0x03    /* Unnumbered Information */
#define PPP_FLAG        0x7e    /* Flag Sequence */
#define PPP_ESCAPE      0x7d    /* Asynchronous Control Escape */
#define PPP_TRANS       0x20    /* Asynchronous transparency modifier */

/*
 * Protocol field values.
 */
#define PPP_IP          0x21    /* Internet Protocol */
#define PPP_AT          0x29    /* AppleTalk Protocol */
#define PPP_VJC_COMP    0x2d    /* VJ compressed TCP */
#define PPP_VJC_UNCOMP  0x2f    /* VJ uncompressed TCP */
#define PPP_COMP        0xfd    /* compressed packet */
#define PPP_IPCP        0x8021  /* IP Control Protocol */
#define PPP_ATCP        0x8029  /* AppleTalk Control Protocol */
#define PPP_CCP         0x80fd  /* Compression Control Protocol */
#define PPP_LCP         0xc021  /* Link Control Protocol */
#define PPP_PAP         0xc023  /* Password Authentication Protocol */
#define PPP_LQR         0xc025  /* Link Quality Report protocol */
#define PPP_CHAP        0xc223  /* Cryptographic Handshake Auth. Protocol */
#define PPP_CBCP        0xc029  /* Callback Control Protocol */

/*
 * Values for FCS calculations.
 */
#define PPP_INITFCS 0xffff  /* Initial FCS value */
#define PPP_GOODFCS 0xf0b8  /* Good final FCS value */
#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])

/*
 * Extended asyncmap - allows any character to be escaped.
 */
typedef u_char  ext_accm[32];

/*
 * What to do with network protocol (NP) packets.
 */
enum NPmode {
    NPMODE_PASS,        /* pass the packet through */
    NPMODE_DROP,        /* silently drop the packet */
    NPMODE_ERROR,       /* return an error */
    NPMODE_QUEUE        /* save it up for later. */
};

/*
 * Inline versions of get/put char/short/long.
 * Pointer is advanced; we assume that both arguments
 * are lvalues and will already be in registers.
 * cp MUST be u_char *.
 */
#define GETCHAR(c, cp) { \
    (c) = *(cp)++; \
}
#define PUTCHAR(c, cp) { \
    *(cp)++ = (u_char) (c); \
}


#define GETSHORT(s, cp) { \
    (s) = *(cp)++ << 8; \
    (s) |= *(cp)++; \
}
#define PUTSHORT(s, cp) { \
    *(cp)++ = (u_char) ((s) >> 8); \
    *(cp)++ = (u_char) (s); \
}

#define GETLONG(l, cp) { \
    (l) = *(cp)++ << 8; \
    (l) |= *(cp)++; (l) <<= 8; \
    (l) |= *(cp)++; (l) <<= 8; \
    (l) |= *(cp)++; \
}
#define PUTLONG(l, cp) { \
    *(cp)++ = (u_char) ((l) >> 24); \
    *(cp)++ = (u_char) ((l) >> 16); \
    *(cp)++ = (u_char) ((l) >> 8); \
    *(cp)++ = (u_char) (l); \
}


#define INCPTR(n, cp)   ((cp) += (n))
#define DECPTR(n, cp)   ((cp) -= (n))

#define BCMP(s0, s1, l)     memcmp((u_char *)(s0), (u_char *)(s1), (l))
#define BCOPY(s, d, l)      memcpy((d), (s), (l))
#define BZERO(s, n)         memset(s, 0, n)

#define PRINTMSG(m, l)  { m[l] = '\0'; ppp_trace(LOG_INFO, "Remote message: %s\n", m); }

/*
 * MAKEHEADER - Add PPP Header fields to a packet.
 */
#define MAKEHEADER(p, t) { \
    PUTCHAR(PPP_ALLSTATIONS, p); \
    PUTCHAR(PPP_UI, p); \
    PUTSHORT(t, p); }

/*
 * Definitions of bits in internet address integers.
 * On subnets, the decomposition of addresses to host and net parts
 * is done according to subnet mask, not the masks here.
 */
#define IN_CLASSA(i)        (((long)(i) & 0x80000000) == 0)
#define IN_CLASSA_NET       0xff000000
#define IN_CLASSA_NSHIFT    24
#define IN_CLASSA_HOST      0x00ffffff
#define IN_CLASSA_MAX       128

#define IN_CLASSB(i)        (((long)(i) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET       0xffff0000
#define IN_CLASSB_NSHIFT    16
#define IN_CLASSB_HOST      0x0000ffff
#define IN_CLASSB_MAX       65536

#define IN_CLASSC(i)        (((long)(i) & 0xe0000000) == 0xc0000000)
#define IN_CLASSC_NET       0xffffff00
#define IN_CLASSC_NSHIFT    8
#define IN_CLASSC_HOST      0x000000ff

#define IN_CLASSD(i)        (((long)(i) & 0xf0000000) == 0xe0000000)
#define IN_CLASSD_NET       0xf0000000  /* These ones aren't really */
#define IN_CLASSD_NSHIFT    28      /* net and host fields, but */
#define IN_CLASSD_HOST      0x0fffffff  /* routing needn't know.    */
#define IN_MULTICAST(i)     IN_CLASSD(i)

#define IN_EXPERIMENTAL(i)  (((long)(i) & 0xf0000000) == 0xf0000000)
#define IN_BADCLASS(i)      (((long)(i) & 0xf0000000) == 0xf0000000)

#define IN_LOOPBACKNET      127         /* official! */


/*************************
*** PUBLIC DEFINITIONS ***
*************************/

/* Error codes. */
#define PPPERR_NONE 0				/* No error. */
#define PPPERR_PARAM -1				/* Invalid parameter. */
#define PPPERR_OPEN -2				/* Unable to open PPP session. */
#define PPPERR_DEVICE -3			/* Invalid I/O device for PPP. */
#define PPPERR_ALLOC -4				/* Unable to allocate resources. */
#define PPPERR_USER -5				/* User interrupt. */
#define PPPERR_CONNECT -6			/* Connection lost. */
#define PPPERR_AUTHFAIL -7			/* Failed authentication challenge. */
#define PPPERR_PROTOCOL -8			/* Failed to meet protocol. */

/*
 * PPP IOCTL commands.
 */
/*
 * Get the up status - 0 for down, non-zero for up.  The argument must
 * point to an int.
 */
#define PPPCTLG_UPSTATUS 100	// Get the up status - 0 down else up
#define PPPCTLS_ERRCODE 101		// Set the error code
#define PPPCTLG_ERRCODE 102		// Get the error code
#define	PPPCTLG_FD		103		// Get the fd associated with the ppp

/************************
*** PUBLIC DATA TYPES ***
************************/

/*
 * The following struct gives the addresses of procedures to call
 * for a particular protocol.
 */
struct protent {
    u_short protocol;       /* PPP protocol number */
    /* Initialization procedure */
    void (*init) (int unit);
    /* Process a received packet */
    void (*input) (int unit, u_char *pkt, int len);
    /* Process a received protocol-reject */
    void (*protrej) (int unit);
    /* Lower layer has come up */
    void (*lowerup) (int unit);
    /* Lower layer has gone down */
    void (*lowerdown) (int unit);
    /* Open the protocol */
    void (*open) (int unit);
    /* Close the protocol */
    void (*close) (int unit, char *reason);
#if 0
    /* Print a packet in readable form */
    int  (*printpkt) (u_char *pkt, int len,
              void (*printer) (void *, char *, ...),
              void *arg);
    /* Process a received data packet */
    void (*datainput) (int unit, u_char *pkt, int len);
#endif
    int  enabled_flag;      /* 0 iff protocol is disabled */
    char *name;         /* Text name of protocol */
#if 0
    /* Check requested options, assign defaults */
    void (*check_options) (u_long);
    /* Configure interface for demand-dial */
    int  (*demand_conf) (int unit);
    /* Say whether to bring up link for this pkt */
    int  (*active_pkt) (u_char *pkt, int len);
#endif
};

/*
 * The following structure records the time in seconds since
 * the last NP packet was sent or received.
 */
struct ppp_idle {
    u_short xmit_idle;      /* seconds since last NP packet sent */
    u_short recv_idle;      /* seconds since last NP packet received */
};

struct ppp_settings {

	u_int  disable_defaultip : 1;   /* Don't use hostname for default IP addrs */
	u_int  auth_required : 1;      /* Peer is required to authenticate */
	u_int  explicit_remote : 1;    /* remote_name specified with remotename opt */
	u_int  refuse_pap : 1;         /* Don't wanna auth. ourselves with PAP */
	u_int  refuse_chap : 1;        /* Don't wanna auth. ourselves with CHAP */
	u_int  usehostname : 1;        /* Use hostname for our_name */
	u_int  usepeerdns : 1;         /* Ask peer for DNS adds */

	u_short idle_time_limit; /* Shut down link if idle for this long */
	int  maxconnect;         /* Maximum connect time (seconds) */

	char user[MAXNAMELEN + 1];/* Username for PAP */
	char passwd[MAXNAMELEN + 1];           /* Password for PAP */
	char our_name[MAXNAMELEN + 1];         /* Our name for authentication purposes */
	char remote_name[MAXNAMELEN + 1];      /* Peer's name for authentication */
};


/*****************************
*** PUBLIC DATA STRUCTURES ***
*****************************/
/* Buffers for outgoing packets. */
extern u_char outpacket_buf[NUM_PPP][PPP_MRU+PPP_HDRLEN];

extern struct ppp_settings ppp_settings;

extern struct protent *ppp_protocols[];/* Table of pointers to supported protocols */


/***********************
*** PUBLIC FUNCTIONS ***
***********************/

/* Initialize the PPP subsystem. */
void pppInit(void);

void pppSetAuth(const char *user, const char *passwd);

/*
 * Open a new PPP connection using the given I/O device.
 * This initializes the PPP control block but does not
 * attempt to negotiate the LCP session.
 * Return a new PPP connection descriptor on success or
 * an error code (negative) on failure. 
 */
int pppOpen(ppp_sio_fd_t fd, void (*linkStatusCB)(void *arg, int errCode), void *linkStatusArg);

/*
 * Close a PPP connection and release the descriptor. 
 * Any outstanding packets in the queues are dropped.
 * Return 0 on success, an error code on failure. 
 */
int pppClose(int pd);

/*
 * Get and set parameters for the given connection.
 * Return 0 on success, an error code on failure. 
 */
int  pppIOCtl(int pd, int cmd, void *arg);

/*
 * Return the Maximum Transmission Unit for the given PPP connection.
 */
u_int pppMTU(int pd);

/*
 * Write n characters to a ppp link.
 *	RETURN: >= 0 Number of characters written
 *		 	 -1 Failed to write to device
 */
int pppWrite(int pd, const u_char *s, int n);

void pppMainWakeup(int pd);

/* Configure i/f transmit parameters */
void ppp_send_config (int, int, u32_t, int, int);
/* Set extended transmit ACCM */
void ppp_set_xaccm (int, ext_accm *);
/* Configure i/f receive parameters */
void ppp_recv_config (int, int, u32_t, int, int);
/* Find out how long link has been idle */
int  get_idle_time (int, struct ppp_idle *);

/* Configure VJ TCP header compression */
int  sifvjcomp (int, int, int, int);
/* Configure i/f down (for IP) */
int  sifup (int);		
/* Set mode for handling packets for proto */
int  sifnpmode (int u, int proto, enum NPmode mode);
/* Configure i/f down (for IP) */
int  sifdown (int);	
/* Configure IP addresses for i/f */
int  sifaddr (int, u32_t, u32_t, u32_t);
/* Reset i/f IP addresses */
int  cifaddr (int, u32_t, u32_t);
/* Create default route through i/f */
int  sifdefaultroute (int, u32_t, u32_t);
/* Delete default route through i/f */
int  cifdefaultroute (int, u32_t, u32_t);

/* Get appropriate netmask for address */
u32_t GetMask (u32_t); 

#endif /* PPP_H */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区二区三区免费看| 国产白丝网站精品污在线入口| 日本一区免费视频| 精品粉嫩超白一线天av| 精品少妇一区二区三区免费观看 | 欧美成va人片在线观看| 欧美日韩一区二区三区在线看| 一本色道综合亚洲| 在线这里只有精品| 欧美亚洲国产怡红院影院| 色综合色狠狠天天综合色| 色先锋资源久久综合| 欧美在线看片a免费观看| 欧美三级日本三级少妇99| 欧美肥妇bbw| 精品国产一区久久| 国产精品少妇自拍| 亚洲一区二区三区中文字幕| 五月婷婷综合在线| 久久99精品一区二区三区三区| 精品影院一区二区久久久| 国产伦精品一区二区三区免费迷| 国产精品一二一区| 一本一道久久a久久精品综合蜜臀| 色综合激情五月| 91精品国产综合久久香蕉的特点| 日韩欧美资源站| 国产午夜精品一区二区三区视频 | 在线一区二区观看| 9191成人精品久久| 国产日韩欧美综合在线| 亚洲激情欧美激情| 韩国毛片一区二区三区| 本田岬高潮一区二区三区| 欧美精品色综合| 欧美激情一二三区| 亚洲国产另类av| 国产精品91一区二区| 在线视频你懂得一区二区三区| 日韩精品一区二区三区在线观看| 日本一区二区视频在线| 日韩av电影天堂| 91丨porny丨国产| 精品乱人伦小说| 亚洲综合无码一区二区| 国产成人综合亚洲网站| 欧美日韩高清一区| 亚洲欧美日韩成人高清在线一区| 久久国产欧美日韩精品| 欧美色图在线观看| 中文字幕精品—区二区四季| 免费观看91视频大全| 色综合夜色一区| 国产三级精品三级| 麻豆精品国产传媒mv男同| 欧美视频在线观看一区二区| 国产精品欧美经典| 国产剧情一区二区三区| 日韩精品一区二区三区中文精品| 亚洲午夜视频在线| 在线免费观看日本欧美| 国产精品久线观看视频| 国产一区二区三区电影在线观看| 欧美一级艳片视频免费观看| 亚洲久草在线视频| 91丨九色丨国产丨porny| 国产精品乱人伦| 成人的网站免费观看| 久久精品亚洲精品国产欧美kt∨ | 久久美女艺术照精彩视频福利播放| 亚洲高清中文字幕| 欧美在线免费播放| 亚洲永久精品国产| 欧美中文字幕一区二区三区亚洲| 亚洲少妇最新在线视频| 色综合激情五月| 亚洲精品免费在线| 欧美三级一区二区| 亚洲国产精品自拍| 欧美顶级少妇做爰| 日韩av一级电影| 337p日本欧洲亚洲大胆色噜噜| 老司机精品视频在线| 欧美变态凌虐bdsm| 国产suv精品一区二区6| 中日韩免费视频中文字幕| 成人精品在线视频观看| 亚洲三级理论片| 国产精品不卡一区二区三区| 亚洲久草在线视频| 国产精品萝li| 国产a区久久久| 精品毛片乱码1区2区3区| 成人精品电影在线观看| 国产精品亚洲专一区二区三区| 日韩一区二区在线看| av影院午夜一区| 国产精品123| 麻豆精品视频在线| 日韩有码一区二区三区| 夜夜嗨av一区二区三区中文字幕| 国产日本欧美一区二区| 精品盗摄一区二区三区| 欧美一级二级在线观看| 欧美人动与zoxxxx乱| 欧美图片一区二区三区| 欧洲日韩一区二区三区| av一区二区三区| 91麻豆免费在线观看| 成年人网站91| av亚洲精华国产精华精| 97se亚洲国产综合自在线不卡| 成人性生交大片免费看中文| 国产69精品一区二区亚洲孕妇 | 91精品黄色片免费大全| 欧美三级三级三级爽爽爽| 欧美日韩一区在线观看| 欧美日韩视频在线观看一区二区三区| 色偷偷久久一区二区三区| av亚洲精华国产精华| 91麻豆6部合集magnet| 色婷婷国产精品综合在线观看| 91同城在线观看| 欧美午夜片在线看| 91精品啪在线观看国产60岁| 91精品国产综合久久久久久久久久| 欧美精品久久久久久久久老牛影院| 欧美日韩一区二区三区在线看| 91精品黄色片免费大全| 久久婷婷综合激情| 国产精品久久久一本精品| 亚洲精品国产一区二区三区四区在线| 亚洲卡通欧美制服中文| 亚洲第一二三四区| 激情综合一区二区三区| 成人黄色免费短视频| 色哟哟一区二区三区| 91精品在线免费观看| 久久香蕉国产线看观看99| 一区在线播放视频| 天堂一区二区在线| 国产精品一区一区三区| 色婷婷综合久久久中文一区二区| 欧美日韩在线一区二区| 日韩精品最新网址| 中文字幕亚洲综合久久菠萝蜜| 亚洲午夜私人影院| 国产麻豆精品theporn| 在线观看国产日韩| 精品国产乱码久久久久久浪潮| 国产精品成人免费| 蜜桃视频第一区免费观看| 成人午夜av影视| 欧美精品第一页| 国产欧美日韩三级| 视频在线观看国产精品| 成人av网站在线观看免费| 欧美浪妇xxxx高跟鞋交| 国产精品日日摸夜夜摸av| 偷拍自拍另类欧美| 99久久er热在这里只有精品15 | 日韩精品一区二区三区蜜臀 | 日韩丝袜情趣美女图片| 中文字幕色av一区二区三区| 日本成人在线电影网| 91色|porny| 精品精品国产高清一毛片一天堂| 综合分类小说区另类春色亚洲小说欧美| 日韩激情一区二区| 欧美性大战久久| 国产精品久久久久久久裸模| 秋霞成人午夜伦在线观看| 91蜜桃网址入口| 中文字幕不卡三区| 九一九一国产精品| 欧美日韩三级一区| 亚洲男帅同性gay1069| 国产乱淫av一区二区三区| 欧美一区二区三区四区久久| 一区二区三区在线影院| 国产成人福利片| 久久久影视传媒| 麻豆精品新av中文字幕| 91精品国产91久久综合桃花| 亚洲精品国产成人久久av盗摄| 成人av在线一区二区| 国产日韩av一区| 国产精品亚洲一区二区三区妖精 | 久久精品国产澳门| 欧美军同video69gay| 一区二区免费在线| 91国模大尺度私拍在线视频| 最新国产の精品合集bt伙计| 岛国av在线一区| 国产精品毛片高清在线完整版| 国产成人综合在线| 国产精品毛片大码女人| 99久久夜色精品国产网站| 综合色中文字幕| 欧美自拍偷拍一区|