Contiki-NG
Macros | Typedefs | Functions

This group contains all the functions that can be used outside the OS level. More...

Macros

#define OID(name, ...)   static uint32_t name[] = { __VA_ARGS__, -1 };
 Initializes statically an oid with the "null" terminator. More...
 
#define MIB_RESOURCE(name, handler, ...)
 Declare a MIB resource. 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

void snmp_api_set_string (snmp_varbind_t *varbind, uint32_t *oid, char *string)
 Function to set a varbind with a string. More...
 
void snmp_api_set_time_ticks (snmp_varbind_t *varbind, uint32_t *oid, uint32_t integer)
 Function to set a varbind with a time tick. More...
 
void snmp_api_set_oid (snmp_varbind_t *varbind, uint32_t *oid, uint32_t *ret_oid)
 Function to set a varbind with a oid. More...
 
void snmp_api_add_resource (snmp_mib_resource_t *new_resource)
 Function to add a new resource. More...
 

Detailed Description

This group contains all the functions that can be used outside the OS level.

The function outside this header can be changed without notice

Macro Definition Documentation

◆ MIB_RESOURCE

#define MIB_RESOURCE (   name,
  handler,
  ... 
)
Value:
uint32_t name##_oid[] = { __VA_ARGS__, -1 }; \
snmp_mib_resource_t name = { NULL, name##_oid, handler };

Declare a MIB resource.

Parameters
nameA name for the MIB resource
handlerThe handler function for this resource
...The OID (comma-separated)

Definition at line 90 of file snmp-api.h.

◆ OID

#define OID (   name,
  ... 
)    static uint32_t name[] = { __VA_ARGS__, -1 };

Initializes statically an oid with the "null" terminator.

Remarks
This should be used inside handlers when declaring an oid
Parameters
nameA name for the oid
...The Oid (comma-separeted)

Definition at line 80 of file snmp-api.h.

Typedef Documentation

◆ snmp_mib_resource_handler_t

typedef void(* snmp_mib_resource_handler_t) (snmp_varbind_t *varbind, uint32_t *oid)

The MIB resource handler typedef.

Parameters
varbindThe varbind that is being changed
oidThe oid from the resource

Definition at line 65 of file snmp-api.h.

Function Documentation

◆ snmp_api_add_resource()

void snmp_api_add_resource ( snmp_mib_resource_t new_resource)

Function to add a new resource.

Parameters
new_resourceThe resource

Definition at line 90 of file snmp-api.c.

References snmp_mib_add().

◆ snmp_api_set_oid()

void snmp_api_set_oid ( snmp_varbind_t varbind,
uint32_t *  oid,
uint32_t *  ret_oid 
)

Function to set a varbind with a oid.

This function should be used inside a handler to set the varbind correctly

Parameters
varbindThe varbind from the handler
oidThe oid from the handler
ret_oidThe oid value

Definition at line 81 of file snmp-api.c.

◆ snmp_api_set_string()

void snmp_api_set_string ( snmp_varbind_t varbind,
uint32_t *  oid,
char *  string 
)

Function to set a varbind with a string.

This function should be used inside a handler to set the varbind correctly

Parameters
varbindThe varbind from the handler
oidThe oid from the handler
stringThe string

Definition at line 62 of file snmp-api.c.

◆ snmp_api_set_time_ticks()

void snmp_api_set_time_ticks ( snmp_varbind_t varbind,
uint32_t *  oid,
uint32_t  integer 
)

Function to set a varbind with a time tick.

This function should be used inside a handler to set the varbind correctly

Parameters
varbindThe varbind from the handler
oidThe oid from the handler
integerThe time tick value

Definition at line 72 of file snmp-api.c.