lwIP
2.1.0
Lightweight IP stack
|
#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp.h"
#include "lwip/apps/snmp_core.h"
#include "snmp_core_priv.h"
#include "lwip/netif.h"
#include <string.h>
#include "lwip/apps/snmp_mib2.h"
Functions | |
void | snmp_set_mibs (const struct snmp_mib **mibs, u8_t num_mibs) |
void | snmp_set_device_enterprise_oid (const struct snmp_obj_id *device_enterprise_oid) |
const struct snmp_obj_id * | snmp_get_device_enterprise_oid (void) |
u8_t | snmp_oid_to_ip4 (const u32_t *oid, ip4_addr_t *ip) |
void | snmp_ip4_to_oid (const ip4_addr_t *ip, u32_t *oid) |
u8_t | snmp_oid_to_ip6 (const u32_t *oid, ip6_addr_t *ip) |
void | snmp_ip6_to_oid (const ip6_addr_t *ip, u32_t *oid) |
u8_t | snmp_ip_port_to_oid (const ip_addr_t *ip, u16_t port, u32_t *oid) |
u8_t | snmp_ip_to_oid (const ip_addr_t *ip, u32_t *oid) |
u8_t | snmp_oid_to_ip (const u32_t *oid, u8_t oid_len, ip_addr_t *ip) |
u8_t | snmp_oid_to_ip_port (const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port) |
void | snmp_oid_assign (struct snmp_obj_id *target, const u32_t *oid, u8_t oid_len) |
void | snmp_oid_prefix (struct snmp_obj_id *target, const u32_t *oid, u8_t oid_len) |
void | snmp_oid_combine (struct snmp_obj_id *target, const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len) |
void | snmp_oid_append (struct snmp_obj_id *target, const u32_t *oid, u8_t oid_len) |
s8_t | snmp_oid_compare (const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len) |
u8_t | snmp_oid_equal (const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len) |
u8_t | netif_to_num (const struct netif *netif) |
const struct snmp_node * | snmp_mib_tree_resolve_exact (const struct snmp_mib *mib, const u32_t *oid, u8_t oid_len, u8_t *oid_instance_len) |
void | snmp_next_oid_init (struct snmp_next_oid_state *state, const u32_t *start_oid, u8_t start_oid_len, u32_t *next_oid_buf, u8_t next_oid_max_len) |
u8_t | snmp_next_oid_precheck (struct snmp_next_oid_state *state, const u32_t *oid, u8_t oid_len) |
u8_t | snmp_next_oid_check (struct snmp_next_oid_state *state, const u32_t *oid, u8_t oid_len, void *reference) |
u8_t | snmp_oid_in_range (const u32_t *oid_in, u8_t oid_len, const struct snmp_oid_range *oid_ranges, u8_t oid_ranges_len) |
err_t | snmp_decode_bits (const u8_t *buf, u32_t buf_len, u32_t *bit_value) |
u8_t | snmp_encode_bits (u8_t *buf, u32_t buf_len, u32_t bit_value, u8_t bit_count) |
MIB tree access/construction functions.
u8_t netif_to_num | ( | const struct netif * | netif | ) |
Convert netif to interface index
netif | netif |
err_t snmp_decode_bits | ( | const u8_t * | buf, |
u32_t | buf_len, | ||
u32_t * | bit_value | ||
) |
Decodes BITS pseudotype value from ASN.1 OctetString.
buf | points to a buffer holding the ASN1 octet string |
buf_len | length of octet string |
bit_value | decoded Bit value with Bit0 == LSB |
u8_t snmp_encode_bits | ( | u8_t * | buf, |
u32_t | buf_len, | ||
u32_t | bit_value, | ||
u8_t | bit_count | ||
) |
Encodes BITS pseudotype value into ASN.1 OctetString.
buf | points to a buffer where the resulting ASN1 octet string is stored to |
buf_len | max length of the bufffer |
bit_value | Bit value to encode with Bit0 == LSB |
bit_count | Number of possible bits for the bit value (according to rfc we have to send all bits independant from their truth value) |
void snmp_ip4_to_oid | ( | const ip4_addr_t * | ip, |
u32_t * | oid | ||
) |
Convert ip4_addr to InetAddressIPv4 (no InetAddressType)
ip | points to input struct |
oid | points to u32_t ident[4] output |
void snmp_ip6_to_oid | ( | const ip6_addr_t * | ip, |
u32_t * | oid | ||
) |
Convert ip6_addr to InetAddressIPv6 (no InetAddressType)
ip | points to input struct |
oid | points to u32_t ident[16] output |
u8_t snmp_ip_port_to_oid | ( | const ip_addr_t * | ip, |
u16_t | port, | ||
u32_t * | oid | ||
) |
Convert to InetAddressType+InetAddress+InetPortNumber
ip | IP address |
port | Port |
oid | OID |
u8_t snmp_ip_to_oid | ( | const ip_addr_t * | ip, |
u32_t * | oid | ||
) |
Convert to InetAddressType+InetAddress
ip | IP address |
oid | OID |
const struct snmp_node* snmp_mib_tree_resolve_exact | ( | const struct snmp_mib * | mib, |
const u32_t * | oid, | ||
u8_t | oid_len, | ||
u8_t * | oid_instance_len | ||
) |
Searches tree for the supplied object identifier.
u8_t snmp_next_oid_check | ( | struct snmp_next_oid_state * | state, |
const u32_t * | oid, | ||
u8_t | oid_len, | ||
void * | reference | ||
) |
checks the passed OID if it is a candidate to be the next one (get_next); returns !=0 if passed oid is currently closest, otherwise 0
void snmp_next_oid_init | ( | struct snmp_next_oid_state * | state, |
const u32_t * | start_oid, | ||
u8_t | start_oid_len, | ||
u32_t * | next_oid_buf, | ||
u8_t | next_oid_max_len | ||
) |
initialize struct next_oid_state using this function before passing it to next_oid_check
u8_t snmp_next_oid_precheck | ( | struct snmp_next_oid_state * | state, |
const u32_t * | oid, | ||
u8_t | oid_len | ||
) |
checks if the passed incomplete OID may be a possible candidate for snmp_next_oid_check(); this methid is intended if the complete OID is not yet known but it is very expensive to build it up, so it is possible to test the starting part before building up the complete oid and pass it to snmp_next_oid_check()
void snmp_oid_append | ( | struct snmp_obj_id * | target, |
const u32_t * | oid, | ||
u8_t | oid_len | ||
) |
Append OIDs to struct snmp_obj_id
target | Assignment target to append to |
oid | OID |
oid_len | OID length |
void snmp_oid_assign | ( | struct snmp_obj_id * | target, |
const u32_t * | oid, | ||
u8_t | oid_len | ||
) |
Assign an OID to struct snmp_obj_id
target | Assignment target |
oid | OID |
oid_len | OID length |
void snmp_oid_combine | ( | struct snmp_obj_id * | target, |
const u32_t * | oid1, | ||
u8_t | oid1_len, | ||
const u32_t * | oid2, | ||
u8_t | oid2_len | ||
) |
Combine two OIDs into struct snmp_obj_id
target | Assignmet target |
oid1 | OID 1 |
oid1_len | OID 1 length |
oid2 | OID 2 |
oid2_len | OID 2 length |
s8_t snmp_oid_compare | ( | const u32_t * | oid1, |
u8_t | oid1_len, | ||
const u32_t * | oid2, | ||
u8_t | oid2_len | ||
) |
Compare two OIDs
oid1 | OID 1 |
oid1_len | OID 1 length |
oid2 | OID 2 |
oid2_len | OID 2 length |
u8_t snmp_oid_equal | ( | const u32_t * | oid1, |
u8_t | oid1_len, | ||
const u32_t * | oid2, | ||
u8_t | oid2_len | ||
) |
Check of two OIDs are equal
oid1 | OID 1 |
oid1_len | OID 1 length |
oid2 | OID 2 |
oid2_len | OID 2 length |
u8_t snmp_oid_in_range | ( | const u32_t * | oid_in, |
u8_t | oid_len, | ||
const struct snmp_oid_range * | oid_ranges, | ||
u8_t | oid_ranges_len | ||
) |
checks if incoming OID length and values are in allowed ranges
void snmp_oid_prefix | ( | struct snmp_obj_id * | target, |
const u32_t * | oid, | ||
u8_t | oid_len | ||
) |
Prefix an OID to OID in struct snmp_obj_id
target | Assignment target to prefix |
oid | OID |
oid_len | OID length |
u8_t snmp_oid_to_ip | ( | const u32_t * | oid, |
u8_t | oid_len, | ||
ip_addr_t * | ip | ||
) |
Convert from InetAddressType+InetAddress to ip_addr_t
oid | OID |
oid_len | OID length |
ip | IP address |
u8_t snmp_oid_to_ip4 | ( | const u32_t * | oid, |
ip4_addr_t * | ip | ||
) |
Conversion from InetAddressIPv4 oid to lwIP ip4_addr
oid | points to u32_t ident[4] input |
ip | points to output struct |
u8_t snmp_oid_to_ip6 | ( | const u32_t * | oid, |
ip6_addr_t * | ip | ||
) |
Conversion from InetAddressIPv6 oid to lwIP ip6_addr
oid | points to u32_t oid[16] input |
ip | points to output struct |
u8_t snmp_oid_to_ip_port | ( | const u32_t * | oid, |
u8_t | oid_len, | ||
ip_addr_t * | ip, | ||
u16_t * | port | ||
) |
Convert from InetAddressType+InetAddress+InetPortNumber to ip_addr_t and u16_t
oid | OID |
oid_len | OID length |
ip | IP address |
port | Port |