snmp_api.h File Reference


Detailed Description

SNMP API functions.

 * $Id: snmp_api.h,v 1.2 2008/08/11 07:00:24 haraldkipp Exp $
 * 

Definition in file snmp_api.h.

Go to the source code of this file.

Defines

#define SNMP_MAX_MSG_SIZE   1472
#define SNMP_STAT_INPKTS   0
#define SNMP_STAT_OUTPKTS   1
#define SNMP_STAT_INBADVERSIONS   2
#define SNMP_STAT_INBADCOMMUNITYNAMES   3
#define SNMP_STAT_INBADCOMMUNITYUSES   4
#define SNMP_STAT_INASNPARSEERRS   5
#define SNMP_STAT_INTOOBIGS   6
#define SNMP_STAT_INNOSUCHNAMES   7
#define SNMP_STAT_INBADVALUES   8
#define SNMP_STAT_INREADONLYS   9
#define SNMP_STAT_INGENERRS   10
#define SNMP_STAT_INTOTALREQVARS   11
#define SNMP_STAT_INTOTALSETVARS   12
#define SNMP_STAT_INGETREQUESTS   13
#define SNMP_STAT_INGETNEXTS   14
#define SNMP_STAT_INSETREQUESTS   15
#define SNMP_STAT_INGETRESPONSES   16
#define SNMP_STAT_INTRAPS   17
#define SNMP_STAT_OUTTOOBIGS   18
#define SNMP_STAT_OUTNOSUCHNAMES   19
#define SNMP_STAT_OUTBADVALUES   20
#define SNMP_STAT_OUTGENERRS   21
#define SNMP_STAT_OUTGETREQUESTS   22
#define SNMP_STAT_OUTGETNEXTS   23
#define SNMP_STAT_OUTSETREQUESTS   24
#define SNMP_STAT_OUTGETRESPONSES   25
#define SNMP_STAT_OUTTRAPS   26
#define SNMP_STAT_ENABLEAUTHENTRAPS   27
#define SNMP_STAT_MAX   28

Functions

int SnmpOidCmp (CONST OID *, size_t, CONST OID *, size_t)
 Compare object identifiers.
int SnmpOidLenCmp (CONST OID *name1, CONST OID *name2, size_t len)
 Compare object identifiers up to a specified length.
int SnmpOidTreeCmp (CONST OID *, size_t, CONST OID *, size_t)
 Compare object identifier with tree element.
int SnmpOidCmpIdx (CONST OID *name1, size_t len1, CONST OID *name2, size_t len2, OID index)
 Compare object identifiers with index added.
int SnmpOidEquals (CONST OID *, size_t, CONST OID *, size_t)
void SnmpStatsInc (int)
uint32_t SnmpStatsGet (int)


Define Documentation

#define SNMP_MAX_MSG_SIZE   1472

Definition at line 48 of file snmp_api.h.

#define SNMP_STAT_INPKTS   0

Definition at line 54 of file snmp_api.h.

Referenced by SnmpAgentProcessRequest().

#define SNMP_STAT_OUTPKTS   1

Definition at line 55 of file snmp_api.h.

Referenced by SnmpAgent().

#define SNMP_STAT_INBADVERSIONS   2

Definition at line 56 of file snmp_api.h.

Referenced by SnmpAgentProcessRequest().

#define SNMP_STAT_INBADCOMMUNITYNAMES   3

Definition at line 57 of file snmp_api.h.

Referenced by SnmpAgentProcessRequest().

#define SNMP_STAT_INBADCOMMUNITYUSES   4

Definition at line 58 of file snmp_api.h.

#define SNMP_STAT_INASNPARSEERRS   5

Definition at line 59 of file snmp_api.h.

Referenced by SnmpAgentProcessRequest().

#define SNMP_STAT_INTOOBIGS   6

Definition at line 60 of file snmp_api.h.

#define SNMP_STAT_INNOSUCHNAMES   7

Definition at line 61 of file snmp_api.h.

#define SNMP_STAT_INBADVALUES   8

Definition at line 62 of file snmp_api.h.

#define SNMP_STAT_INREADONLYS   9

Definition at line 63 of file snmp_api.h.

#define SNMP_STAT_INGENERRS   10

Definition at line 64 of file snmp_api.h.

#define SNMP_STAT_INTOTALREQVARS   11

Definition at line 65 of file snmp_api.h.

#define SNMP_STAT_INTOTALSETVARS   12

Definition at line 66 of file snmp_api.h.

#define SNMP_STAT_INGETREQUESTS   13

Definition at line 67 of file snmp_api.h.

#define SNMP_STAT_INGETNEXTS   14

Definition at line 68 of file snmp_api.h.

#define SNMP_STAT_INSETREQUESTS   15

Definition at line 69 of file snmp_api.h.

#define SNMP_STAT_INGETRESPONSES   16

Definition at line 70 of file snmp_api.h.

#define SNMP_STAT_INTRAPS   17

Definition at line 71 of file snmp_api.h.

#define SNMP_STAT_OUTTOOBIGS   18

Definition at line 72 of file snmp_api.h.

Referenced by SnmpVarBuild().

#define SNMP_STAT_OUTNOSUCHNAMES   19

Definition at line 73 of file snmp_api.h.

#define SNMP_STAT_OUTBADVALUES   20

Definition at line 74 of file snmp_api.h.

Referenced by SnmpVarBuild().

#define SNMP_STAT_OUTGENERRS   21

Definition at line 75 of file snmp_api.h.

#define SNMP_STAT_OUTGETREQUESTS   22

Definition at line 76 of file snmp_api.h.

#define SNMP_STAT_OUTGETNEXTS   23

Definition at line 77 of file snmp_api.h.

#define SNMP_STAT_OUTSETREQUESTS   24

Definition at line 78 of file snmp_api.h.

#define SNMP_STAT_OUTGETRESPONSES   25

Definition at line 79 of file snmp_api.h.

#define SNMP_STAT_OUTTRAPS   26

Definition at line 80 of file snmp_api.h.

#define SNMP_STAT_ENABLEAUTHENTRAPS   27

Definition at line 81 of file snmp_api.h.

#define SNMP_STAT_MAX   28

Definition at line 83 of file snmp_api.h.

Referenced by SnmpStatsGet(), and SnmpStatsInc().


Function Documentation

int SnmpOidCmp ( CONST OID name1,
size_t  len1,
CONST OID name2,
size_t  len2 
)

Compare object identifiers.

Parameters:
name1 First object identifier.
len1 Length of first object identifier.
name2 Second object identifier.
len2 Length of second object identifier.
Returns:
0 if both are equal, 1 if first element is larger or -1 if first element is lower than the second one.

Definition at line 79 of file snmp_api.c.

References SnmpOidLenCmp().

Referenced by SnmpMibRegister().

int SnmpOidLenCmp ( CONST OID name1,
CONST OID name2,
size_t  len 
)

Compare object identifiers up to a specified length.

Parameters:
name1 First object identifier.
name2 Second object identifier.
len Number of sub identifiers to compare.

Definition at line 51 of file snmp_api.c.

Referenced by SnmpOidCmp(), SnmpOidCmpIdx(), and SnmpOidTreeCmp().

int SnmpOidTreeCmp ( CONST OID objid,
size_t  objlen,
CONST OID treeid,
size_t  treelen 
)

Compare object identifier with tree element.

Parameters:
name1 Object identifier.
len1 Length of object identifier.
name2 Tree identifier.
len2 Length of tree identifier.
Returns:
0 if the object identifier is part of the subtree, -1 if it is located before the tree element or 1 if it is located after the tree element.

Definition at line 106 of file snmp_api.c.

References SnmpOidLenCmp().

Referenced by SnmpMibFind().

int SnmpOidCmpIdx ( CONST OID name1,
size_t  len1,
CONST OID name2,
size_t  len2,
OID  index 
)

Compare object identifiers with index added.

Parameters:
name1 First object identifier.
len1 Length of first object identifier.
name2 Second object identifier.
len2 Length of second object identifier.
index Index sub identifier.
Returns:
0 if both are equal, 1 if first element is larger or -1 if first element is lower than the second one.

Definition at line 129 of file snmp_api.c.

References SnmpOidLenCmp().

int SnmpOidEquals ( CONST OID ,
size_t  ,
CONST OID ,
size_t   
)

Definition at line 167 of file snmp_api.c.

References memcmp().

void SnmpStatsInc ( int   ) 

Definition at line 176 of file snmp_api.c.

References SNMP_STAT_MAX.

Referenced by SnmpAgent(), SnmpAgentProcessRequest(), and SnmpVarBuild().

uint32_t SnmpStatsGet ( int   ) 

Definition at line 183 of file snmp_api.c.

References SNMP_STAT_MAX.


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/