Added lwip_prvmib.c, an example for a simple private SNMP MIB implementation.

This commit is contained in:
christiaans 2006-10-06 09:59:46 +00:00
parent 85c4b51b50
commit 8cef35e840
3 changed files with 11 additions and 6 deletions

View File

@ -35,7 +35,7 @@ CC=gcc
#To compile for cygwin: make ARCH=cygwin
#To compile for openbsd: make ARCH=openbsd
ARCH=openbsd
CFLAGS=-g -Wall -pedantic -D$(ARCH) -DIPv4 -Os -fpack-struct
CFLAGS=-g -Wall -pedantic -D$(ARCH) -DIPv4 -Os -fpack-struct -DLWIP_DEBUG
ARFLAGS=rs
CONTRIBDIR=../../../..
@ -62,7 +62,7 @@ CORE4FILES=$(LWIPDIR)/core/ipv4/icmp.c $(LWIPDIR)/core/ipv4/ip.c \
# SNMPFILES: Extra SNMPv1 agent
SNMPFILES=$(LWIPDIR)/core/snmp/asn1_dec.c $(LWIPDIR)/core/snmp/asn1_enc.c \
$(LWIPDIR)/core/snmp/mib2.c $(LWIPDIR)/core/snmp/mib_structs.c \
$(LWIPDIR)/core/snmp/msg_in.c $(LWIPDIR)/core/snmp/msg_out.c
$(LWIPDIR)/core/snmp/msg_in.c $(LWIPDIR)/core/snmp/msg_out.c lwip_prvmib.c
# NETIFFILES: Files implementing various generic network interface functions.'
NETIFFILES=$(LWIPDIR)/netif/etharp.c mintapif.c
@ -73,7 +73,7 @@ LWIPFILESW=$(wildcard $(LWIPFILES))
LWIPOBJS=$(notdir $(LWIPFILESW:.c=.o))
# APPFILES
APPFILES=echo.c timer.c
APPFILES=echo.c timer.c
LWIPLIB=liblwip4.a
APPLIB=liblwipapps.a

View File

@ -43,7 +43,7 @@
/* MEM_SIZE: the size of the heap memory. If the application will send
a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE 6000
#define MEM_SIZE 16000
/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
sends a lot of data out of ROM (or other static memory), this
@ -157,7 +157,7 @@ a lot of data that needs to be copied, this should be set high. */
#define LWIP_SNMP 1
#define SNMP_TRAP_DESTINATIONS 1
#define SNMP_PRIVATE_MIB 0
#define SNMP_PRIVATE_MIB 1
/* ---------- UDP options ---------- */
#define LWIP_UDP 1

View File

@ -52,7 +52,7 @@
#include <signal.h>
#include "echo.h"
#include "private_mib.h"
/* (manual) host IP configuration */
static struct ip_addr ipaddr, netmask, gw;
@ -188,6 +188,11 @@ main(int argc, char **argv)
netif_set_default(&netif);
netif_set_up(&netif);
#if SNMP_PRIVATE_MIB != 0
/* initialize our private example MIB */
lwip_privmib_init();
#endif
snmp_trap_dst_ip_set(0,&trap_addr);
snmp_trap_dst_enable(0,trap_flag);
snmp_set_syscontact(syscontact_str,&syscontact_len);