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

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

?? if_ppp.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* if_ppp.c - Point-to-Point Protocol (PPP) Asynchronous driver *//* Copyright 1996 - 2002 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--------------------01y,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"#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];    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 *)calloc(1, sizeof(struct ppp_softc))) == NULL)        return (NULL);    ppp_softc[unit] = sc;    if ((sc->sc_fd = open(device, O_RDWR, 0)) == ERROR)        {        ppp_softc[unit] = (struct ppp_softc *)NULL;        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;        free((char *) sc);        return NULL;    }    if (pppattach(unit) == ERROR) {         close(sc->sc_fd);        ppp_softc[unit] = (struct ppp_softc *)NULL;        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;    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();    semBInit(&sc->sc_wrtsem, 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;    copy_from_mbufs(buf, m, count);    return (count);}/* * Line specific (tty) write routine. */intpppwrite(unit, buf, count)    int unit;    char *buf;    int count;{    register struct ppp_softc *sc = ppp_softc[unit];    struct mbuf *m, *m0, **mp;    struct sockaddr dst;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩不卡免费| 欧美一区二区三区在线视频| 中文av一区二区| 91蝌蚪porny| 美女诱惑一区二区| 一区二区三区在线看| 日韩一卡二卡三卡四卡| 成人免费视频caoporn| 亚洲午夜精品17c| 中文字幕一区二区三区乱码在线 | www.在线成人| 秋霞电影一区二区| 日韩高清在线不卡| 亚洲一区二区三区中文字幕| 一本色道亚洲精品aⅴ| 国产麻豆日韩欧美久久| 天使萌一区二区三区免费观看| 国产精品美女久久久久高潮| 日韩视频中午一区| 欧美精品 国产精品| 色综合天天综合网天天狠天天| 国产.欧美.日韩| 国产精品自拍av| 九色|91porny| 激情成人综合网| 日韩成人av影视| 天涯成人国产亚洲精品一区av| 亚洲美女区一区| 国产片一区二区三区| 欧美大片顶级少妇| 日韩免费高清电影| 日韩免费在线观看| 欧美精品一区二区在线播放| 日韩一区二区视频在线观看| 欧美精品在线观看播放| 日韩欧美国产三级电影视频| 91精品国产综合久久国产大片| 欧美精品色综合| 欧美精品一区二| 中文字幕亚洲欧美在线不卡| 日韩一区欧美小说| 亚洲午夜av在线| 天天射综合影视| 免费视频最近日韩| 国产一区二区三区国产| 成人h版在线观看| 欧美午夜精品一区| 日韩欧美国产三级电影视频| 欧美国产日韩一二三区| 亚洲视频资源在线| 蜜臀av性久久久久蜜臀aⅴ四虎 | 亚洲一区免费观看| 久久 天天综合| 在线亚洲欧美专区二区| 日韩欧美国产一区二区三区| 亚洲精品国产一区二区精华液 | 亚洲成人7777| 国产精品一区三区| 欧美精三区欧美精三区| 国产欧美一区二区精品久导航| 亚洲欧美日韩国产一区二区三区| 青青草视频一区| 在线观看精品一区| 国产精品视频一区二区三区不卡| 日韩国产高清影视| 91久久香蕉国产日韩欧美9色| 国产午夜久久久久| 国产精品一级在线| 精品久久久久久亚洲综合网 | 久久婷婷一区二区三区| 日韩黄色片在线观看| 91视频免费看| 国产精品国产三级国产三级人妇| 精一区二区三区| 日韩一区二区在线免费观看| 一区二区三区欧美亚洲| 99久久免费视频.com| 久久精子c满五个校花| 精品亚洲免费视频| 欧美一级高清片| 捆绑变态av一区二区三区 | 欧美色图免费看| 亚洲日本在线观看| 成人av网站在线| 中文字幕一区三区| 一道本成人在线| 亚洲精品成人精品456| 欧美影视一区二区三区| 亚洲va韩国va欧美va| 日韩无一区二区| 国产精华液一区二区三区| 国产亚洲精品久| 色噜噜久久综合| 日韩国产欧美三级| www国产成人| 99九九99九九九视频精品| 亚洲狠狠丁香婷婷综合久久久| 制服丝袜亚洲色图| 亚洲综合色网站| 欧美丰满美乳xxx高潮www| 激情综合色综合久久综合| 国产精品网站导航| 欧美电影在哪看比较好| 国产精品99久久久久久久vr | 国产成人精品一区二区三区四区| 中文字幕在线不卡一区二区三区| 欧美午夜精品免费| 国产成人aaa| 日本va欧美va瓶| 日韩伦理av电影| 精品国产91洋老外米糕| 色网站国产精品| 成人性色生活片| 玉米视频成人免费看| 久久久久国产精品免费免费搜索| 在线观看一区日韩| caoporen国产精品视频| 精品在线播放午夜| 日本伊人精品一区二区三区观看方式 | 一本大道av伊人久久综合| 久久99国产精品免费网站| 亚洲地区一二三色| 亚洲免费av高清| 亚洲欧美日韩久久| 国产精品乱码久久久久久| 久久综合国产精品| 91精品国产手机| 911精品产国品一二三产区| 国产成a人无v码亚洲福利| 色综合久久天天| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美乱熟臀69xxxxxx| 在线观看不卡一区| 欧美日韩电影在线| 欧美男同性恋视频网站| 91 com成人网| 久久美女高清视频| 久久精品一区二区三区不卡牛牛| 久久久久久久综合| 日本一区二区三区四区在线视频| 欧美精品色一区二区三区| 制服丝袜亚洲色图| 久久久久国产精品麻豆ai换脸 | 老司机免费视频一区二区| 韩国成人福利片在线播放| 69精品人人人人| 亚洲精品一线二线三线| 久久久久久久电影| 亚洲欧洲另类国产综合| 亚洲午夜久久久久久久久久久| 美日韩黄色大片| av影院午夜一区| 欧美一区二区三区视频免费播放| 精品美女被调教视频大全网站| 精品区一区二区| 亚洲精品一二三区| 日本不卡123| 91麻豆成人久久精品二区三区| 日韩亚洲欧美高清| 亚洲精品一卡二卡| 国产不卡在线一区| 91精品国产欧美一区二区| 国产精品不卡在线观看| 日本欧美久久久久免费播放网| 粉嫩13p一区二区三区| 欧美日韩的一区二区| 亚洲欧洲韩国日本视频| 激情综合网最新| 欧美一区二区网站| 婷婷久久综合九色综合伊人色| 成人美女在线观看| 国产午夜精品一区二区三区视频 | 国产剧情一区在线| 欧美丰满美乳xxx高潮www| 亚洲一区二三区| 成人av第一页| 欧美国产一区二区| 国产黑丝在线一区二区三区| 日韩一区二区在线看| 麻豆精品在线视频| 日韩一区二区精品在线观看| 三级久久三级久久| 欧美一区二区视频在线观看2020| 亚洲成av人片在线| 91精品国产品国语在线不卡| 日韩av不卡一区二区| 日韩精品一区二区三区老鸭窝| 青青草91视频| 久久久久久久久伊人| 成人激情小说网站| 国产精品嫩草99a| 99re这里都是精品| 亚洲图片有声小说| 日韩欧美国产精品| 国产成人午夜高潮毛片| 国产精品青草综合久久久久99| 色综合色狠狠天天综合色| 洋洋成人永久网站入口| 91精品国产欧美一区二区成人| 韩国成人精品a∨在线观看|