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

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

?? m2iflib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* m2IfLib.c - MIB-II interface-group API for SNMP agents *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01w,25jun02,ann  making a temporary fix to the counter update code01v,10may02,kbw  making man page edits01u,07may02,kbw  making man page edits01t,25apr02,vvv  added semaphore protection in m2IfTableUpdate (SPR #74394)01s,05dec01,vvv  fixed stack table search for high index values (SPR #71316) 01r,15oct01,rae  merge from truestack01q,14jun01,vvv  fixed compilation warnings01p,30mar01,rae  allow m2 stuff to be excluded (SPR# 65428)01o,23jan01,spm  fixed modification history after RFC 2233 merge01n,13nov00,niq  merged version 01p of tor2_0.open_stack-f1 branch (base 01l):                 added RFC 2233 support01m,03nov00,zhu  fix SPR#30082: ifIndex should remain constant01l,24mar99,ead  Finally fixed the ifLastChange problem!                 Created the m2SetIfLastChange() function which is called		 from ifioctl() in if.c. (SPR #23290)01k,16mar99,ead  additional fixes to SPR #23290, not indexing in pm2IfTable                 also zeroed each instance of ifLastChange in m2IfInit so                 the correct zero value is set during a reboot01j,16mar99,spm  recovered orphaned code from tor1_0_1.sens1_1 (SPR #25770)01i,11mar99,ead  ifLastChange was not getting updated properly (SPR #23290)01h,06oct98,ann  corrected the flag check in m2IfTblEntryGet() for                 ifOperStatus (SPR #22275)01g,26aug97,spm  removed compiler warnings (SPR #7866)01f,03apr96,rjc  set the m2InterfaceSem semaphore to NULL in m2IfDelete01e,25jan95,jdi  doc cleanup.01d,11nov94,rhp  edited man pages some more01c,11nov94,rhp  edited man pages01b,22feb94,elh  added extern to quiet compiler.01a,08dec93,jag  written*//*DESCRIPTIONThis library provides MIB-II services for the interface group.  Itprovides routines to initialize the group, access the group scalarvariables, read the table interfaces and change the state of the interfaces.For a broader description of MIB-II services, see the manual entry for m2Lib.To use this feature, include the following component:INCLUDE_MIB2_IFUSING THIS LIBRARYThis library can be initialized and deleted by calling m2IfInit() andm2IfDelete() respectively, if only the interface group's services areneeded.  If full MIB-II support is used, this group and all other groupscan be initialized and deleted by calling m2Init() and m2Delete().The interface group supports the Simple Network Management Protocol (SNMP)concept of traps, as specified by RFC 1215.  The traps supported by thisgroup are "link up" and "link down."  This library enables an applicationto register a hook routine and an argument.  This hook routine can becalled by the library when a "link up" or "link down" condition isdetected.  The hook routine must have the following prototype:.CSvoid TrapGenerator (int trapType,  /@ M2_LINK_DOWN_TRAP or M2_LINK_UP_TRAP @/ 		    int interfaceIndex, 		    void * myPrivateArg);.CEThe trap routine and argument can be specified at initialization time asinput parameters to the routine m2IfInit() or to the routine m2Init().The interface-group global variables can be accessed as follows:.CSM2_INTERFACE   ifVars;if (m2IfGroupInfoGet (&ifVars) == OK)    /@ values in ifVars are valid @/.CEAn interface table entry can be retrieved as follows:.CSM2_INTERFACETBL  interfaceEntry;/@ Specify zero as the index to get the first entry in the table @/interfaceEntry.ifIndex = 2;     /@ Get interface with index 2 @/if (m2IfTblEntryGet (M2_EXACT_VALUE, &interfaceEntry) == OK)    /@ values in interfaceEntry are valid @/.CEAn interface entry operational state can be changed as follows:.CSM2_INTERFACETBL ifEntryToSet;ifEntryToSet.ifIndex = 2; /@ Select interface with index 2     @/                          /@ MIB-II value to set the interface @/                          /@ to the down state.                @/ifEntryToSet.ifAdminStatus = M2_ifAdminStatus_down;if (m2IfTblEntrySet (&ifEntryToSet) == OK)    /@ Interface is now in the down state @/.CEINCLUDE FILES: m2Lib.h SEE ALSO: m2Lib, m2SysLib, m2IpLib, m2IcmpLib, m2UdpLib, m2TcpLib*//* includes */#include "vxWorks.h"#include "stdio.h"#include "stdlib.h"#include "m2IfLib.h"#include "private/m2LibP.h"#include "ioctl.h"#include "semLib.h"#include "string.h"#include "tickLib.h"#include "sysLib.h"#include "errnoLib.h"#include "limits.h"#include "float.h"#include "memPartLib.h"#include "ipProto.h"#include "private/muxLibP.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#endif    /* VIRTUAL_STACK *//* defines */#define END_OBJ_MIB        1            /* Used in ifnetToEndFieldsGet() */#define END_OBJ_FLAGS      2            /* Used in ifnetToEndFieldsGet() *//* imports */IMPORT FUNCPTR  _m2SetIfLastChange;     /* def'd in if.c for scalability */IMPORT FUNCPTR  _m2IfTableUpdate;/* globals */static const UI64 U64_MAX  = { UINT_MAX, UINT_MAX };#ifndef VIRTUAL_STACKAVL_TREE      pM2IfRoot    = NULL;AVL_TREE *    pM2IfRootPtr = &pM2IfRoot;M2_IFINDEX *  pm2IfTable;     /* Network I/F table (Allocated Dynamically) */int           m2IfCount;      /* Number of network interfaces */int           ifsInList;      /* Actual number of interfaces in our list */LOCAL FUNCPTR pM2TrapRtn;     /* Pointer to trap routine supplied by the user */LOCAL void *  pM2TrapRtnArg;  /* Pointer to trap routine argument supplied by */			      /* the user *//* last time a row was added/removed from the ifTable/ifXTable */LOCAL ULONG ifTableLastChange;/* last time a row was added/removed from the ifStackTable or when the * ifStackStatus was last changed */LOCAL ULONG ifStackLastChange;/* Semaphore used to protect the Interface group */SEM_ID m2InterfaceSem;/*  * Global variable used to keep the group startup time in hundreds of a second.  * The functionality here is the same as the functionality provided in the  * module m2SysLib.c.  It is duplicated to allow for both modules to exist * independently. */LOCAL unsigned long startCentiSecs;	/* Hundred of Seconds at start */#endif    /* VIRTUAL_STACK *//* * The zero object id is used throught out the MIB-II library to fill OID  * requests when an object ID is not provided by a group variable. */LOCAL M2_OBJECTID ifZeroObjectId = { 2, {0,0} };extern int ifioctl ();LOCAL void   m2IfIncr32Bit (M2_DATA *, ULONG *, ULONG);LOCAL void   m2IfIncr64Bit (M2_DATA *, UI64 *, ULONG);LOCAL void   m2IfDefaultValsGet (M2_DATA *, M2_IFINDEX *);LOCAL void   m2IfCommonValsGet (M2_DATA *, M2_IFINDEX *);LOCAL STATUS rcvEtherAddrGet (struct ifnet *, M2_IFINDEX *);LOCAL STATUS rcvEtherAddrAdd (M2_IFINDEX *, unsigned char *);LOCAL unsigned long centiSecsGet (void);LOCAL BOOL   stackEntryIsTop(int);LOCAL BOOL   stackEntryIsBottom(int);LOCAL void * ifnetToEndFieldsGet (struct ifnet *, int);/***************************************************************************** m2IfAlloc - allocate the structure for the interface table** This routine is called by the driver during initialization of the interface.* The memory for the interface table is allocated here.  We also set the* default update routines in the M2_ID struct. These fields can later be* overloaded using the installed routines in the M2_ID.  Once this function* returns, it is the driver's responsibility to set the pMib2Tbl pointer in* the END object to the new M2_ID.** When this call returns, the calling routine must set the END_MIB_2233 * bit of the flags field in the END object.** RETURNS: Pointer to the M2_ID structure that was allocated.*/M2_ID * m2IfAlloc    (    ULONG        ifType,          /* If type of the interface */    UCHAR *      pEnetAddr,       /* Physical address of interface */    ULONG        addrLen,         /* Address length */    ULONG        mtuSize,         /* MTU of interface */    ULONG        speed,           /* Speed of the interface */    char *       pName,           /* Name of the device */    int          unit             /* Unit number of the device */    )    {    M2_ID *             pM2Id;    M2_INTERFACETBL *   pM2IfTbl;    M2_2233TBL *        pM2233Tbl;    /* Allocate memory for the interface table */    pM2Id = KHEAP_ALLOC(sizeof(M2_ID));    if (!pM2Id)        return NULL;    memset(pM2Id, 0, sizeof(M2_ID));    /* Enter the values provided by the driver */    pM2IfTbl = &pM2Id->m2Data.mibIfTbl;    pM2233Tbl = &pM2Id->m2Data.mibXIfTbl;    pM2IfTbl->ifType  = ifType;    pM2IfTbl->ifMtu   = mtuSize;    pM2IfTbl->ifSpeed = speed;    memcpy (&pM2IfTbl->ifPhysAddress.phyAddress[0], pEnetAddr, addrLen);    pM2IfTbl->ifPhysAddress.addrLength = addrLen;    sprintf (&pM2233Tbl->ifName[0], "%s%d", pName, unit);    /* Set the default update routines */    pM2Id->m2PktCountRtn  = m2IfGenericPacketCount;    pM2Id->m2CtrUpdateRtn = m2IfCounterUpdate;    pM2Id->m2VarUpdateRtn = m2IfVariableUpdate;    return (pM2Id);    }/***************************************************************************** m2IfFree - free an interface data structure** This routine frees the given M2_ID.  Note if the driver is not an RFC 2233* driver then the M2_ID is NULL and this function simply returns.** RETURNS: OK if successful, ERROR otherwise*/STATUS m2IfFree    (    M2_ID * pId      /* pointer to the driver's M2_ID object */    )    {    if (pId == NULL)        {        return ERROR;        }    else        {        KHEAP_FREE((char *)pId);        return OK;        }    }/***************************************************************************** m2IfIncr32Bit - increment a 32 bit interface counter** This function is used to increment an interface counter.  The counter* to update is pointed to by pStat and amount specifies how much to increment* the counter.  If the counter would roll-over if incremented by the amount,* the the ifCounterDiscontinuityTime is set to the system uptime.** RETURNS: N/A*/LOCAL void m2IfIncr32Bit    (    M2_DATA * pMib2Data,        /* pointer to interface stat struct */    ULONG *   pStat,            /* pointer to the counter to update */    ULONG     amount            /* amount to update the counter */    )    {#ifdef notdef    if (*pStat > UINT_MAX)        {        *pStat = UINT_MAX;        }    if ((UINT_MAX - *pStat) < amount)        {        *pStat = UINT_MAX;        pMib2Data->mibXIfTbl.ifCounterDiscontinuityTime = centiSecsGet();        }    else        {        *pStat += amount;        }#endif        *pStat += amount;    }/***************************************************************************** m2IfIncr64Bit - increment a 64 bit interface counter** This function is used to increment an interface counter.  The counter* to update is pointed to by pStat and amount specifies how much to increment* the counter.  If the counter would roll-over if incremented by the amount,* the the ifCounterDiscontinuityTime is set to the system uptime.** RETURNS: N/A*/LOCAL void m2IfIncr64Bit    (    M2_DATA *   pMib2Data,  /* pointer to interface stat struct */    UI64 *      pStat,      /* pointer to the counter to update */    ULONG       amount      /* amount to update the counter */    )    {    UI64 u64Diff;    UI64 u64Amount;    if (UI64_COMP(pStat, &U64_MAX) >= 0)        {        UI64_COPY(pStat, &U64_MAX);        }    UI64_ZERO(&u64Diff);    UI64_ZERO(&u64Amount);    u64Amount.low = amount;    UI64_SUB64(&u64Diff, &U64_MAX, pStat);    if (UI64_COMP(&u64Diff, &u64Amount) < 0)        {        UI64_COPY(pStat, &U64_MAX);        pMib2Data->mibXIfTbl.ifCounterDiscontinuityTime = centiSecsGet();        }    else        {        UI64_ADD32(pStat, amount);        }    }/***************************************************************************** m2IfGenericPacketCount - increment the interface packet counters ** This function updates the basic interface counters for a packet. It knows * nothing of the underlying media.  Thus, so only the 'ifInOctets', * 'ifHCInOctets', 'ifOutOctets', 'ifHCOutOctets', and * 'ifCounterDiscontinuityTime' variables are incremented.  The <ctrl> * argument specifies whether the packet is being sent or just received * (M2_PACKET_IN or M2_PACKET_OUT).** RETURNS: ERROR if the M2_ID is NULL, OK if the counters were updated.*/STATUS m2IfGenericPacketCount     (    M2_ID *   pId,      /* The pointer to the device M2_ID object */    UINT      ctrl,     /* Update In or Out counters */    UCHAR *   pPkt,     /* The incoming/outgoing packet */    ULONG     pktLen    /* Length of the packet */    )    {    M2_DATA * pMib2Data;    if (pId == NULL)        return ERROR;    pMib2Data = &(pId->m2Data);    switch (ctrl)        {        case M2_PACKET_IN:            m2IfIncr32Bit(pMib2Data, &(pMib2Data->mibIfTbl.ifInOctets),                          pktLen);            break;        case M2_PACKET_OUT:            m2IfIncr32Bit(pMib2Data, &(pMib2Data->mibIfTbl.ifOutOctets),                          pktLen);            break;        default:            return ERROR;        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄色在线网站| 国产精品久久精品日日| 日韩中文欧美在线| 欧美一区二区三区在线| 奇米影视一区二区三区| 欧美一级免费大片| 免费精品99久久国产综合精品| 日韩视频中午一区| 国产美女精品人人做人人爽| 国产午夜一区二区三区| 99在线视频精品| 亚洲精品日韩一| 欧美日韩mp4| 国产揄拍国内精品对白| 中文字幕一区二区在线播放| 在线视频一区二区三| 午夜精品一区二区三区电影天堂| 日韩欧美国产综合在线一区二区三区| 精品一区二区日韩| 日韩在线卡一卡二| 久久精品人人做人人综合| 成人av手机在线观看| 亚洲国产视频网站| 精品国产一区二区三区久久久蜜月| 成人av片在线观看| 日本女优在线视频一区二区| 国产精品视频一区二区三区不卡| 色综合欧美在线| 奇米在线7777在线精品| 中文字幕在线不卡视频| 91精品国产一区二区三区蜜臀 | 欧美一区二区三区成人| 成人免费高清视频| 日本不卡一区二区三区高清视频| 久久久亚洲欧洲日产国码αv| 91福利资源站| 国产一区二区影院| 无码av中文一区二区三区桃花岛| 日本一区二区三区dvd视频在线| 欧美日韩在线播放三区四区| 国产精品一区2区| 五月激情综合色| 亚洲色欲色欲www在线观看| 亚洲精品一区二区三区99| 在线中文字幕一区| av不卡一区二区三区| 国产一区福利在线| 三级欧美韩日大片在线看| 亚洲人成影院在线观看| 337p粉嫩大胆噜噜噜噜噜91av| 欧美午夜精品免费| 99精品视频在线观看| 国产福利精品一区| 精品一区二区三区av| 午夜a成v人精品| 一区二区三区四区不卡在线| 日本一区二区不卡视频| 亚洲精品一区二区三区在线观看| 5566中文字幕一区二区电影| 欧美色综合久久| 色妞www精品视频| 99视频超级精品| av一区二区久久| bt7086福利一区国产| 成人av资源网站| 成人美女视频在线观看| 国产精品亚洲成人| 国产不卡在线视频| 国产精品综合网| 国产乱码精品一区二区三区av | 欧美大片拔萝卜| 777午夜精品免费视频| 在线观看www91| 在线一区二区三区做爰视频网站| 99久久精品国产导航| gogo大胆日本视频一区| 99久久精品免费看国产免费软件| www.亚洲精品| 97精品久久久午夜一区二区三区| 国产91在线看| 成人福利视频网站| 成人精品视频.| av亚洲产国偷v产偷v自拍| 99在线精品视频| av欧美精品.com| 色婷婷综合久久久| 欧美性受xxxx黑人xyx| 欧美精品aⅴ在线视频| 欧美一区二区三级| 久久久久久免费网| 国产视频一区二区在线观看| 久久久久久97三级| 国产精品久久久久久妇女6080| 亚洲另类一区二区| 手机精品视频在线观看| 精品无人区卡一卡二卡三乱码免费卡| 国产精品亚洲午夜一区二区三区| 成人激情免费网站| 色就色 综合激情| 日韩欧美亚洲另类制服综合在线| 久久欧美一区二区| 亚洲美女少妇撒尿| 日本中文在线一区| 国产中文一区二区三区| 91亚洲男人天堂| 91麻豆精品国产91久久久更新时间| 久久综合色婷婷| 国产精品少妇自拍| 亚洲一区二区三区在线播放| 青青草视频一区| 不卡的av电影在线观看| 欧美精品乱人伦久久久久久| 久久九九全国免费| 亚洲国产一区二区三区| 国产美女视频一区| 91天堂素人约啪| 91麻豆精品国产91久久久久久久久 | 久久婷婷色综合| 一区二区三区蜜桃网| 国产一区二区三区四区五区入口| 在线看日本不卡| 欧美三级一区二区| 国产精品成人网| 亚瑟在线精品视频| 国产老肥熟一区二区三区| 国产激情视频一区二区三区欧美| 97精品久久久午夜一区二区三区| 在线免费不卡视频| 久久久99精品免费观看不卡| 亚洲综合色区另类av| 国产综合色视频| 欧美v日韩v国产v| 午夜一区二区三区在线观看| 轻轻草成人在线| 91免费观看视频在线| 精品福利一区二区三区| 一区二区三区蜜桃| 大白屁股一区二区视频| 日韩欧美高清在线| 亚洲一区免费在线观看| www.亚洲人| 国产欧美日本一区二区三区| 免费在线观看不卡| 欧美日韩中文字幕精品| 中文字幕日韩欧美一区二区三区| 黄页网站大全一区二区| 91精品国产综合久久久蜜臀粉嫩 | 亚洲三级小视频| 国产精品1区2区3区在线观看| 欧美巨大另类极品videosbest | 精品成人a区在线观看| 亚洲一区成人在线| 91女神在线视频| 亚洲欧洲日产国码二区| 国产成人精品免费在线| 精品不卡在线视频| 蜜桃av噜噜一区| 日韩精品一区二区三区swag| 亚洲午夜精品17c| 欧亚一区二区三区| 亚洲一级二级在线| 欧美视频一二三区| 亚洲一本大道在线| 欧美日韩在线播放一区| 亚洲18色成人| 欧美日韩dvd在线观看| 五月婷婷久久丁香| 在线播放91灌醉迷j高跟美女| 亚洲成人资源在线| 欧美久久一二三四区| 午夜精品久久久久久久99樱桃| 欧美亚洲高清一区二区三区不卡| 亚洲激情五月婷婷| 欧美性生交片4| 日产欧产美韩系列久久99| 欧美一区国产二区| 看电影不卡的网站| 久久久精品综合| 91在线免费看| 午夜精品久久久久久久久| 日韩一区二区三区免费观看| 精品一区二区在线观看| 国产亚洲成av人在线观看导航| 成人黄色网址在线观看| 亚洲情趣在线观看| 6080午夜不卡| 国产成人超碰人人澡人人澡| 中文字幕日韩av资源站| 欧美在线观看你懂的| 五月天久久比比资源色| 日韩精品一区在线观看| 丰满少妇在线播放bd日韩电影| 亚洲欧洲制服丝袜| 91精品在线观看入口| 国产一区二区三区黄视频 | 久久综合资源网| 93久久精品日日躁夜夜躁欧美| 亚洲午夜电影在线观看| 欧美mv日韩mv| 99精品国产91久久久久久 |