snmp.c File Reference

Go to the source code of this file.

Functions

CONST u_charSnmpVarParse (CONST u_char *data, size_t *dlen, OID *name, size_t *nlen, u_char *type, u_char **value, size_t *vlen)
 Parse an SNMP variable.
u_charSnmpVarBuild (u_char *data, size_t *dlen, CONST OID *name, size_t nlen, u_char type, CONST u_char *value, size_t vlen)
 Build an SNMP variable.


Function Documentation

CONST u_char* SnmpVarParse ( CONST u_char data,
size_t *  dlen,
OID name,
size_t *  nlen,
u_char type,
u_char **  value,
size_t *  vlen 
)

Parse an SNMP variable.

Parameters:
data Pointer to start of the name/value pair.
dlen Contains the number of valid bytes following the start of the variable. On exit, it is returned as the number of valid bytes following the end of this variable.
name Pointer to a buffer that receives the name (OID).
nlen On entry, this contains the maximum number of sub IDs accepted for the name. On exit, it is returned as the actual number sub IDs found in the name.
type Pointer to the variable that receives the ASN type of the value.
value Pointer to variable that receives a pointer to the ASN1 encoded value of variable.
vlen Pointer to the variable that receives the length of the value.
Returns:
Pointer to the first byte past the end of this name/value pair. Returns NULL on any error.

Definition at line 60 of file snmp.c.

References ASN_CONSTRUCTOR, ASN_OBJECT_ID, ASN_PRIMITIVE, ASN_SEQUENCE, ASN_UNIVERSAL, AsnHeaderParse(), AsnOidParse(), AsnSequenceParse(), and CONST.

u_char* SnmpVarBuild ( u_char data,
size_t *  dlen,
CONST OID name,
size_t  nlen,
u_char  type,
CONST u_char value,
size_t  vlen 
)

Build an SNMP variable.

Parameters:
data Pointer to start of the output buffer.
dlen Contains the number of valid bytes following the start of the variable. On exit, it is returned as the number of valid bytes following the end of this variable.
name Name (OID).
nlen Number of sub IDs of the name.
type ASN type of the value.
value Pointer to the value.
vlen Length of the value.
Returns:
Pointer to the first byte past the end of this name/value pair. Returns NULL on any error.

Definition at line 109 of file snmp.c.

References ASN_BIT_STR, ASN_CONSTRUCTOR, ASN_COUNTER, ASN_COUNTER64, ASN_GAUGE, ASN_INTEGER, ASN_IPADDRESS, ASN_NSAP, ASN_NULL, ASN_OBJECT_ID, ASN_OCTET_STR, ASN_OPAQUE, ASN_PRIMITIVE, ASN_SEQUENCE, ASN_TIMETICKS, ASN_UINTEGER, ASN_UNIVERSAL, AsnBitStringBuild(), AsnIntegerBuild(), AsnNullBuild(), AsnOctetStringBuild(), AsnOidBuild(), AsnSequenceBuild(), AsnUnsigned64Build(), AsnUnsignedBuild(), SNMP_ENDOFMIBVIEW, SNMP_NOSUCHINSTANCE, SNMP_NOSUCHOBJECT, SNMP_STAT_OUTBADVALUES, SNMP_STAT_OUTTOOBIGS, and SnmpStatsInc().


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/