tfAddCommunity

Jump to: navigation, search

Table of Contents >> SNMP Programmer's Reference


#include <trapi.h>


int tfAddCommunity (
int which,
ttCharPtr community
);


Function Description

This function lets the user add a community string to the list of communities. By default, when the agent starts, if either community pool is empty, the agent is initialized with one default READ community and one default WRITE community. Maximum length of the community string in each pool is set as TM_SNMP_MAX_COMMUNITY_LEN.

Note Note: If using the SNMP agent in trilingual mode, the communities are handled in the community table, which is part of the SNMPv3 framework. In trilingual mode do not use this API, use tfAddCommunityTableEntry().


Parameters

  • which
    Community flag, either TM_READ_COMMUNITY_FLAG or TM_WRITE_COMMUNITY_FLAG.
  • community
    Community string.


Returns

  • TM_ENOERROR
    Success.
  • TM_NOMORE_COMMUNITIES
    Failure, communities list is full.
  • TM_UNKNOWN_COMMUNITY_FLAG
    Failure, which value is not defined.
  • TM_COMMUNITY_TOOLONG
    Failure, community is too long.
  • TM_ALLOCATION_ERROR
    Failure to allocate memory for the agent global variables.
  • TM_COMMUNITY_NOT_PRINTABLE
    Failure, community contains unprintable characters.


Table of Contents >> SNMP Programmer's Reference