📄 m2syslib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/m2SysLib.html - generated by refgen from m2SysLib.c --> <title> m2SysLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>m2SysLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2SysLib</strong> - MIB-II system-group API for SNMP agents </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./m2SysLib.html#m2SysInit">m2SysInit</a>( )</b> - initialize MIB-II system-group routines<br><b><a href="./m2SysLib.html#m2SysGroupInfoGet">m2SysGroupInfoGet</a>( )</b> - get system-group MIB-II variables<br><b><a href="./m2SysLib.html#m2SysGroupInfoSet">m2SysGroupInfoSet</a>( )</b> - set system-group MIB-II variables to new values<br><b><a href="./m2SysLib.html#m2SysDelete">m2SysDelete</a>( )</b> - delete resources used to access the MIB-II system group<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This 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 <b><a href="./m2Lib.html#top">m2Lib</a></b>.<p>To use this feature, include the following component:<b>INCLUDE_MIB2_SYSTEM</b><p></blockquote><h4>USING THIS LIBRARY</h4><blockquote><p>This library can be initialized and deleted by calling <b><a href="./m2SysLib.html#m2SysInit">m2SysInit</a>( )</b> and<b><a href="./m2SysLib.html#m2SysDelete">m2SysDelete</a>( )</b> 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 <b><a href="./m2Lib.html#m2Init">m2Init</a>( )</b> and <b><a href="./m2Lib.html#m2Delete">m2Delete</a>( )</b>.<p>The system group provides the option to set the system variables at thetime <b>m2Sysinit( )</b> is called. The MIB-II variables <b>sysDescr</b> and <b>sysobjectId</b>are read-only, and can be set only by the system-group initialization routine.The variables <b>sysContact</b>, <b>sysName</b> and <b>sysLocation</b> can be set through<b><a href="./m2SysLib.html#m2SysGroupInfoSet">m2SysGroupInfoSet</a>( )</b> at any time.<p>The following is an example of system group initialization:<pre> 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 */</pre>The system group variables can be accessed as follows:<pre> M2_SYSTEM sysVars; if (m2SysGroupInfoGet (&sysVars) == OK) /* values in sysVars are valid */</pre>The system group variables can be set as follows:<pre> 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 */</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>m2Lib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><p><b><a href="./m2Lib.html#top">m2Lib</a></b>, <b><a href="./m2IfLib.html#top">m2IfLib</a></b>, <b><a href="./m2IpLib.html#top">m2IpLib</a></b>, <b><a href="./m2IcmpLib.html#top">m2IcmpLib</a></b>, <b><a href="./m2UdpLib.html#top">m2UdpLib</a></b>, <b><a href="./m2TcpLib.html#top">m2TcpLib</a></b><hr><a name="m2SysInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2SysInit( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2SysInit( )</strong> - initialize MIB-II system-group routines</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>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 */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine allocates the resources needed to allow access to thesystem-group MIB-II variables. This routine must be called beforeany system-group variables can be accessed. The input parameters<i>pMib2SysDescr</i>, <i>pMib2SysContact</i>, <i>pMib2SysLocation</i>, and<i>pObjectId</i> are optional. The parameters <i>pMib2SysDescr</i>,<i>pObjectId</i> are read only, as specified by MIB-II, and can be setonly by this routine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><b>S_m2Lib_CANT_CREATE_SYS_SEM</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2SysLib.html#top">m2SysLib</a></b>, <b><a href="./m2SysLib.html#m2SysGroupInfoGet">m2SysGroupInfoGet</a>( )</b>, <b><a href="./m2SysLib.html#m2SysGroupInfoSet">m2SysGroupInfoSet</a>( )</b>, <b><a href="./m2SysLib.html#m2SysDelete">m2SysDelete</a>( )</b><hr><a name="m2SysGroupInfoGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2SysGroupInfoGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2SysGroupInfoGet( )</strong> - get system-group MIB-II variables</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2SysGroupInfoGet ( M2_SYSTEM * pSysInfo /* pointer to MIB-II system group structure */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine fills in the structure at <i>pSysInfo</i> with the values of MIB-IIsystem-group variables.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if <i>pSysInfo</i> is not a valid pointer.<p></blockquote><h4>ERRNO</h4><blockquote><p><p><b>S_m2Lib_INVALID_PARAMETER</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2SysLib.html#top">m2SysLib</a></b>, <b><a href="./m2SysLib.html#m2SysInit">m2SysInit</a>( )</b>, <b><a href="./m2SysLib.html#m2SysGroupInfoSet">m2SysGroupInfoSet</a>( )</b>, <b><a href="./m2SysLib.html#m2SysDelete">m2SysDelete</a>( )</b><hr><a name="m2SysGroupInfoSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2SysGroupInfoSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2SysGroupInfoSet( )</strong> - set system-group MIB-II variables to new values</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2SysGroupInfoSet ( unsigned int varToSet, /* bit field of variables to set */ M2_SYSTEM * pSysInfo /* pointer to the system structure */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets one or more variables in the system group as specified inthe input structure at <i>pSysInfo</i> and the bit field parameter <i>varToSet</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if <i>pSysInfo</i> is not a valid pointer, or <i>varToSet</i> has an invalid bit field.<p></blockquote><h4>ERRNO</h4><blockquote><p><p> <b>S_m2Lib_INVALID_PARAMETER</b><br> <b>S_m2Lib_INVALID_VAR_TO_SET</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2SysLib.html#top">m2SysLib</a></b>, <b><a href="./m2SysLib.html#m2SysInit">m2SysInit</a>( )</b>, <b><a href="./m2SysLib.html#m2SysGroupInfoGet">m2SysGroupInfoGet</a>( )</b>, <b><a href="./m2SysLib.html#m2SysDelete">m2SysDelete</a>( )</b><hr><a name="m2SysDelete"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>m2SysDelete( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>m2SysDelete( )</strong> - delete resources used to access the MIB-II system group</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS m2SysDelete (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine frees all the resources allocated at the time the group wasinitialized. Do not access the system group after calling this routine.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, always.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./m2SysLib.html#top">m2SysLib</a></b>, <b><a href="./m2SysLib.html#m2SysInit">m2SysInit</a>( )</b>, <b><a href="./m2SysLib.html#m2SysGroupInfoGet">m2SysGroupInfoGet</a>( )</b>, <b><a href="./m2SysLib.html#m2SysGroupInfoSet">m2SysGroupInfoSet</a>( )</b>.</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -