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

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

?? pppbitsyncframing.c

?? 這是全套的PPP協(xié)議的源碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* pppBitSyncFraming.c - PPP Bit-Synchronous HDLC Framing *//* Copyright 1999 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01q,28may02,rvr fixed build warnings (teamf1)01p,17dec01,mk  added macros to correct alignment problems01o,12apr01,ijm First mbuf in the chain must have mBlkPktHdr info set.                 Corrected convertNormalDataToSynchronousData to handle                zero-length mbufs within an mbuf chain01n,29sep00,sj  Merging in and reorganizing RFC2233 instrumentation01m,29sep00,sj  merging with TOR2_0-WINDNET_PPP-CUM_PATCH_201l,02aug00,adb  Merging in LAC modifications01k,01aug00,adb  Merging with openstack view except RFC 223301j,31jul00,md  initializes collectPppAttributesEvent01i,29jun00,md  subscribed COLLECT_PPP_ATTRIBUTES_EVENT01h,17apr00,sj  use length of frame as size for decoded frame buffer01g,07mar00,sj  use/generate mBuf chains on receive path01f,02mar00,sj  On the send path no ACCompression for LCP packets and get                 clusters on demand01e,23feb00,sj  Pedantic ANSI fixes01d,14feb00,sj  fixed 32 bit checksum on send path and added comments01c,02dec99,sj  All new implementation of encoding and decoding01b,29nov99,sgv Added comments01a,06oct99,sgv Written*//*DESCRIPTIONThis component implements PPP Bit Synchronous HDLC framing as specified in RFC 1662. It resides in the framing layer of the framing plane.*//* includes */#include "vxWorks.h"#include "stdio.h"#include "logLib.h"#include "stdlib.h"#include "string.h"#include "ctype.h"#include "memLib.h"#include "inetLib.h"#include "hostLib.h"#include "netBufLib.h"#include "ioLib.h"#include "pfw/pfw.h"#include "pfw/pfwStack.h"#include "pfw/pfwComponent.h"#include "pfw/pfwTimer.h"#include "pfw/pfwLayer.h"#include "pfw/pfwEvent.h"#include "pfw/pfwInterface.h"#include "pfw/pfwMemory.h"#include "ppp/kstart.h"#include "ppp/kppp.h"#include "ppp/pppLacStructures.h"#include "ppp/pppChecksum.h"#include "private/ppp/vpppstr.h"#include "ppp/interfaces/lcpInterfaces.h"#include "ppp/interfaces/pppInterfacesGroupInterfaces.h"/* defines */#define PPP_ALLSTATIONS 0xFF#define PPP_UI          0x03    /* Unnumbered Information */#define PPP_UI          		0x03    /* Unnumbered Information *//* typedefs */typedef struct bsyncFramingStackData    {    unsigned long localToPeerACCompression;    unsigned long peerToLocalACCompression;    unsigned long localToPeerProtocolCompression;    unsigned long peerToLocalProtocolCompression;    unsigned  int localMru;    unsigned  int remoteMru;    unsigned  int transmitFcsSize;    unsigned  int receiveFcsSize;    NET_POOL_ID   netPoolId;    u_int bytesSent;    u_int bytesRcvd;    u_int inputBytes;    u_int inputErrors;    u_int mru;    u_int flags;    PFW_PLUGIN_OBJ_CALLBACKS    * callbacks;    PFW_EVENT_OBJ * lcpUpEvent;    PFW_INTERFACE_STATE_PAIR pppLinkStatusInterface;    PFW_INTERFACE_STATE_PAIR pppLinkCounterInterface;    PFW_EVENT_OBJ *collectPppAttributesEvent;    /* auxiliary variables aiding RFC 2233 counters's implementation */    int   pfwAuxIfId;    PFW_INTERFACE_STATE_PAIR pfwRFC2233CountPair;    BOOL  pfwRFC2233CountTest;    } BSYNC_FRAMING_STACK_DATA;typedef struct _PPP_HEADER    {    BYTE                             hdlc_address;    BYTE_ENUM (LLC_FRAME_TYPE)       hdlc_control;    USHORT_ENUM (PPP_PROTOCOL_TYPE)  protocol_type;    } _WRS_PACK_ALIGN(1)  _PPP_HEADER;typedef struct _PPP_PACKET    {    _PPP_HEADER                   header;    BYTE_ENUM (PPP_CONTROL_CODE)  code;    BYTE                          id;    USHORT                        length;    BYTE                          data[VARIABLE_NUMBER_OF_BYTES];    } _WRS_PACK_ALIGN(1)  _PPP_PACKET;/* LOCAL */LOCAL STATUS pppBitSyncSend (PFW_PLUGIN_OBJ_STATE *, M_BLK_ID *);LOCAL STATUS pppBitSyncReceive (PFW_PLUGIN_OBJ_STATE *, M_BLK_ID *);LOCAL STATUS pppBitSyncStackAdd (PFW_PLUGIN_OBJ_STATE *state,					PFW_PLUGIN_OBJ_CALLBACKS * callbacks);LOCAL STATUS pppBitSyncStackDelete (PFW_PLUGIN_OBJ_STATE *);LOCAL STATUS pppBitSyncStackDataConstruct ( PFW_OBJ *, void * stackData,							 void * profileData);LOCAL STATUS convertNormalDataToSynchronousData (PFW_PLUGIN_OBJ_STATE *,						    M_BLK_ID src, M_BLK_ID dst);LOCAL int convertSynchronousDataToNormalData (PFW_PLUGIN_OBJ_STATE *,						    M_BLK_ID src, M_BLK_ID dst);LOCAL STATUS lcpUpEventHandler (PFW_PLUGIN_OBJ_STATE *, void *eventData);LOCAL STATUS decompress_ppp_header ( PFW_PLUGIN_OBJ_STATE *state, M_BLK_ID);LOCAL STATUS BitSyncFrameEventHandler    (    PFW_PLUGIN_OBJ_STATE * state,    void *eventData    );/******************************************************************************** pppBitSyncFramingComponentCreate - create bit synchronous component** This routine creates the bit synchronous HDLC framing component plug-in* object and adds it to the framework.** RETURNS: OK or ERROR*/STATUS pppBitSyncFramingComponentCreate    (    PFW_OBJ *pfw    )    {    PFW_COMPONENT_OBJ *pBsyncFramingComponent;    pBsyncFramingComponent = (PFW_COMPONENT_OBJ *) pfwMalloc (pfw,                                                sizeof (PFW_COMPONENT_OBJ));    if (pBsyncFramingComponent == NULL)        {        printf ("pppBsyncFramingInit - Unable to allocate memory of size %d \		 byte s\n", (int) sizeof (PFW_COMPONENT_OBJ));        return (ERROR);        }    bzero ((void *)pBsyncFramingComponent, sizeof(PFW_COMPONENT_OBJ));    strcpy (pBsyncFramingComponent->pluginObj.name, "BITSYNC_FRAMING");    pBsyncFramingComponent->pluginObj.pfwObj = pfw;    pBsyncFramingComponent->layerObj = pfwLayerObjGet (pfw, "FRAMING_LAYER");    pBsyncFramingComponent->pluginObj.profileDataSize = 0;    pBsyncFramingComponent->pluginObj.stackDataSize 				= sizeof (BSYNC_FRAMING_STACK_DATA);    pBsyncFramingComponent->protocol = 0;    pBsyncFramingComponent->pluginObj.profileDataConstruct = NULL;    pBsyncFramingComponent->pluginObj.profileDataCopy = NULL;    pBsyncFramingComponent->pluginObj.profileDataDestruct = NULL;    pBsyncFramingComponent->pluginObj.receive = pppBitSyncReceive;    pBsyncFramingComponent->pluginObj.send = pppBitSyncSend;    pBsyncFramingComponent->pluginObj.stackAdd = pppBitSyncStackAdd;    pBsyncFramingComponent->pluginObj.stackDelete = pppBitSyncStackDelete;    pBsyncFramingComponent->pluginObj.stackDataConstruct = pppBitSyncStackDataConstruct;    pBsyncFramingComponent->pluginObj.stackDataDestruct = NULL;    pBsyncFramingComponent->pluginObj.stackDataShow = NULL;    if (pfwComponentAdd (pBsyncFramingComponent) == ERROR)        {        printf (	"pppBitSyncFramingComponentCreate - BitSync Framing could not be added to the framework\n");        return (ERROR);        }    return (OK);    }/********************************************************************************* pppBitSyncFramingComponentDelete - delete the bit synchronous component ** The bit synchronous framing plug-in component object allocated by * pppBitSyncFramingComponentCreate() is freed if there are no references * to this object from a stack or profile object in the framework.** RETURNS: OK or ERROR*/STATUS pppBitSyncFramingComponentDelete    (    PFW_OBJ *pfw    )    {    PFW_COMPONENT_OBJ *pComponent;    pComponent = pfwComponentObjGetByName (pfw, "BITSYNC_FRAMING");    if (pComponent == NULL)        return ERROR;    if (pfwComponentDelete (pComponent) == OK)        {        pfwFree (pComponent);        return OK;        }    return (ERROR);    }/******************************************************************************** pppBitSyncStackDataConstruct -*/LOCAL STATUS pppBitSyncStackDataConstruct    (    PFW_OBJ * pfw,    void * stackData,    void * profileData    )    {    BSYNC_FRAMING_STACK_DATA *pStackData =                                (BSYNC_FRAMING_STACK_DATA *)stackData;    if ((pStackData->netPoolId = pfwNetPoolIdGet(pfw)) == NULL)	{	printf("BitSync Framing:MUST have a valid NetPoolId;See pfwCreate()\n");	return ERROR;	}    pStackData->collectPppAttributesEvent = NULL;    pStackData->localMru = 1500;    pStackData->remoteMru = 1500;    pStackData->flags = 0;    pStackData->inputBytes = 0;    /* default to 16 bit FCS */    pStackData->transmitFcsSize = PPP_16BIT_FCS;    pStackData->receiveFcsSize = PPP_16BIT_FCS;    /* Address control and protocol compression is disabled by default */    pStackData->localToPeerACCompression = FALSE;    pStackData->peerToLocalACCompression = FALSE;    pStackData->localToPeerProtocolCompression = FALSE;    pStackData->peerToLocalProtocolCompression = FALSE;    return (OK);    }/******************************************************************************** pppBitSyncStackAdd -*/LOCAL STATUS pppBitSyncStackAdd    (    PFW_PLUGIN_OBJ_STATE *state,    PFW_PLUGIN_OBJ_CALLBACKS * callbacks    )    {    BSYNC_FRAMING_STACK_DATA *stackData = state->stackData;    int id;    stackData->callbacks = callbacks;    if (stackData->collectPppAttributesEvent == NULL)	{	if ((stackData->collectPppAttributesEvent =	    pfwEventObjGet(state->pluginObj->pfwObj,"COLLECT_PPP_ATTRIBUTES_EVENT")) != NULL)	    {	    pfwEventStackSubscribe(state,stackData->collectPppAttributesEvent, BitSyncFrameEventHandler);	    }        }    /* get LCP UP event object and subcribe to it*/    if ((stackData->lcpUpEvent =            pfwEventObjGet(state->pluginObj->pfwObj,"LCP_UP_EVENT")) != NULL)        {        pfwEventStackSubscribe(state,stackData->lcpUpEvent, lcpUpEventHandler);        }    else        return ERROR;    /* get LCP interfaces */    if ((id = pfwInterfaceIdGet(state->pluginObj->pfwObj,                        "PPP_LINK_STATUS_ENTRY_INTERFACE")) > 0)        {        if (pfwInterfaceObjAndStateGetViaStackObj(state->stackObj,                                id, &stackData->pppLinkStatusInterface) != OK)            return ERROR;        }    else        return ERROR;    if ((id = pfwInterfaceIdGet(state->pluginObj->pfwObj,                        "PPP_LINK_STATUS_COUNTER_INCREMENT_INTERFACE")) > 0)        {        if (pfwInterfaceObjAndStateGetViaStackObj(state->stackObj,                                id, &stackData->pppLinkCounterInterface) != OK)            return ERROR;        }     /* Get pfwRFC2233CountPair and set pfwRFC2233CountTest */    RFC2233_COUNT_PAIR_GET(state,                            stackData->pfwAuxIfId,                            stackData->pfwRFC2233CountPair, 			   stackData->pfwRFC2233CountTest);    /* stackAdd done */    if (stackData->callbacks && stackData->callbacks->stackAddComplete)        {        (*stackData->callbacks->stackAddComplete) (stackData->callbacks, state);        return OK;        }    else        return ERROR;    }/******************************************************************************** pppBitSyncStackDelete -*/LOCAL STATUS pppBitSyncStackDelete    (    PFW_PLUGIN_OBJ_STATE *state    )    {    BSYNC_FRAMING_STACK_DATA *stackData = state->stackData;    /* Delete the LCP LinkStatus Interface reference */    pfwInterfaceReferenceDelete (                stackData->pppLinkStatusInterface.interfaceObj);    /* Delete the LCP LinkCounter Interface reference */    pfwInterfaceReferenceDelete (                stackData->pppLinkCounterInterface.interfaceObj);    if (stackData->pfwRFC2233CountTest)       pfwInterfaceReferenceDelete(stackData->pfwRFC2233CountPair.interfaceObj);    if (stackData->callbacks && stackData->callbacks->stackDeleteComplete)        {        (*stackData->callbacks->stackDeleteComplete)                                    (stackData->callbacks , state);        return OK;        }    else        return ERROR;    }/******************************************************************************** lcpUpEventHandler -*/LOCAL STATUS lcpUpEventHandler    (    PFW_PLUGIN_OBJ_STATE * state,    void *eventData    )    {    PFW_PLUGIN_OBJ_STATE * lcpState = (PFW_PLUGIN_OBJ_STATE * )eventData;    BSYNC_FRAMING_STACK_DATA *stackData = state->stackData;    PPP_LINK_STATUS_ENTRY_INTERFACE * linkStatus =                    (PPP_LINK_STATUS_ENTRY_INTERFACE *)                                stackData->pppLinkStatusInterface.interfaceObj;    stackData->localMru = (*linkStatus->pppLinkStatusLocalMRUGet)(lcpState);    stackData->remoteMru = (*linkStatus->pppLinkStatusRemoteMRUGet)(lcpState);    stackData->localToPeerProtocolCompression =      (*linkStatus->pppLinkStatusLocalToRemoteProtocolCompressionGet)(lcpState);    stackData->peerToLocalProtocolCompression =      (*linkStatus->pppLinkStatusRemoteToLocalProtocolCompressionGet)(lcpState);    stackData->localToPeerACCompression =           (*linkStatus->pppLinkStatusLocalToRemoteACCompressionGet) (lcpState);    stackData->peerToLocalACCompression =            (*linkStatus->pppLinkStatusRemoteToLocalACCompressionGet)(lcpState);    stackData->transmitFcsSize =                (*linkStatus->pppLinkStatusTransmitFcsSizeGet)(lcpState);    stackData->receiveFcsSize =                (*linkStatus->pppLinkStatusReceiveFcsSizeGet) (lcpState);    return OK;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产禁国产网站cc| 日韩精品中文字幕一区二区三区 | 9191久久久久久久久久久| 精品一区二区三区在线视频| 亚洲视频一二三区| 精品国产欧美一区二区| 色呦呦日韩精品| 国产真实乱对白精彩久久| 1000精品久久久久久久久| 欧美一区二区啪啪| 色综合久久中文综合久久97| 精品午夜一区二区三区在线观看| 洋洋av久久久久久久一区| 国产欧美综合在线观看第十页| 欧美另类z0zxhd电影| 99久久夜色精品国产网站| 激情图片小说一区| 日韩电影免费在线看| 亚洲综合一区二区精品导航| 日本一区二区三区久久久久久久久不| 欧美一区二区美女| 在线看日韩精品电影| 波多野洁衣一区| 国产精品99久久久久久有的能看| 午夜激情综合网| 亚洲日本在线天堂| 日韩一区日韩二区| 国产精品拍天天在线| 久久婷婷综合激情| 欧美成人精品3d动漫h| 91麻豆精品国产91久久久久| 在线亚洲一区观看| 99九九99九九九视频精品| 风间由美一区二区av101| 久久99精品国产.久久久久久| 丝袜亚洲另类欧美综合| 午夜一区二区三区在线观看| 亚洲综合999| 亚洲国产成人高清精品| 亚洲在线成人精品| 一区二区不卡在线视频 午夜欧美不卡在| 色视频一区二区| 99久久精品国产一区二区三区| 在线日韩一区二区| 国产精品国产三级国产aⅴ中文| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 在线视频综合导航| 色综合色综合色综合| 99麻豆久久久国产精品免费| 成人sese在线| 一本久久精品一区二区| 欧美亚洲图片小说| 欧美日韩情趣电影| 欧美大片国产精品| 精品区一区二区| 久久久久国产精品人| 国产人久久人人人人爽| 国产精品免费丝袜| 尤物av一区二区| 午夜精品久久久久久久99樱桃 | 亚洲男女一区二区三区| 亚洲激情六月丁香| 一区二区视频免费在线观看| 一区二区久久久| 午夜久久电影网| 日韩精品福利网| 国产精品主播直播| 日韩中文字幕麻豆| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产成人亚洲精品青草天美| 成人一区二区三区中文字幕| 色哟哟日韩精品| 欧美精品少妇一区二区三区| 粉嫩久久99精品久久久久久夜| 成人精品视频.| 欧美日韩一级视频| 日韩欧美一区电影| **欧美大码日韩| 亚洲成在人线免费| 国产盗摄视频一区二区三区| 99久久综合狠狠综合久久| 欧美久久久久久蜜桃| 26uuu久久天堂性欧美| 国产精品久久久久影视| 亚洲一区二区黄色| 亚洲成a人v欧美综合天堂下载| 久久99最新地址| 不卡视频一二三| 在线不卡的av| 国产拍欧美日韩视频二区| 亚洲一级二级三级| 精品一区二区三区在线视频| 91国产丝袜在线播放| 欧美日韩国产三级| 国产精品天天摸av网| 亚洲综合一区在线| 国内精品国产成人| 欧美日韩一二三| 久久久久久免费| 日本伊人午夜精品| 成人av免费在线观看| 欧美r级电影在线观看| 中文字幕在线视频一区| 麻豆精品视频在线观看| 成人av网站在线观看| 精品欧美一区二区三区精品久久 | 亚洲一区二区三区免费视频| 琪琪一区二区三区| 成人久久视频在线观看| 91一区二区在线| 国产欧美日韩亚州综合| 久久亚洲一级片| 日韩二区三区在线观看| 久久精品国产精品青草| 欧美日韩久久一区二区| 国产亚洲成av人在线观看导航| 亚洲国产精品综合小说图片区| 国产黑丝在线一区二区三区| 欧美日韩久久不卡| 久久久久国产成人精品亚洲午夜| 亚洲激情六月丁香| www.日韩在线| 久久夜色精品一区| 日韩国产在线观看一区| 99精品在线免费| 欧美大片在线观看一区| 天天色天天操综合| 972aa.com艺术欧美| 久久久影视传媒| 男女激情视频一区| 欧美日韩一区二区在线观看 | 日韩激情av在线| 在线免费观看日韩欧美| 亚洲人成影院在线观看| 粉嫩蜜臀av国产精品网站| 精品久久久久久久一区二区蜜臀| 亚洲精品国产无套在线观| 免费欧美在线视频| 色婷婷综合久色| 亚洲欧美在线高清| 91在线视频播放地址| 日韩欧美三级在线| 日韩电影一区二区三区四区| 欧美日韩美少妇| 亚洲福利电影网| 欧美在线免费播放| 国产精品久久三| 成人不卡免费av| 国产欧美1区2区3区| 国产在线国偷精品产拍免费yy| 日韩午夜激情电影| 久久国产夜色精品鲁鲁99| 26uuu成人网一区二区三区| 麻豆精品久久精品色综合| 日韩免费高清视频| 精品中文字幕一区二区 | 26uuu国产在线精品一区二区| 美女任你摸久久| 日韩欧美国产一二三区| 免费亚洲电影在线| 久久品道一品道久久精品| 狠狠色丁香婷婷综合| 制服丝袜亚洲色图| 国产一区二区在线看| 欧美xxxxxxxx| 国产黄人亚洲片| 中文字幕一区二区三区乱码在线| 不卡区在线中文字幕| 亚洲国产wwwccc36天堂| 欧美日韩亚洲另类| 蜜臀国产一区二区三区在线播放| 精品国产一区二区三区久久久蜜月| 日本va欧美va瓶| 欧美探花视频资源| 国产一区在线看| 国产精品看片你懂得| 日本韩国一区二区三区视频| 亚洲图片一区二区| 久久久五月婷婷| 91视频免费播放| 亚洲国产乱码最新视频| 日韩精品专区在线影院重磅| 国产69精品久久777的优势| 国产精品久久三| 欧美美女激情18p| 国产酒店精品激情| 亚洲精品成人悠悠色影视| 91农村精品一区二区在线| 麻豆精品视频在线观看视频| 日本一区二区三区国色天香 | 成人精品视频一区| 亚洲午夜久久久久久久久久久| 欧美一二三四在线| a4yy欧美一区二区三区| 亚洲激情中文1区| 国产欧美日韩在线| 777午夜精品免费视频| 成人免费观看男女羞羞视频| 亚洲国产综合色| 精品入口麻豆88视频|