Hello,

  I've noticed that there are (at least...) two ways to obtaine
an interface name unside net-snmp.

  I'm currently using in ifTable_data_access.c when generating traps:

  netsnmp_access_interface_name_find(interface index)

  It works with LAN interfaces.  But with WAN interfaces it does
not return the proper PPP interface name.  The interfaces are:

14: w2c1: <POINTOPOINT,NOARP,UP,10000> mtu 1532 qdisc pfifo_fast qlen 100
    link/ppp
15: w2c1ppp: <POINTOPOINT,NOARP,UP,10000> mtu 1500 qdisc pfifo_fast qlen 100
    link/ppp

 And it returns, inside two consecutive trap:

 IF-MIB::ifName.14 = STRING: w2c1
 IF-MIB::ifName.15 = STRING: w2c1

 On the other hand, doing a:

 snmpwalk -c public -v2c 10.128.10.241 | grep ifName will return:

 IF-MIB::ifName.14 = STRING: w2c1
 IF-MIB::ifName.15 = STRING: w2c1ppp

  Looking it up I saw that there's a var_ifEntry() method in
ifTable/ifTable_data_access.c that seemingly returns the proper names.

  My idea is to use that inside ifTable_data_access.c.  

  I've added the ifTable.h and ifTable_defs.h includes.  And I've
also added the extern unsigned char *var_ifEntry() prototype.
But the linker will not see it: .libs/libnetsnmpmibs.so:
undefined reference to `var_ifEntry'.  What could be missing ?
Any different linking, compile to be done ?  

  net-snmp is 5.4.1.  - Thanks.

cc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib
-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl/5.8/CORE -DNETSNMP_ENABLE_IPV6 -g -Wall -O2
-DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -c snmpd.c -o snmpd.o
>/dev/null 2>&1 /bin/sh ../libtool --mode=link cc
-DNETSNMP_ENABLE_IPV6 -g -Wall -O2 -DNETSNMP_USE_INLINE -Ulinux
-Dlinux=linux -o snmpd snmpd.lo -L../snmplib/.libs -L../snmplib
-L./.libs -L./helpers/.libs -L./helpers libnetsnmpagent.la
helpers/libnetsnmphelpers.la libnetsnmpmibs.la
../snmplib/libnetsnmp.la -Wl,-E cc -DNETSNMP_ENABLE_IPV6 -g -Wall
-O2 -DNETSNMP_USE_INLINE -Ulinux -Dlinux=linux -o .libs/snmpd
.libs/snmpd.o -Wl,-E
-L/usr/src/net-snmp-541-test/net-snmp-5.4.1~dfsg.rr1/agent/.libs
-L/usr/src/net-snmp-541-test/net-snmp-5.4.1~dfsg.rr1/agent/helpers/.libs
-L/usr/src/net-snmp-541-test/net-snmp-5.4.1~dfsg.rr1/snmplib/.libs
-L/usr/src/net-snmp-541-test/net-snmp-5.4.1~dfsg.rr1/snmplib
-L/usr/src/net-snmp-541-test/net-snmp-5.4.1~dfsg.rr1/agent/helpers
./.libs/libnetsnmpagent.so helpers/.libs/libnetsnmphelpers.so
./.libs/libnetsnmpmibs.so ../snmplib/.libs/libnetsnmp.so
./.libs/libnetsnmpmibs.so: undefined reference to `var_ifEntry'

collect2: ld returned 1 exit status
make[2]: *** [snmpd] Error 1

make[2]: Leaving directory
`/usr/src/net-snmp-541-test/net-snmp-5.4.1~dfsg.rr1/agent'

make[1]: *** [subdirs] Error 1

make[1]: Leaving directory
`/usr/src/net-snmp-541-test/net-snmp-5.4.1~dfsg.rr1'

make: *** [debian/stamp-makefile-build] Error 2 





------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to