Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Core

Functions

void snmp_set_mibs (const struct snmp_mib **mibs, u8_t num_mibs)
 Sets the MIBs to use.
void snmp_set_device_enterprise_oid (const struct snmp_obj_id *device_enterprise_oid)
 'device enterprise oid' is used for 'device OID' field in trap PDU's (for identification of generating device) as well as for value returned by MIB-2 'sysObjectID' field (if internal MIB2 implementation is used).
struct snmp_obj_idsnmp_get_device_enterprise_oid (void)
 Get 'device enterprise oid'.
const char * snmp_get_community (void)
 Returns current SNMP community string.
void snmp_set_community (const char *const community)
 Sets SNMP community string.
const char * snmp_get_community_write (void)
 Returns current SNMP write-access community string.
void snmp_set_community_write (const char *const community)
 Sets SNMP community string for write-access.
void snmp_set_write_callback (snmp_write_callback_fct write_callback, void *callback_arg)
 Callback fired on every successful write access.
void snmp_init (void)
 Starts SNMP Agent.

Function Documentation

const char* snmp_get_community ( void   )

Returns current SNMP community string.

Returns:
current SNMP community string

Definition at line 75 of file lwip_snmp_msg.c.

const char* snmp_get_community_write ( void   )

Returns current SNMP write-access community string.

Returns:
current SNMP write-access community string

Definition at line 101 of file lwip_snmp_msg.c.

struct snmp_obj_id* snmp_get_device_enterprise_oid ( void   ) [read]

Get 'device enterprise oid'.

Definition at line 255 of file lwip_snmp_core.c.

void snmp_init ( void   )

Starts SNMP Agent.

Agent setup, start listening to port 161.

Allocates UDP pcb and binds it to IP_ANY_TYPE port 161.

Definition at line 86 of file lwip_snmp_raw.c.

void snmp_set_community ( const char *const   community )

Sets SNMP community string.

The string itself (its storage) must be valid throughout the whole life of program (or until it is changed to sth else).

Parameters:
communityis a pointer to new community string

Definition at line 89 of file lwip_snmp_msg.c.

void snmp_set_community_write ( const char *const   community )

Sets SNMP community string for write-access.

The string itself (its storage) must be valid throughout the whole life of program (or until it is changed to sth else).

Parameters:
communityis a pointer to new write-access community string

Definition at line 126 of file lwip_snmp_msg.c.

void snmp_set_device_enterprise_oid ( const struct snmp_obj_id device_enterprise_oid )

'device enterprise oid' is used for 'device OID' field in trap PDU's (for identification of generating device) as well as for value returned by MIB-2 'sysObjectID' field (if internal MIB2 implementation is used).

The 'device enterprise oid' shall point to an OID located under 'private-enterprises' branch (1.3.6.1.4.1.XXX). If a vendor wants to provide a custom object there, he has to get its own enterprise oid from IANA (http://www.iana.org). It is not allowed to use LWIP enterprise ID! In order to identify a specific device it is recommended to create a dedicated OID for each device type under its own enterprise oid. e.g. device a > 1.3.6.1.4.1.XXX(ent-oid).1(devices).1(device a) device b > 1.3.6.1.4.1.XXX(ent-oid).1(devices).2(device b) for more details see description of 'sysObjectID' field in RFC1213-MIB

Definition at line 242 of file lwip_snmp_core.c.

void snmp_set_mibs ( const struct snmp_mib **  mibs,
u8_t  num_mibs 
)

Sets the MIBs to use.

Example: call snmp_set_mibs() as follows: static const struct snmp_mib *my_snmp_mibs[] = { &mib2, &private_mib }; snmp_set_mibs(my_snmp_mibs, LWIP_ARRAYSIZE(my_snmp_mibs));

Definition at line 220 of file lwip_snmp_core.c.

void snmp_set_write_callback ( snmp_write_callback_fct  write_callback,
void *  callback_arg 
)

Callback fired on every successful write access.

Definition at line 153 of file lwip_snmp_msg.c.