[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] Net-SNMP AgentX
Hi everybody,
I'm using net-snmp 5.2.1 bundled with petalinux.
I need to implement a custom mib and update some variables over time
based on custom logic.
I used to build a built-in mib in the main agent and interacted with it
via snmp set and get requests to update variables and retrieve the
updated data, but found that method a bit slow.
I discarded the use of shell scripts because it would be better to
integrate the code with a C program and I started to think about the use
of a custom subagent (agentx).
I built the net-snmp daemon with agentx module enabled and was able to
compile the subagent demo as per
http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent, but
trying to port it to PetaLinux I get a number of compile errors:
microblaze-uclinux-gcc
-L/home/marcoge/PetaLinux/software/petalinux-dist/lib -mno-xl-soft-mul
-mno-xl-soft-div -mxl-barrel-shift -mhard-float -mcpu=v6.00.b
`/home/marcoge/PetaLinux/software/petalinux-dist/user/net-snmp/build/net-snmp-config --libs` -L/home/marcoge/PetaLinux/software/petalinux-dist/user/net-snmp/build/snmplib/.libs -L/home/marcoge/PetaLinux/software/petalinux-dist/user/net-snmp/build/agent/.libs -L/home/marcoge/PetaLinux/software/petalinux-dist/user/net-snmp/build/agent/helpers/.libs -o microref main.o uart.o gps.o led.o utility.o snmp.o my_mib.o -lnetsnmp -lnetsnmpagent -lnetsnmpmibs -lnetsnmphelpers -lpthread -lm
microref.elf2flt: In function `netsnmp_agent_add_list_data':
/home/marcoge/petalinux-svn/software/petalinux-dist/user/net-snmp/build/agent/../../agent/snmp_agent.c(.text+0x60720): undefined reference to `netsnmp_add_list_data'
microref.elf2flt: In function `netsnmp_agent_remove_list_data':
/home/marcoge/petalinux-svn/software/petalinux-dist/user/net-snmp/build/agent/../../agent/snmp_agent.c(.text+0x6075c): undefined reference to `netsnmp_remove_list_node'
microref.elf2flt: In function `netsnmp_agent_get_list_data':
/home/marcoge/petalinux-svn/software/petalinux-dist/user/net-snmp/build/agent/../../agent/snmp_agent.c(.text+0x60790): undefined reference to `netsnmp_get_list_data'
microref.elf2flt: In function `netsnmp_free_agent_data_set':
...
I'm attaching the Makefile I used in hope somebody else could confirm
the behaviour or tell me what I am doing wrong.
Was anybody able to extend the net-snmp under PetaLinux with a custom
subagent? Is there any other method I could use?
Many thanks for any help you could provide me.
Best regards,
Giulio Mazzoleni
------------------------------------------------
ifndef PETALINUX
$(error You must source the petalinux/settings.sh script before working
with PetaLinux)
endif
# Point to default PetaLinux root directory
ifndef ROOTDIR
ROOTDIR=$(PETALINUX)/software/petalinux-dist
endif
PATH:=$(PATH):$(ROOTDIR)/tools
UCLINUX_BUILD_USER = 1
-include $(ROOTDIR)/.config
-include $(ROOTDIR)/$(CONFIG_LINUXDIR)/.config
LIBCDIR = $(CONFIG_LIBCDIR)
-include $(ROOTDIR)/config.arch
ROMFSDIR=$(ROOTDIR)/romfs
ROMFSINST=$(ROOTDIR)/tools/romfs-inst.sh
NETSNMPCONFIG=$(ROOTDIR)/user/net-snmp/build/net-snmp-config
CFLAGS += `$(NETSNMPCONFIG) --cflags` -I
$(ROOTDIR)/user/net-snmp/build/include -I
$(ROOTDIR)/user/net-snmp/include
LDFLAGS += `$(NETSNMPCONFIG) --libs` -L
$(ROOTDIR)/user/net-snmp/build/snmplib/.libs -L
$(ROOTDIR)/user/net-snmp/build/agent/.libs -L
$(ROOTDIR)/user/net-snmp/build/agent/helpers/.libs
LDLIBS += -lnetsnmp -lnetsnmpagent -lnetsnmpmibs -lnetsnmphelpers
-lpthread -lm
APP = example-demon
# Add any other object files to this list below
APP_OBJS = example-demon.o nstAgentSubagentObject.o
all: $(APP)
$(APP): $(APP_OBJS)
$(CC) $(LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS)
clean:
-rm -f $(APP) *.elf *.gdb *.o
romfs:
$(ROMFSINST) $(APP) /bin/$(APP)
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
# Targets for the required .config files - if they don't exist, the tree
isn't
# configured. Tell the user this, how to fix it, and exit.
${ROOTDIR}/config.arch ${ROOTDIR}/.config:
@echo "Error: You must configure the PetaLinux tree before compiling
your application"
@echo ""
@echo "Change directory to ../../petalinux-dist and 'make menuconfig'
or 'make xconfig'"
@echo ""
@echo "Once the tree is configured, return to this directory, and
re-run make."
@echo ""
@exit -1
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/