tfSnmpdMain

Jump to: navigation, search

Table of Contents >> SNMP Programmer's Reference


#include <trapi.h>


int tfSnmpdMain (
int blockingState,
ttUser32Bit flags
);


Function Description

This function is called to initialize and start the SNMP Agent. The SNMP Agent may be ran in either blocking or non-blocking mode, specified using the blockingState parameter. If non-blocking mode is selected, then tfSnmpdMain() initializes the Agent and returns, and all processing of received SNMP messages occurs later in the context of a socket callback function. If blocking mode is selected, tfSnmpdMain() does not return, but instead loops making a blocking select call on the SNMP socket waiting for SNMP messages to be received, and processes them in the context of tfSnmpdMain(). Choose blocking mode if you are using a RTOS/Kernel and prefer to run the SNMP Agent as a separate task. Choose non-blocking mode if you do have a RTOS/Kernel.


Parameters

  • blockingState
    The flag taking on values TM_BLOCKING_OFF or TM_BLOCKING_ON.
  • flags
    Flag parameter. Currently not used.


Returns

  • TM_ENOERROR
    No error.
  • 1
    Not able to allocate the global struct tvSnmpdPtr
  • 2
    Failed to initialize the agent.
  • 3
    Non-blocking mode requires Treck TCP.
  • Other
    All return codes for tfRegisterSocketCB() are also valid for this function.


Table of Contents >> SNMP Programmer's Reference