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

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

?? if_ppp.c

?? vxworks的源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* if_ppp.c - Point-to-Point Protocol (PPP) Asynchronous driver *//* Copyright 1996 - 2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*	$NetBSD: if_ppp.c,v 1.20 1994/10/30 21:48:52 cgd Exp $	*//* * if_ppp.c - Point-to-Point Protocol (PPP) Asynchronous driver. * * 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. * * Drew D. Perkins * Carnegie Mellon University * 4910 Forbes Ave. * Pittsburgh, PA 15213 * (412) 268-8576 * ddp@andrew.cmu.edu * * Based on: *	@(#)if_sl.c	7.6.1.2 (Berkeley) 2/15/89 * * Copyright (c) 1987 Regents of the University of California. * 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 the University of California, Berkeley.  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. * * Serial Line interface * * Rick Adams * Center for Seismic Studies * 1300 N 17th Street, Suite 1450 * Arlington, Virginia 22209 * (703)276-7900 * rick@seismo.ARPA * seismo!rick * * Pounded on heavily by Chris Torek (chris@mimsy.umd.edu, umcp-cs!chris). * Converted to 4.3BSD Beta by Chris Torek. * Other changes made at Berkeley, based in part on code by Kirk Smith. * * Converted to 4.3BSD+ 386BSD by Brad Parker (brad@cayman.com) * Added VJ tcp header compression; more unified ioctls * * Extensively modified by Paul Mackerras (paulus@cs.anu.edu.au). * Cleaned up a lot of the mbuf-related code to fix bugs that * caused system crashes and packet corruption.  Changed pppstart * so that it doesn't just give up with a collision if the whole * packet doesn't fit in the output ring buffer. * * Added priority queueing for interactive IP packets, following * the model of if_sl.c, plus hooks for bpf. * Paul Mackerras (paulus@cs.anu.edu.au). *//* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp *//*modification history--------------------01z,13jan03,rae  Merged from velocecp branch01y,20may02,vvv  modified receive mechanism to use ipintr without queueing01x,28mar02,jmp  Increased again read buffer size for solaris simulator and		 added global variable simPppRBufSize to make this buffer		 size increasable from solaris's bsp (SPR #74733).01w,17sep01,jmp  Increased read buffer size for solaris simulator (SPR                 #34025).01v,06feb01,ijm  Fix for SPR# 62196: pppDelete should not delete ppp_wrt_task		 while it holds the semaphore that tNetTask needs to run.01u,17oct00,spm  updated for new if_attach: reports memory allocation failures01t,16apr99,koz  Fix for 25165, communications error handling01s,17feb99,sgv  Fix for spr 23702, pppintr check for NULL ppp_softc01r,17feb99,sgv  Fix for spr 24459. pppalloc was not setting the correct		 ppp_softc structure to NULL on error condition01q.10sep98,sgv  Added fix for interoperating with Windows01p,18aug97,jmb  Add code to discard packets at interrupt level due		 to overflow of input ring buffer.01o,30dec97,sgv  fixed problem in PPP output Hooks01n,26sep97,sgv  Added PPP output Hooks01m,19sep97,vin  changed m_ext.ext_buf to m_extBuf and m_ext.ext_size to		 m_extSize01l,14nov96,vin  upgraded to use new buffering scheme.01k,13aug96,vin  upgraded to BSD4.4, removed call in_ifaddr_remove as it is 		 being done in if_dettach. 01j,30jul95,dzb  cleanup on errors while openning serial device.01i,05jul95,dzb  close out serial fd on errors in pppalloc().01h,12jun95,dzb  added SNMP MIBII support (counters and ioctl).                 header file consolidation.01g,24apr95,dzb  removed in_ifaddr_remove() because added to in.c (SPR #4109).01f,09mar95,dzb  added counters for ip packets sent/received.01e,06mar95,dzb  changed cfree() to free() (ANSI).01d,09feb95,dab  added SIOCGIFMTU command to ppptioctl().01c,07feb95,dzb  changed pppoutput() to return errno, instead of ERROR.                 removed redundant mbuf check from ppp_wrt_flush().		 zeroed out m_len after MGET (SPR #4037).01b,16jan95,dzb  warnings cleanup.  moved global prototypes to if_ppp.h.01a,21dec94,dab  VxWorks port - first WRS version.           +dzb  added: path for ppp header files, WRS copyright.*/#include "vxWorks.h"#include "net/mbuf.h"#include "sockLib.h"#include "ioctl.h"#include "stdio.h"#include "errnoLib.h"#include "ioLib.h"#include "iosLib.h"#include "semLib.h"#include "memLib.h"#include "taskLib.h"#include "signal.h"#include "sigLib.h"#include "etherLib.h"#include "netLib.h"#include "m2Lib.h"#include "private/m2LibP.h"#include "net/if.h"#include "net/unixLib.h"#include "net/route.h"#include "netinet/in.h"#include "netinet/in_systm.h"#include "netinet/in_var.h"#include "netinet/ip.h"#include "netinet/ip_var.h"#include "pppLib.h"#include "rngLib.h"#include "tyLib.h"#include "tickLib.h"#include "memPartLib.h"#if NPPP > 0#ifdef VJC#define HDROFF  MAX_HDR/* HDROFF should really be 128, but other parts of the system will   panic on TCP+IP headers bigger than MAX_HDR = MHLEN (100). */#else#define HDROFF  (0)#endif#define PPP_HIWAT       400     /* Don't start a new packet if HIWAT on que *//* external variables */IMPORT void if_dettach();IMPORT void if_down();/* global variables */struct ppp_softc *ppp_softc[NPPP] = { 0 } ;int ppp_wrt_task_priority    	= 60;int ppp_wrt_task_options     	= VX_SUPERVISOR_MODE | VX_UNBREAKABLE;int ppp_wrt_task_stack_size   	= 0x4000;char *ppp_device_name		= "ppp";#if	(CPU_FAMILY==SIMSPARCSOLARIS)int simPppRBufSize = 48 * PPP_MTU;	/* size of PPP read ring buffer */#endifstatic int pppioctl __ARGS((struct ifnet *, int , caddr_t));static int pppattach __ARGS((int));static int pppoutput __ARGS((struct ifnet *, struct mbuf *, struct sockaddr *,			     struct rtentry *));static void pppinput __ARGS((struct ppp_softc *, int));static int pppasyncstart __ARGS((struct ppp_softc *));static u_short pppfcs __ARGS((int, u_char *, int));static int pppgetm __ARGS((struct ppp_softc *sc));static void pppdumpm __ARGS((struct mbuf *, int));static void pppdumpb __ARGS((u_char *, int));static void ppplogchar __ARGS((struct ppp_softc *, int));static void pppdealloc __ARGS((struct ppp_softc *));static struct ppp_softc *pppalloc __ARGS((int, char *));static void ppp_wrt_flush __ARGS((struct ppp_softc *));static void pinit __ARGS((int));static int pppintr __ARGS((int, int));static void ppp_tty_read __ARGS((int, struct ppp_softc *, int));/* * Some useful mbuf macros not in mbuf.h. */#define M_DATASTART(m)	(m)->m_extBuf#define M_DATASIZE(m)	(m)->m_extSize#define PPPBUFSIZE        (PPP_MTU * 2)/* * The following disgusting hack gets around the problem that IP TOS * can't be set yet.  We want to put "interactive" traffic on a high * priority queue.  To decide if traffic is interactive, we check that * a) it is TCP and b) one of its ports is telnet, rlogin or ftp control. */static u_short interactive_ports[8] = {        0,      513,    0,      0,        0,      21,     0,      23,};#define INTERACTIVE(p) (interactive_ports[(p) & 7] == (p))/* * Does c need to be escaped? */#define ESCAPE_P(c)     (sc->sc_asyncmap[(c) >> 5] & (1 << ((c) & 0x1F)))/* * Called to establish ppp interfaces. */static intpppattach(unit)    int unit;{    register struct ppp_softc *sc;    int status;    sc = ppp_softc[unit];#ifdef VIRTUAL_STACK    virtualStackIdCheck();  /* make sure the myStackNum exists */    sc->sc_if.vsNum = myStackNum;#endif /* VIRTUAL_STACK */    sc->sc_if.if_name = "ppp";    sc->sc_if.if_unit = unit;    sc->sc_if.if_mtu = PPP_MTU;    sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST ;    sc->sc_if.if_type = IFT_PPP;    sc->sc_if.if_hdrlen = PPP_HDRLEN;    sc->sc_if.if_ioctl = pppioctl;    sc->sc_if.if_output = pppoutput;    sc->sc_if.if_snd.ifq_maxlen = IFQ_MAXLEN;    sc->sc_inq.ifq_maxlen = IFQ_MAXLEN;    sc->sc_fastq.ifq_maxlen = IFQ_MAXLEN;    sc->sc_if.if_reset = pppclose;    sc->sc_if.if_init = (FUNCPTR) pinit;    status = if_attach(&sc->sc_if);    return (status);}/* * Allocate a ppp interface unit and initialize it. */static struct ppp_softc *pppalloc(unit, device)    int unit;    char *device;{    struct ppp_softc *sc;    if (ppp_softc[unit] != NULL)        return NULL;    if ((sc = (struct ppp_softc *) KHEAP_ALLOC(sizeof(struct ppp_softc))) == NULL)        return (NULL);    bzero ((char *)sc, sizeof (struct ppp_softc));    ppp_softc[unit] = sc;    if ((sc->sc_fd = open(device, O_RDWR, 0)) == ERROR)        {        ppp_softc[unit] = (struct ppp_softc *)NULL;        KHEAP_FREE((char *)sc);        return NULL;	}#if	(CPU_FAMILY==SIMSPARCSOLARIS)    /*     * For PPP on solaris simulator, the receive buffer size must be more     * important. This is necessary because the solaris host can send several      * several PPP packets to the simulator before he is able to     * handle them (don't forget that they share the same CPU).     * If the receive buffer size is too small to store all the received     * characters, some of them may be lost. The new value has been chosen     * after some testing (with this value, the simulator has time to     * handle packets before the receive buffer is full) but may not be     * sufficient in all cases, if not sufficient simPppRBufSize can be     * increased in sysLib.c.     */    if (ioctl(sc->sc_fd, FIORBUFSET, simPppRBufSize) == ERROR ||#else	/* CPU_FAMILY==SIMSPARCSOLARIS */    if (ioctl(sc->sc_fd, FIORBUFSET, 4 * PPP_MTU) == ERROR ||#endif        ioctl(sc->sc_fd, FIOWBUFSET, 4 * PPP_MTU) == ERROR) {        close(sc->sc_fd);        ppp_softc[unit] = (struct ppp_softc *)NULL;        KHEAP_FREE((char *)sc);        return NULL;    }    if (pppattach(unit) == ERROR) {         close(sc->sc_fd);        ppp_softc[unit] = (struct ppp_softc *)NULL;        KHEAP_FREE((char *) sc);        return (NULL);    }    if (ioctl(sc->sc_fd, FIOPROTOHOOK, (int)pppintr) == ERROR ||        ioctl(sc->sc_fd, FIOPROTOARG, unit) == ERROR) {        close(sc->sc_fd);        pppdealloc(sc);        return (NULL);    }    sc->sc_flags = 0;    sc->sc_mru = PPP_MRU;#ifdef VJC    sl_compress_init(&sc->sc_comp);#endif    sc->sc_if.if_flags |=  IFF_RUNNING;    return sc;}/* * Deallocate a ppp unit. */static voidpppdealloc(sc)    struct ppp_softc *sc;{    struct mbuf *m;    if_down(&sc->sc_if);    sc->sc_devp = NULL;    sc->sc_xfer = 0;    for (;;) {        IF_DEQUEUE(&sc->sc_inq, m);        if (m == NULL)            break;        m_freem(m);    }    for (;;) {        IF_DEQUEUE(&sc->sc_fastq, m);        if (m == NULL)            break;        m_freem(m);    }    sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING);    if_dettach(&sc->sc_if);    ppp_softc[sc->sc_if.if_unit] = (struct ppp_softc *)NULL;    semDelete (sc->sc_wrtsem);    KHEAP_FREE((char *)sc);}/* * pppopen - open the ppp interface. * 	     Returns unit id. */intpppopen(unit, device)    int unit;    char *device;{    register struct ppp_softc *sc;    char ppp_wrt_name[10];    if ((sc = pppalloc(unit, device)) == NULL)        return (ERROR);    if (sc->sc_outm != NULL) {        m_freem(sc->sc_outm);        sc->sc_outm = NULL;    }    if (pppgetm(sc) == 0) {        sc->sc_if.if_flags &= ~(IFF_UP|IFF_RUNNING);        return (ERROR);    }    sc->sc_ilen  = 0;    bzero((char *)sc->sc_asyncmap, sizeof(sc->sc_asyncmap));    sc->sc_asyncmap[0] = 0xffffffff;    sc->sc_asyncmap[3] = 0x60000000;    sc->sc_rasyncmap = 0;    sc->sc_devp = (void *) NULL;    sc->sc_start = pppasyncstart;    sc->sc_qlen  = 0;    sc->sc_tid = taskIdSelf();    sc->sc_wrtsem = semBCreate (SEM_Q_PRIORITY, SEM_EMPTY);    ioctl(sc->sc_fd, FIOFLUSH, 0);    sprintf(ppp_wrt_name, "tPPP%dWrt", sc->sc_if.if_unit);    sc->sc_wrt_task_id = taskSpawn (ppp_wrt_name, ppp_wrt_task_priority,				    ppp_wrt_task_options, ppp_wrt_task_stack_size,				    (FUNCPTR)ppp_wrt_task, (int)sc,				    0, 0, 0, 0, 0, 0, 0, 0, 0);    if (sc->sc_wrt_task_id == ERROR) {        close(sc->sc_fd);        pppdealloc(sc);        return (ERROR);    }    return (OK);}    /* * Line specific close routine. * Detach the tty from the ppp unit. * Mimics part of ttyclose(). */intpppclose(unit)    int unit;{    register struct ppp_softc *sc;    int s;    if (unit >= 0 && unit < NPPP)        sc = ppp_softc[unit];    else        return (ERROR);    if (sc != NULL) {	ppp_wrt_flush(sc);        ioctl(sc->sc_fd, FIOPROTOHOOK, (int) NULL);        taskDelete(sc->sc_wrt_task_id);        s = splimp();		/* paranoid; splnet probably ok */        close(sc->sc_fd);        m_freem(sc->sc_outm);        sc->sc_outm = NULL;        m_freem(sc->sc_m);        sc->sc_m = NULL;        pppdealloc(sc);        splx(s);    }    else        return (ERROR);    return(OK);}/* * Line specific (tty) read routine. */intpppread(unit, buf, count)    int unit;    char *buf;    int count;{    register struct ppp_softc *sc = ppp_softc[unit];    struct mbuf *m;    register int s;    s = splimp();    IF_DEQUEUE(&sc->sc_inq, m);    splx(s);    if (m == NULL)	return 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品久久99久久久久| 国产一区二区三区视频在线播放| av在线播放成人| 国产精品福利一区二区三区| 成人精品视频网站| 亚洲男人电影天堂| 欧美日韩国产片| 久久国产日韩欧美精品| 久久影院视频免费| 成人黄色小视频在线观看| 综合激情成人伊人| 欧美日产国产精品| 国产伦精品一区二区三区视频青涩 | 26uuu精品一区二区在线观看| 国内精品写真在线观看| 日韩毛片一二三区| 91 com成人网| 国产激情精品久久久第一区二区 | 国产一区视频导航| 国产精品免费久久久久| 欧美日韩精品一区二区三区蜜桃| 欧美aⅴ一区二区三区视频| 国产喷白浆一区二区三区| 色婷婷av一区二区三区大白胸| 亚洲成人av电影在线| 久久影视一区二区| 91九色02白丝porn| 狠狠狠色丁香婷婷综合激情 | 欧美午夜电影一区| 国产麻豆一精品一av一免费| 亚洲精品v日韩精品| 欧美电影免费提供在线观看| 波多野结衣在线一区| 天天色图综合网| 欧美国产精品专区| 欧美日韩高清在线播放| 国产99精品国产| 亚洲chinese男男1069| 国产精品热久久久久夜色精品三区| 欧美做爰猛烈大尺度电影无法无天| 国产在线一区观看| 亚洲成av人片在www色猫咪| 中文字幕乱码亚洲精品一区| 欧美日韩日日摸| aaa欧美色吧激情视频| 久久精品国产精品亚洲精品| 亚洲免费视频成人| 亚洲精品一区二区三区蜜桃下载| 色噜噜狠狠色综合中国| 国产精品一区二区三区四区| 亚洲电影在线免费观看| 综合av第一页| 欧美国产精品一区二区三区| 日韩欧美中文字幕公布| 欧美性大战久久久| 91在线丨porny丨国产| 国产精品一二三四| 日韩在线一区二区三区| 亚洲影视在线观看| 国产精品国产三级国产有无不卡| 精品国产免费人成电影在线观看四季| 日本久久电影网| a4yy欧美一区二区三区| 国产成人精品三级| 国产福利一区在线| 国产一区二区电影| 国产真实乱偷精品视频免| 免费av网站大全久久| 日韩国产欧美在线视频| 视频一区二区三区入口| 天天综合天天做天天综合| 亚洲综合自拍偷拍| 一区二区三区加勒比av| 亚洲精品亚洲人成人网 | 亚洲蜜臀av乱码久久精品| 日本一区二区在线不卡| 中文字幕乱码一区二区免费| 国产亚洲欧美激情| 欧美激情一区在线| 国产精品美女久久久久高潮| 国产精品成人免费在线| 中文字幕在线一区| 成人欧美一区二区三区| 亚洲三级在线看| 亚洲精品中文在线影院| 亚洲国产aⅴ成人精品无吗| 亚洲成av人片在线观看无码| 日韩成人一区二区| 久久精品国内一区二区三区| 久久99精品国产麻豆婷婷| 激情综合色丁香一区二区| 国产精品一区一区| 91香蕉视频污| 欧美日韩高清一区二区不卡| 日韩一区二区三区在线观看| 久久女同互慰一区二区三区| 国产精品视频在线看| 亚洲日本中文字幕区| 午夜精品久久一牛影视| 免费一级欧美片在线观看| 精品一区二区三区免费播放| 成人午夜av在线| 91日韩精品一区| 欧美日韩夫妻久久| 久久久www成人免费毛片麻豆| 中文字幕在线一区二区三区| 夜夜亚洲天天久久| 免费成人av在线播放| 成人a区在线观看| 欧美性感一区二区三区| 久久―日本道色综合久久| 成人欧美一区二区三区1314| 免费在线观看不卡| 91丨九色丨国产丨porny| 在线观看视频一区| 久久影音资源网| 一区二区三区四区国产精品| 久久99精品久久只有精品| 99久久婷婷国产综合精品电影| 欧美精品乱人伦久久久久久| 国产亚洲自拍一区| 偷拍亚洲欧洲综合| 成a人片亚洲日本久久| 日韩三级在线观看| 亚洲精品免费看| 国产中文字幕一区| 欧美日韩在线一区二区| 国产欧美一区二区三区在线看蜜臀 | 亚洲国产成人在线| 日韩黄色免费电影| 一本到一区二区三区| 欧美精品一区二区三区久久久| 亚洲一区二区三区四区五区黄 | 国产激情一区二区三区| 3d动漫精品啪啪一区二区竹菊| 亚洲三级在线免费| 福利电影一区二区| 日韩视频一区二区三区在线播放 | 精品美女在线播放| 亚洲一区自拍偷拍| 成人久久久精品乱码一区二区三区| 欧美福利电影网| 亚洲国产三级在线| 99视频一区二区三区| 国产色爱av资源综合区| 麻豆精品国产传媒mv男同| 在线观看亚洲a| 亚洲色图欧洲色图婷婷| 成人妖精视频yjsp地址| 久久九九99视频| 精品无人码麻豆乱码1区2区 | 亚洲综合成人在线视频| 成人看片黄a免费看在线| 久久久91精品国产一区二区三区| 久久激情五月激情| 日韩精品在线网站| 捆绑紧缚一区二区三区视频| 制服视频三区第一页精品| 日韩影院精彩在线| 欧美高清视频不卡网| 午夜成人免费电影| 欧美视频在线观看一区二区| 亚洲无线码一区二区三区| 精品视频免费看| 日韩经典中文字幕一区| 欧美精选午夜久久久乱码6080| 日韩综合一区二区| 日韩一级成人av| 国精产品一区一区三区mba桃花| 久久一区二区三区国产精品| 国产精品一区二区久激情瑜伽 | 久久av中文字幕片| 久久色在线观看| 国产98色在线|日韩| 国产精品久久久久影视| 不卡的av网站| 怡红院av一区二区三区| 欧美在线三级电影| 日本伊人午夜精品| 2017欧美狠狠色| 99在线精品免费| 亚洲一区二区三区激情| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲女同一区二区| 在线免费观看成人短视频| 亚洲超碰精品一区二区| 欧美一区二区免费| 极品少妇一区二区三区精品视频| 久久久国际精品| 91玉足脚交白嫩脚丫在线播放| 亚洲第一会所有码转帖| 日韩三级在线观看| 懂色中文一区二区在线播放| 亚洲自拍偷拍九九九| 日韩亚洲电影在线| 成人av中文字幕| 亚洲va欧美va天堂v国产综合| 欧美mv日韩mv国产网站| 成人精品国产福利| 亚洲成人午夜影院|