Main Page | Data Structures | File List | Globals

libgu/gu_snmp.c File Reference

SNMP query routines. More...

#include "before_system.h"
#include <unistd.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <stdarg.h>
#include "gu.h"
#include "global_defines.h"

Data Structures

struct  ITEMS

Defines

#define UNIVERSAL_FLAG   0x00
#define APPLICATION_FLAG   0x40
#define CONTEXT_FLAG   0x80
#define PRIVATE_FLAG   0xC0
#define PRIMITIVE_FLAG   0x00
#define CONSTRUCTOR_FLAG   0x20
#define BOOLEAN_TAG   0x01
#define INT_TAG   0x02
#define BIT_STRING_TAG   0x03
#define OCTET_STRING_TAG   0x04
#define NULL_TAG   0x05
#define OBJECT_ID_TAG   0x06
#define SEQUENCE_TAG   0x10
#define SET_TAG   0x11
#define LONG_LENGTH   0x80
#define SNMP_IP_ADDRESS_TAG   (APPLICATION_FLAG | 0x00)
#define SNMP_COUNTER32_TAG   (APPLICATION_FLAG | 0x01)
#define SNMP_GAGE32_TAG   (APPLICATION_FLAG | 0x02)
#define SNMP_TIMETICKS_TAG   (APPLICATION_FLAG | 0x03)
#define SNMP_OPAQUE_TAG   (APPLICATION_FLAG | 0x04)
#define SNMP_NSAP_ADDRESS_TAG   (APPLICATION_FLAG | 0x05)
#define SNMP_COUNTER64_TAG   (APPLICATION_FLAG | 0x06)
#define SNMP_UINTEGER32_TAG   (APPLICATION_FLAG | 0x07)

Functions

gu_snmpgu_snmp_open (unsigned long int ip_address, const char community[])
 Create a gu_snmp object.

void gu_snmp_close (struct gu_snmp *p)
 destroy an SNMP object

void gu_snmp_get (struct gu_snmp *p,...)
 Perform an SNMP query.


Detailed Description

SNMP query routines.

This file contains a minimal inplementation of SNMP querys.


Function Documentation

void gu_snmp_get struct gu_snmp p,
... 
 

Perform an SNMP query.

This uses a gu_snmp object to perform and SNMP query. The first argument is a pointer to a gu_snmp object. The subsequent arguments are a list of data types exepcted and pointers to storeage for them. This funciton throws exceptions on errors.

struct gu_snmp* gu_snmp_open unsigned long int  ip_address,
const char  community[]
 

Create a gu_snmp object.

This function creates an SNMP object, connects it to a remote system, and returns a pointer to it. If the community[] is NULL, then "public" will be used. This function throws exceptions on failure.


Generated on Fri Feb 20 15:17:52 2004 for PPR Libraries by doxygen 1.3.5