snmp.c File Reference

Go to the source code of this file.

Functions

CONST uint8_tSnmpVarParse (CONST uint8_t *data, size_t *dlen, OID *name, size_t *nlen, uint8_t *type, uint8_t **value, size_t *vlen)
 Parse an SNMP variable.
uint8_tSnmpVarBuild (uint8_t *data, size_t *dlen, CONST OID *name, size_t nlen, uint8_t type, CONST uint8_t *value, size_t vlen)
 Build an SNMP variable.

Function Documentation

CONST uint8_t* SnmpVarParse ( CONST uint8_t data,
size_t *  dlen,
OID name,
size_t *  nlen,
uint8_t type,
uint8_t **  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.

uint8_t* SnmpVarBuild ( uint8_t data,
size_t *  dlen,
CONST OID name,
size_t  nlen,
uint8_t  type,
CONST uint8_t 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/