Contiki-NG
|
This is an implementation of the Simple Network Management Protocol. More...
Modules | |
SNMP Configurable Defines | |
SNMP Defines | |
SNMP Functions | |
SNMP Structs | |
This is the SNMP Public API | |
This group contains all the functions that can be used outside the OS level. | |
Data Structures | |
struct | snmp_mib_resource_s |
The MIB Resource struct. More... | |
Typedefs | |
typedef void(* | snmp_mib_resource_handler_t) (snmp_varbind_t *varbind, uint32_t *oid) |
The MIB resource handler typedef. More... | |
typedef struct snmp_mib_resource_s | snmp_mib_resource_t |
The MIB Resource struct. | |
Functions | |
unsigned char * | snmp_ber_encode_type (unsigned char *out, uint32_t *out_len, uint8_t type) |
Encodes a type. More... | |
unsigned char * | snmp_ber_encode_length (unsigned char *out, uint32_t *out_len, uint8_t length) |
Encodes the length. More... | |
unsigned char * | snmp_ber_encode_integer (unsigned char *out, uint32_t *out_len, uint32_t integer) |
Encodes an integer. More... | |
unsigned char * | snmp_ber_encode_unsigned_integer (unsigned char *out, uint32_t *out_len, uint8_t type, uint32_t number) |
Encodes an unsigned integer. More... | |
unsigned char * | snmp_ber_encode_string_len (unsigned char *out, uint32_t *out_len, const char *str, uint32_t length) |
Encodes a string. More... | |
unsigned char * | snmp_ber_encode_null (unsigned char *out, uint32_t *out_len, uint8_t type) |
Encodes a null. More... | |
unsigned char * | snmp_ber_decode_type (unsigned char *buff, uint32_t *buff_len, uint8_t *type) |
Decodes a type. More... | |
unsigned char * | snmp_ber_decode_length (unsigned char *buff, uint32_t *buff_len, uint8_t *length) |
Decodes a length. More... | |
unsigned char * | snmp_ber_decode_integer (unsigned char *buff, uint32_t *buff_len, uint32_t *integer) |
Decodes an integer. More... | |
unsigned char * | snmp_ber_decode_unsigned_integer (unsigned char *buff, uint32_t *buff_len, uint8_t expected_type, uint32_t *number) |
Decodes an unsigned number. More... | |
unsigned char * | snmp_ber_decode_string_len_buffer (unsigned char *buff, uint32_t *buff_len, const char **str, uint32_t *length) |
Decodes a string. More... | |
unsigned char * | snmp_ber_decode_null (unsigned char *buff, uint32_t *buff_len) |
Decodes a null. More... | |
unsigned char * | snmp_engine (unsigned char *buff, uint32_t buff_len, unsigned char *out, uint32_t *out_len) |
Process the SNMP packet and prepares the response. More... | |
unsigned char * | snmp_message_encode (unsigned char *out, uint32_t *out_len, snmp_header_t *header, snmp_varbind_t *varbinds, uint32_t varbinds_length) |
Encodes a SNMP message. More... | |
uint8_t * | snmp_message_decode (uint8_t *buf, uint32_t buf_len, snmp_header_t *header, snmp_varbind_t *varbinds, uint32_t *varbinds_length) |
snmp_mib_resource_t * | snmp_mib_find (uint32_t *oid) |
Finds the MIB Resource for this OID. More... | |
snmp_mib_resource_t * | snmp_mib_find_next (uint32_t *oid) |
Finds the next MIB Resource after this OID. More... | |
void | snmp_mib_add (snmp_mib_resource_t *resource) |
Adds a resource into the linked list. More... | |
void | snmp_mib_init (void) |
Initialize the MIB resources list. | |
int | snmp_oid_cmp_oid (uint32_t *oid1, uint32_t *oid2) |
Compares to oids. More... | |
unsigned char * | snmp_oid_encode_oid (unsigned char *out, uint32_t *out_len, uint32_t *oid) |
Encodes a Oid. More... | |
unsigned char * | snmp_oid_decode_oid (unsigned char *buf, uint32_t *buf_len, uint32_t *oid, uint32_t *oid_len) |
Decodes a Oid. More... | |
void | snmp_oid_copy (uint32_t *dst, uint32_t *src) |
Copies a Oid. More... | |
void | snmp_oid_print (uint32_t *oid) |
Prints a oid. More... | |
This is an implementation of the Simple Network Management Protocol.
typedef void(* snmp_mib_resource_handler_t) (snmp_varbind_t *varbind, uint32_t *oid) |
The MIB resource handler typedef.
varbind | The varbind that is being changed |
oid | The oid from the resource |
Definition at line 56 of file snmp-mib.h.
unsigned char* snmp_ber_decode_integer | ( | unsigned char * | buff, |
uint32_t * | buff_len, | ||
uint32_t * | integer | ||
) |
Decodes an integer.
buff | A pointer to the beginning of the buffer |
buff_len | A pointer to the buffer length |
integer | A pointer to the integer |
Definition at line 147 of file snmp-ber.c.
unsigned char* snmp_ber_decode_length | ( | unsigned char * | buff, |
uint32_t * | buff_len, | ||
uint8_t * | length | ||
) |
Decodes a length.
buff | A pointer to the beginning of the buffer |
buff_len | A pointer to the buffer length |
length | A pointer to the length |
Definition at line 138 of file snmp-ber.c.
unsigned char* snmp_ber_decode_null | ( | unsigned char * | buff, |
uint32_t * | buff_len | ||
) |
Decodes a null.
buff | A pointer to the beginning of the buffer |
buff_len | A pointer to the buffer length |
Definition at line 264 of file snmp-ber.c.
unsigned char* snmp_ber_decode_string_len_buffer | ( | unsigned char * | buff, |
uint32_t * | buff_len, | ||
const char ** | str, | ||
uint32_t * | length | ||
) |
Decodes a string.
buff | A pointer to the beginning of the buffer |
buff_len | A pointer to the buffer length |
str | A pointer to the string |
length | A pointer to the string length |
Definition at line 219 of file snmp-ber.c.
unsigned char* snmp_ber_decode_type | ( | unsigned char * | buff, |
uint32_t * | buff_len, | ||
uint8_t * | type | ||
) |
Decodes a type.
buff | A pointer to the beginning of the buffer |
buff_len | A pointer to the buffer length |
type | A pointer to the type |
Definition at line 129 of file snmp-ber.c.
unsigned char* snmp_ber_decode_unsigned_integer | ( | unsigned char * | buff, |
uint32_t * | buff_len, | ||
uint8_t | expected_type, | ||
uint32_t * | number | ||
) |
Decodes an unsigned number.
buff | A pointer to the beginning of the buffer |
buff_len | A pointer to the buffer length |
expected_type | The expected type that represents an unsingned integer |
number | A pointer to the number |
Definition at line 183 of file snmp-ber.c.
unsigned char* snmp_ber_encode_integer | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
uint32_t | integer | ||
) |
Encodes an integer.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
integer | A integer |
Definition at line 66 of file snmp-ber.c.
unsigned char* snmp_ber_encode_length | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
uint8_t | length | ||
) |
Encodes the length.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
length | A length |
Definition at line 58 of file snmp-ber.c.
unsigned char* snmp_ber_encode_null | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
uint8_t | type | ||
) |
Encodes a null.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
type | A type |
Definition at line 119 of file snmp-ber.c.
unsigned char* snmp_ber_encode_string_len | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
const char * | str, | ||
uint32_t | length | ||
) |
Encodes a string.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
str | A string |
length | The string length |
Definition at line 102 of file snmp-ber.c.
unsigned char* snmp_ber_encode_type | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
uint8_t | type | ||
) |
Encodes a type.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
type | A type |
Definition at line 50 of file snmp-ber.c.
unsigned char* snmp_ber_encode_unsigned_integer | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
uint8_t | type, | ||
uint32_t | number | ||
) |
Encodes an unsigned integer.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
type | A type that represents an unsigned integer |
number | A number |
Definition at line 84 of file snmp-ber.c.
unsigned char* snmp_engine | ( | unsigned char * | buff, |
uint32_t | buff_len, | ||
unsigned char * | out, | ||
uint32_t * | out_len | ||
) |
Process the SNMP packet and prepares the response.
buff | A pointer to the beginning of the packet buffer |
buff_len | The packet length |
out | A pointer to the end of the response buffer |
out_len | A pointer to the length of the response buffer |
Definition at line 205 of file snmp-engine.c.
uint8_t* snmp_message_decode | ( | uint8_t * | buf, |
uint32_t | buf_len, | ||
snmp_header_t * | header, | ||
snmp_varbind_t * | varbinds, | ||
uint32_t * | varbinds_length | ||
) |
buf | A pointer to the beginning of the buffer |
buf_len | A pointer to the buffer length |
header | The SNMP header struct |
varbinds | The varbinds array |
varbinds_length | A pointer to the number of varbinds |
Definition at line 114 of file snmp-message.c.
unsigned char* snmp_message_encode | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
snmp_header_t * | header, | ||
snmp_varbind_t * | varbinds, | ||
uint32_t | varbinds_length | ||
) |
Encodes a SNMP message.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
header | The SNMP header struct |
varbinds | The varbinds array |
varbinds_length | The number of varbinds |
Definition at line 50 of file snmp-message.c.
void snmp_mib_add | ( | snmp_mib_resource_t * | resource | ) |
Adds a resource into the linked list.
resource | The resource |
Definition at line 84 of file snmp-mib.c.
References list_head(), snmp_mib_resource_s::next, snmp_mib_resource_s::oid, and snmp_oid_cmp_oid().
Referenced by snmp_api_add_resource().
snmp_mib_resource_t* snmp_mib_find | ( | uint32_t * | oid | ) |
Finds the MIB Resource for this OID.
oid | The OID |
Definition at line 52 of file snmp-mib.c.
snmp_mib_resource_t* snmp_mib_find_next | ( | uint32_t * | oid | ) |
Finds the next MIB Resource after this OID.
oid | The OID |
Definition at line 68 of file snmp-mib.c.
int snmp_oid_cmp_oid | ( | uint32_t * | oid1, |
uint32_t * | oid2 | ||
) |
Compares to oids.
oid1 | First Oid |
oid2 | Second Oid |
Definition at line 50 of file snmp-oid.c.
Referenced by snmp_mib_add().
void snmp_oid_copy | ( | uint32_t * | dst, |
uint32_t * | src | ||
) |
Copies a Oid.
dst | A pointer to the destination array |
src | A pointer to the source array |
Definition at line 185 of file snmp-oid.c.
unsigned char* snmp_oid_decode_oid | ( | unsigned char * | buf, |
uint32_t * | buf_len, | ||
uint32_t * | oid, | ||
uint32_t * | oid_len | ||
) |
Decodes a Oid.
buf | A pointer to the beginning of the buffer |
buf_len | A pointer to the buffer length |
oid | A pointer to the oid array |
oid_len | A pointer to the oid length |
Definition at line 126 of file snmp-oid.c.
unsigned char* snmp_oid_encode_oid | ( | unsigned char * | out, |
uint32_t * | out_len, | ||
uint32_t * | oid | ||
) |
Encodes a Oid.
out | A pointer to the end of the buffer |
out_len | A pointer to the buffer length |
oid | The Oid |
Definition at line 80 of file snmp-oid.c.
void snmp_oid_print | ( | uint32_t * | oid | ) |