VxWorks Reference Manual : Libraries
snmpBindLib - routines for binding values to variables in SNMP packets
SNMP_Bind_Unsigned_Integer( ) - bind an unsigned-integer variable
SNMP_Bind_Integer( ) - bind an integer variable
SNMP_Bind_IP_Address( ) - bind an IP address variable
SNMP_Bind_Object_ID( ) - bind an object-identifier variable
SNMP_Bind_String( ) - bind a string variable
SNMP_Bind_64_Unsigned_Integer( ) - bind a 64-bit unsigned-integer variable
SNMP_Bind_Null( ) - bind a null-valued variable
This module defines the routines used to bind variables to their respective values in an SNMP packet.
snmpdefs.h
SNMP_Bind_Unsigned_Integer( ) - bind an unsigned-integer variable
int SNMP_Bind_Unsigned_Integer ( SNMP_PKT_T * pktp, /* internal representation of snmp packet */ int index, /* index of varbind entry */ int compc, /* component count */ OIDC_T * compl, /* component length */ OCTET_T typeFlags, /* type flags */ UINT_32_T value /* value for varbind */ )
This routine binds an unsigned-integer variable in the variable-binding list of an SNMP packet structure.
pktp references the packet structure.
index is a zero-based index indicating which variable-binding entry is to be used.
compc and compl are the component count and components, respectively, of the object identifier of the variable being bound.
typeFlags is one of the following manifest constants: VT_COUNTER, VT_GAUGE or VT_TIMETICKS.
value is the unsigned-integer value to be bound.
Macro forms of this procedure may be more convenient: SNMP_Bind_Gauge( ), SNMP_Bind_Timeticks( ), and SNMP_Bind_Counter( ).
0 if successful, otherwise -1.
SNMP_Bind_Integer( ) - bind an integer variable
int SNMP_Bind_Integer ( SNMP_PKT_T * pktp, /* internal representation of snmp packet */ int index, /* index of varbind entry */ int compc, /* component count */ OIDC_T * compl, /* component length */ INT_32_T value /* value for varbind */ )
This routine binds an integer variable in the variable-binding list of an SNMP packet structure.
Parameter pktp references the packet structure.
index is a zero-based index indicating which variable-binding entry is to be used.
compc and compl are the component count and components, respectively, of the object identifier of the variable being bound.
value is the integer value to be bound.
0 if successful, otherwise -1.
SNMP_Bind_IP_Address( ) - bind an IP address variable
int SNMP_Bind_IP_Address ( SNMP_PKT_T * pktp, /* internal representation of snmp packet */ int index, /* index of varbind entry */ int compc, /* component count */ OIDC_T * compl, /* component length */ OCTET_T * pIpAddr /* ip address */ )
This routine binds an IP address variable in the variable-binding list of an SNMP packet structure
Parameter pktp references the packet structure.
index is a zero-based index indicating which variable-binding entry is to be used.
compc and compl are the component count and components, respectively, of the object identifier of the variable being bound.
pIpAddr is a pointer to a four-byte area containing the IP address to be bound.
The four bytes contain the network address in standard TCP/IP network-byte order.
0 if successful, otherwise -1.
SNMP_Bind_Object_ID( ) - bind an object-identifier variable
int SNMP_Bind_Object_ID ( SNMP_PKT_T * pktp, /* internal representation of snmp packet */ int index, /* index of varbind entry */ int compc, /* component count */ OIDC_T * compl, /* component length */ int valc, /* varbind value count */ OIDC_T * vall /* varbind value length */ )
This routine binds an object-identifier variable in the variable-binding list of an SNMP packet structure.
Parameter pktp references the packet structure.
index is a zero-based index indicating which variable-binding entry is to be used.
compc and compl are the component count and components, respectively, of the object identifier of the variable being bound.
valc and vall are the component count and components, respectively, of the value being bound.
0 if successful, otherwise -1.
SNMP_Bind_String( ) - bind a string variable
int SNMP_Bind_String ( SNMP_PKT_T * pktp, /* internal representation of snmp packet */ int index, /* index of varbind entry */ int compc, /* component count */ OIDC_T * compl, /* component length */ OCTET_T typeFlags, /* type flags */ int leng, /* string length */ OCTET_T * strp, /* pointer to string */ int statflg /* static memory flag */ )
This routine binds an octet-string variable in the variable-binding list of an SNMP packet structure.
Parameter pktp references the packet structure.
index is a zero-based index indicating which variable-binding entry is to be used.
compc and compl are the component count and components, respectively, of the object identifier of the variable being bound.
typeFlags is one of the following manifest constants: VT_STRING or VT_OPAQUE.
leng and strp are the length and address, respectively, of the string to be bound.
statflg indicates whether the string must be copied or whether it may be used in its current location. A value of 0 means copy, 1 means "use as is".
A macro form of this routine may be more convenient: SNMP_Bind_Opaque( ).
0 if successful, otherwise -1.
SNMP_Bind_64_Unsigned_Integer( ) - bind a 64-bit unsigned-integer variable
int SNMP_Bind_64_Unsigned_Integer ( SNMP_PKT_T * pktp, /* internal representation of snmp packet */ int index, /* index of varbind entry */ int compc, /* component count */ OIDC_T * compl, /* component length */ OCTET_T typeFlags, /* type flags */ UINT_32_T high, /* high 32 bits of value */ UINT_32_T low /* low 32 bits of value */ )
This routine binds a 64-bit unsigned-integer variable in the variable-binding list of an SNMP packet structure.
Parameter pktp references the packet structure.
index is a zero-based index indicating which variable-binding entry is to be used.
compc and compl are the component count and components, respectively, of the object identifier of the variable being bound.
typeFlags is the manifest constant VT_COUNTER64.
high and low are the high and low 32-bit sections of the 64-bit value to
be bound.A macro form of this procedure may be more convenient: SNMP_Bind_Counter64( ).
0 if successful, otherwise -1.
SNMP_Bind_Null( ) - bind a null-valued variable
int SNMP_Bind_Null ( SNMP_PKT_T * pktp, /* internal representation of snmp packet */ int index, /* index of varbind entry */ int compc, /* component count */ OIDC_T * compl /* component length */ )
This routine binds a null-valued variable in the variable-binding list of an SNMP packet structure.
Parameter pktp references the packet structure.
index is a zero-based index indicating which variable-binding entry is to be used.
compc and compl are the component count and components, respectively, of the object identifier of the variable being bound.
0 if successful, otherwise -1.