Nut/OS  4.10.3
API Reference
snmp_api.h
Go to the documentation of this file.
00001 #ifndef PRO_SNMP_API_H
00002 #define PRO_SNMP_API_H
00003 
00004 /*
00005  * Copyright 1998-2007 by egnite Software GmbH
00006  * Copyright 1988, 1989, 1991, 1992 by Carnegie Mellon University
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * 1. Redistributions of source code must retain the above copyright
00013  *    notice, this list of conditions and the following disclaimer.
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in the
00016  *    documentation and/or other materials provided with the distribution.
00017  * 3. Neither the name of the copyright holders nor the names of
00018  *    contributors may be used to endorse or promote products derived
00019  *    from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00028  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00029  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00030  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00031  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
00033  *
00034  * For additional information see http://www.ethernut.de/
00035  */
00036 
00046 #include <pro/asn1.h>
00047 
00052 
00053 #define SNMP_MAX_MSG_SIZE          1472 /* ethernet MTU minus IP/UDP header */
00054 
00055 
00056 /*
00057  * SNMP statistic counters.
00058  */
00059 #define  SNMP_STAT_INPKTS                0
00060 #define  SNMP_STAT_OUTPKTS               1
00061 #define  SNMP_STAT_INBADVERSIONS         2
00062 #define  SNMP_STAT_INBADCOMMUNITYNAMES   3
00063 #define  SNMP_STAT_INBADCOMMUNITYUSES    4
00064 #define  SNMP_STAT_INASNPARSEERRS        5
00065 #define  SNMP_STAT_INTOOBIGS             6
00066 #define  SNMP_STAT_INNOSUCHNAMES         7
00067 #define  SNMP_STAT_INBADVALUES           8
00068 #define  SNMP_STAT_INREADONLYS           9
00069 #define  SNMP_STAT_INGENERRS             10
00070 #define  SNMP_STAT_INTOTALREQVARS        11
00071 #define  SNMP_STAT_INTOTALSETVARS        12
00072 #define  SNMP_STAT_INGETREQUESTS         13
00073 #define  SNMP_STAT_INGETNEXTS            14
00074 #define  SNMP_STAT_INSETREQUESTS         15
00075 #define  SNMP_STAT_INGETRESPONSES        16
00076 #define  SNMP_STAT_INTRAPS               17
00077 #define  SNMP_STAT_OUTTOOBIGS            18
00078 #define  SNMP_STAT_OUTNOSUCHNAMES        19
00079 #define  SNMP_STAT_OUTBADVALUES          20
00080 #define  SNMP_STAT_OUTGENERRS            21
00081 #define  SNMP_STAT_OUTGETREQUESTS        22
00082 #define  SNMP_STAT_OUTGETNEXTS           23
00083 #define  SNMP_STAT_OUTSETREQUESTS        24
00084 #define  SNMP_STAT_OUTGETRESPONSES       25
00085 #define  SNMP_STAT_OUTTRAPS              26
00086 #define  SNMP_STAT_ENABLEAUTHENTRAPS     27
00087 
00088 #define  SNMP_STAT_MAX                   28
00089 
00092 extern int SnmpOidCmp(CONST OID *, size_t, CONST OID *, size_t);
00093 extern int SnmpOidLenCmp(CONST OID *name1, CONST OID *name2, size_t len);
00094 extern int SnmpOidTreeCmp(CONST OID *, size_t, CONST OID *, size_t);
00095 extern int SnmpOidCmpIdx(CONST OID *name1, size_t len1, CONST OID *name2, size_t len2, OID index);
00096 extern int SnmpOidEquals(CONST OID *, size_t, CONST OID *, size_t);
00097 
00098 extern void SnmpStatsInc(int);
00099 extern uint32_t SnmpStatsGet(int);
00100 extern void SnmpStatsSet(int, uint32_t);
00101 
00102 #endif