SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-72
SNMPSET
Example 2-9. Contents of snmpsetc (page 1 of 9)
#include <stdio.h> nolist
#include <ctype.h> nolist
#include <asn1.h> nolist
#include <localio.h> nolist
#include <buffer.h> nolist
#include <objectid.h> nolist
#include <snmp.h> nolist
#include <snmpstat.h> nolist
#include <buildpkt.h> nolist
#include <print.h> nolist
#include <talh> nolist
#include <errno.h> nolist
#include <systype.h> nolist
#include <socket.h> nolist
#include <netdb.h> nolist
#include <in.h> nolist
#include "snmpfs.h" nolist
#ifdef __TANDEM
#include <cextdecs(FILE_OPEN_, AWAITIOX)> nolist
#else
#include <grdapi.h>
#endif
#define MAXOIDS 16
#define INVALID_HOST_ADDR 0XFFFFFFFFl
#define MAX_REQID_VALUE 0x7fffffff
SNMP_STATS_T snmp_stats;
OIDC_T base_component_list[MAX_OID_COUNT];
OBJ_ID_T base_oid = { MAX_OID_COUNT, base_component_list };
OIDC_T val_component_list[MAX_OID_COUNT]; <--1
OBJ_ID_T val_oid = { MAX_OID_COUNT, val_component_list };
char usage[] = "Usage: %s [-a snmpagtname] [-c community] [-i requestid] "
"[-l] [-p port] [-r retrycnt] [-t timeout] [-x debuglevel] host "
"name [type] value [name [type] value] ...\n";
int
main(int argc, char** argv)
{
char *buffp; <--2
char *community = "public";
short debug_level = -1;
int dest_port = SNMP_REQUEST_PORT;
char opt;
EBUFFER_T ebuff;