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

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

?? m2syslib.c

?? vxworks的完整的源代碼
?? C
字號:
/* m2SysLib.c - MIB-II system-group API for SNMP agents *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01h,15oct01,rae  merge from truestack ver 01i, base 01g (VIRTUAL_STACK)01g,30dec97,vin  fixed SPR 2009001f,03apr96,rjc  set the m2SystemSem semaphore to NULL in m2SysDelete.01d,25jan95,jdi  doc cleanup.01c,11nov94,rhp  additional man-page corrections01b,10nov94,rhp  edit man pages01b,22feb94,elh  put in check for null parameters in m2SysInit. 01a,08dec93,jag  written*//*DESCRIPTIONThis library provides MIB-II services for the system group.  It providesroutines to initialize the group and to access the group scalar variables.For a broader description of MIB-II services, see the manual entry for m2Lib.To use this feature, include the following component:INCLUDE_MIB2_SYSTEMUSING THIS LIBRARYThis library can be initialized and deleted by calling m2SysInit() andm2SysDelete() respectively, if only the system 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 system group provides the option to set the system variables at thetime m2Sysinit() is called.  The MIB-II variables `sysDescr' and `sysobjectId'are read-only, and can be set only by the system-group initialization routine.The variables `sysContact', `sysName' and `sysLocation' can be set throughm2SysGroupInfoSet() at any time.The following is an example of system group initialization:.CS    M2_OBJECTID mySysObjectId = { 8, {1,3,6,1,4,1,731,1} };    if (m2SysInit ("VxWorks MIB-II library ",		   "support@wrs.com",		   "1010 Atlantic Avenue Alameda, California 94501",		   &mySysObjectId) == OK)	/@ System group initialized successfully @/.CEThe system group variables can be accessed as follows:.CS    M2_SYSTEM   sysVars;    if (m2SysGroupInfoGet (&sysVars) == OK)	/@ values in sysVars are valid @/.CEThe system group variables can be set as follows:.CS    M2_SYSTEM    sysVars;     unsigned int varToSet;	/@ bit field of variables to set @/    /@ Set the new system Name @/    strcpy (m2SysVars.sysName, "New System Name");    varToSet |= M2SYSNAME;   /@ Set the new contact name @/    strcpy (m2SysVars.sysContact, "New Contact");    varToSet |= M2SYSCONTACT;    if (m2SysGroupInfoGet (varToSet, &sysVars) == OK)	/@ values in sysVars set @/.CEINCLUDE FILES: m2Lib.h SEE ALSO:m2Lib, m2IfLib, m2IpLib, m2IcmpLib, m2UdpLib, m2TcpLib*//* includes */#include <vxWorks.h>#include "m2Lib.h"#include "netLib.h"#include <netinet/in_systm.h>#include <netinet/in.h>#include <netinet/ip.h>#include <netinet/ip_var.h>#include "hostLib.h"#include "string.h"#include "semLib.h"#include "tickLib.h"#include "sysLib.h"#include "errnoLib.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#endif /* VIRTUAL_STACK */#ifndef VIRTUAL_STACK/* externs */IMPORT int  _ipCfgFlags; /* globals *//*  * The system group is supported by the structure defined below.  All changes to * the system group are reflected in this structure. */LOCAL M2_SYSTEM m2SystemVars;/* This semaphore protects the m2SystemVars from multiple readers and writers */ LOCAL SEM_ID m2SystemSem;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 sysZeroObjectId = { 2, {0,0} };/******************************************************************************** centiSecsGet - get hundreds of a second** The number of hundreds of a second that have passed since this routine was* first called.** RETURNS: Hundreds of a second since the group was initialized.** SEE ALSO: N/A*/LOCAL unsigned long centiSecsGet (void)    {    unsigned long currCentiSecs;    unsigned long clkRate = sysClkRateGet ();#ifdef VIRTUAL_STACK    if (sysStartCentiSecs == 0)	sysStartCentiSecs = (tickGet () * 100) / clkRate;    currCentiSecs = (tickGet () * 100) / clkRate;    return (currCentiSecs - sysStartCentiSecs);#else    /* VIRTUAL_STACK */    if (startCentiSecs == 0)	startCentiSecs = (tickGet () * 100) / clkRate;    currCentiSecs = (tickGet () * 100) / clkRate;    return (currCentiSecs - startCentiSecs);#endif   /* VIRTUAL_STACK */    }/******************************************************************************** m2SysInit - initialize MIB-II system-group routines** This routine allocates the resources needed to allow access to the* system-group MIB-II variables.  This routine must be called before* any system-group variables can be accessed.  The input parameters* <pMib2SysDescr>, <pMib2SysContact>, <pMib2SysLocation>, and* <pObjectId> are optional.  The parameters <pMib2SysDescr>,* <pObjectId> are read only, as specified by MIB-II, and can be set* only by this routine.** RETURNS: OK, always.** ERRNO:* S_m2Lib_CANT_CREATE_SYS_SEM** SEE ALSO: m2SysGroupInfoGet(), m2SysGroupInfoSet(), m2SysDelete() */STATUS m2SysInit    (    char *		pMib2SysDescr,	      /* pointer to MIB-2 sysDescr */    char *		pMib2SysContact,      /* pointer to MIB-2 sysContact */    char *		pMib2SysLocation,     /* pointer to MIB-2 sysLocation */    M2_OBJECTID	*	pObjectId 	      /* pointer to MIB-2 ObjectId */    )    {    /* Initialize System Group with defaults */    if ((pMib2SysDescr != NULL) && (pMib2SysDescr [0] != '\0'))	strcpy ((char *) m2SystemVars.sysDescr, pMib2SysDescr);    if ((pMib2SysContact != NULL) && (pMib2SysContact [0] != '\0'))	strcpy ((char *) m2SystemVars.sysContact, pMib2SysContact);    if ((pMib2SysLocation != NULL) && (pMib2SysLocation [0] != '\0'))	strcpy ((char *) m2SystemVars.sysLocation, pMib2SysLocation);        /* Use targets host name as a the system name */    gethostname ((char *) m2SystemVars.sysName, sizeof(m2SystemVars.sysName));    if ((pObjectId != NULL) && (pObjectId->idLength > 0))    	{     	bcopy (((char *) (pObjectId->idArray)), 	       ((char *) (m2SystemVars.sysObjectID.idArray)), 	       pObjectId->idLength * sizeof(long));	m2SystemVars.sysObjectID.idLength = pObjectId->idLength;	}    else	{	/* Initialize System group OID with the Zero OID */    	bcopy (((char *) (sysZeroObjectId.idArray)), 	       ((char *) (m2SystemVars.sysObjectID.idArray)), 	       sysZeroObjectId.idLength * sizeof(long));	m2SystemVars.sysObjectID.idLength = sysZeroObjectId.idLength;	}    /* Create semaphore */    if (m2SystemSem == NULL)        {        m2SystemSem = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE |                                SEM_DELETE_SAFE);        if (m2SystemSem == NULL)            {	    errnoSet (S_m2Lib_CANT_CREATE_SYS_SEM);            return (ERROR);            }        }    (void) centiSecsGet ();     /* Initialize group time reference */     return (OK);    }/******************************************************************************** m2SysGroupInfoGet -  get system-group MIB-II variables** This routine fills in the structure at <pSysInfo> with the values of MIB-II* system-group variables.*** RETURNS: OK, or ERROR if <pSysInfo> is not a valid pointer.** ERRNO:* S_m2Lib_INVALID_PARAMETER** SEE ALSO: m2SysInit(), m2SysGroupInfoSet(), m2SysDelete()*/STATUS m2SysGroupInfoGet    (    M2_SYSTEM * pSysInfo	/* pointer to MIB-II system group structure */    )    {     /* Validate Pointer to the requested System structure */     if (pSysInfo == NULL)	{	errnoSet (S_m2Lib_INVALID_PARAMETER);        return (ERROR);	}     pSysInfo->sysUpTime = centiSecsGet ();     /* Take the System semaphore before reading the system variables */    semTake (m2SystemSem, WAIT_FOREVER);     strcpy ((char *) pSysInfo->sysDescr,    (char *) m2SystemVars.sysDescr);    strcpy ((char *) pSysInfo->sysContact,  (char *) m2SystemVars.sysContact);    strcpy ((char *) pSysInfo->sysName,     (char *) m2SystemVars.sysName);    strcpy ((char *) pSysInfo->sysLocation, (char *) m2SystemVars.sysLocation);     bcopy (((char *) m2SystemVars.sysObjectID.idArray), 	   ((char *) pSysInfo->sysObjectID.idArray),	   m2SystemVars.sysObjectID.idLength * sizeof (long));    pSysInfo->sysObjectID.idLength = m2SystemVars.sysObjectID.idLength;     semGive (m2SystemSem);     /* Compute type of targets service based on the IP forwarding variables */    if (_ipCfgFlags & IP_DO_FORWARDING)        pSysInfo->sysServices |= (1 << (3 - 1));    else        pSysInfo->sysServices &= ~(1 << (3 - 1));     return (OK);    }/******************************************************************************** m2SysGroupInfoSet - set system-group MIB-II variables to new values** This routine sets one or more variables in the system group as specified in* the input structure at <pSysInfo> and the bit field parameter <varToSet>.** RETURNS: * OK, or ERROR if <pSysInfo> is not a valid pointer, or <varToSet> has an * invalid bit field.** ERRNO:*  S_m2Lib_INVALID_PARAMETER*  S_m2Lib_INVALID_VAR_TO_SET** SEE ALSO: m2SysInit(), m2SysGroupInfoGet(), m2SysDelete()*/STATUS m2SysGroupInfoSet    (    unsigned int varToSet,		/* bit field of variables to set */    M2_SYSTEM * pSysInfo		/* pointer to the system structure */    )    {     /* Validate Pointer to System structure and bit field in varToSet */     if (pSysInfo == NULL ||        (varToSet & (M2SYSNAME | M2SYSCONTACT | M2SYSLOCATION)) == 0)	{	if (pSysInfo == NULL)	    errnoSet (S_m2Lib_INVALID_PARAMETER);	else	    errnoSet (S_m2Lib_INVALID_VAR_TO_SET);        return (ERROR);	}     /* Set requested variables */     semTake (m2SystemSem, WAIT_FOREVER);     if (varToSet & M2SYSNAME)        strcpy ((char *) m2SystemVars.sysName, (char *) pSysInfo->sysName);     if (varToSet & M2SYSCONTACT)        strcpy ((char *) m2SystemVars.sysContact, (char *)pSysInfo->sysContact);     if (varToSet & M2SYSLOCATION)        strcpy ((char *) m2SystemVars.sysLocation, 		(char *) pSysInfo->sysLocation);     semGive (m2SystemSem);     return (OK);    }/********************************************************************************* m2SysDelete - delete resources used to access the MIB-II system group** This routine frees all the resources allocated at the time the group was* initialized.  Do not access the system group after calling this routine.** RETURNS: OK, always.** SEE ALSO: m2SysInit(), m2SysGroupInfoGet(), m2SysGroupInfoSet().*/STATUS m2SysDelete (void)    {    if (m2SystemSem != NULL)        {        semDelete (m2SystemSem);        m2SystemSem = NULL;        }    return (OK);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一级日本不卡的影视| 亚洲午夜久久久久中文字幕久| 91蜜桃网址入口| 青青草精品视频| 亚洲欧洲制服丝袜| 久久久亚洲国产美女国产盗摄| 欧美视频在线播放| 波多野结衣精品在线| 久久精品国产77777蜜臀| 亚洲美女区一区| 日本一区二区电影| 久久综合久久综合九色| 欧美日本一道本在线视频| 91在线免费播放| 国产成人免费在线观看| 久久99国产精品久久99| 天堂一区二区在线| 亚洲国产三级在线| 亚洲精品国产第一综合99久久| 久久精品日产第一区二区三区高清版 | 欧美一区2区视频在线观看| 91在线国产观看| 成人av在线播放网址| 国产麻豆午夜三级精品| 九色|91porny| 激情都市一区二区| 免费视频最近日韩| 午夜欧美在线一二页| 一区二区三区四区不卡在线 | 日韩av一区二区三区四区| 亚洲欧洲精品成人久久奇米网| 久久久久久久一区| 久久综合色一综合色88| 精品久久国产老人久久综合| 日韩写真欧美这视频| 欧美一级生活片| 日韩手机在线导航| 日韩一区二区在线看| 欧美电影精品一区二区| 欧美日韩高清影院| 日韩一区二区三区四区| 欧美成人精品高清在线播放| 宅男在线国产精品| 日韩欧美一区电影| 久久亚洲欧美国产精品乐播| 欧美精品一区男女天堂| 久久午夜羞羞影院免费观看| 久久久国际精品| 国产精品免费视频一区| 中文字幕欧美一区| 亚洲一线二线三线久久久| 亚洲一区二区三区在线| 婷婷久久综合九色综合伊人色| 午夜精品福利在线| 久久国产人妖系列| 成人高清视频免费观看| 99久久精品99国产精品| 欧美日韩一区在线| 精品免费99久久| 国产女人18毛片水真多成人如厕 | 2023国产精品视频| 欧美激情自拍偷拍| 一区二区三区在线观看视频| 亚洲超碰精品一区二区| 久久69国产一区二区蜜臀| 国产a久久麻豆| 91精彩视频在线| 日韩一区二区三免费高清| 国产视频一区在线观看| 亚洲激情第一区| 免费av成人在线| 成人av资源在线观看| 欧美日韩的一区二区| 久久综合久色欧美综合狠狠| 18成人在线视频| 婷婷综合五月天| 国产成人一区在线| 91成人网在线| 精品国产91洋老外米糕| 亚洲男人天堂一区| 琪琪一区二区三区| 99久久精品国产一区二区三区| 欧美人体做爰大胆视频| 亚洲国产经典视频| 日韩精彩视频在线观看| 高清国产一区二区| 9191成人精品久久| 中文字幕一区二区三区不卡在线 | 日韩电影一区二区三区四区| 国产91精品在线观看| 欧美日韩在线不卡| 中文久久乱码一区二区| 日本成人超碰在线观看| 91丝袜国产在线播放| 日韩视频123| 亚洲综合一区二区三区| 国产成人综合在线| 91精品久久久久久久91蜜桃 | 亚洲国产aⅴ天堂久久| 国产成人精品综合在线观看 | 一区二区激情视频| 国产精品一区二区你懂的| 欧美三级资源在线| 国产精品国产三级国产普通话99| 琪琪久久久久日韩精品| 色婷婷av一区二区三区软件 | 久久久久久亚洲综合影院红桃| 亚洲成av人**亚洲成av**| 97久久精品人人澡人人爽| 久久午夜国产精品| 美女一区二区三区| 91麻豆精品91久久久久久清纯| 日韩毛片视频在线看| 一区二区三区国产精品| 色www精品视频在线观看| 国产亚洲污的网站| 亚洲欧洲国产日韩| 精品一区二区免费在线观看| 欧美综合色免费| 国产精品久久久久久久久免费桃花 | 日韩免费视频线观看| 亚洲在线成人精品| 国产一区美女在线| 国产欧美精品一区二区三区四区| 成人免费看视频| 亚洲精品免费在线观看| 欧美日韩电影一区| 韩国成人精品a∨在线观看| 国产视频亚洲色图| 在线视频综合导航| 久久99精品久久久久婷婷| 国产欧美日韩另类一区| 色哟哟一区二区| 奇米影视一区二区三区| 国产三级欧美三级| 99久久综合国产精品| 亚洲成人久久影院| 久久精品一区二区三区不卡| 97se狠狠狠综合亚洲狠狠| 日韩国产成人精品| 国产精品欧美经典| 精品视频一区二区不卡| 国内不卡的二区三区中文字幕| 中文字幕一区二区三区色视频| 欧美人与z0zoxxxx视频| 国产传媒久久文化传媒| 亚洲一区二区在线播放相泽| 精品人伦一区二区色婷婷| www.性欧美| 久久国产精品免费| 一区二区三区日韩欧美精品| 91麻豆精品国产91久久久使用方法 | 国产精品一区2区| 国产精品麻豆久久久| 欧美日韩国产首页| 国产不卡视频一区| 日本视频在线一区| 亚洲视频一二三区| 精品国产亚洲一区二区三区在线观看| 成人黄色国产精品网站大全在线免费观看 | 777奇米四色成人影色区| 国产成人av电影在线观看| 天天色天天爱天天射综合| 国产精品污网站| 欧美大片一区二区三区| 色美美综合视频| 成人激情综合网站| 蜜桃av一区二区在线观看| 亚洲桃色在线一区| 久久精品一区二区三区av| 91精品久久久久久久91蜜桃| 色婷婷狠狠综合| 成人免费精品视频| 久久成人免费网| 视频一区欧美日韩| 亚洲欧美日韩一区二区 | 亚洲va欧美va天堂v国产综合| 中文字幕va一区二区三区| 欧美一区二区三区视频| 日本精品免费观看高清观看| 国产麻豆精品theporn| 日韩国产高清影视| 亚洲不卡一区二区三区| 亚洲美女淫视频| 椎名由奈av一区二区三区| 久久网站最新地址| 日韩欧美一级二级三级久久久| 欧美日韩国产首页在线观看| 日本道色综合久久| 99视频一区二区| 99re66热这里只有精品3直播| 国产精品自在在线| 久草精品在线观看| 美腿丝袜亚洲色图| 日本免费新一区视频| 肉色丝袜一区二区| 日韩精品乱码av一区二区| 亚洲国产另类av| 亚洲国产成人av好男人在线观看| 亚洲一卡二卡三卡四卡无卡久久|