Hi
i have to call SOAP server calls in my mib2c created code to get the values. i had put following lines in my mib2c output code
1) including SOAP header files along with normal includes
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "cmpCjEntryNumberIn.h"
/*added*/
#include "soapH.h"
#include "CSE.nsmap"
2)declaration and initialization of soap variables
const char server[]="127.0.0.1:7689";
3) In handle method i put local soap variable req to make server calls
and calling soap calls in MODE-GET case under switch case
int
handle_cmpCjEntryNumberIn(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{
/*added*/
u_long val;
u_long *pval;
char input[100]="5";
char *res;
struct soap soap;
int crc=0;
pval=&val;
soap_init(&soap);
/*added*/
switch (reqinfo->mode) {
case MODE_GET:
/* added */
if(soap_call_ns__processClient(&soap,server,"",input,input,&res)==SOAP_OK)
val=(u_long)res;
else
val=143;
soap_destroy(&soap);
soap_end(&soap);
soap_done(&soap);
/*added*/
while i am configuring and doing make. Make giving following error
gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -g -O2 -Dlinux -c snmpd.c -fPIC -DPIC -o .libs/snmpd.lo
gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -g -O2 -Dlinux -c snmpd.c -o snmpd.o >/dev/null 2>&1
mv -f .libs/snmpd.lo snmpd.lo
/bin/sh ../libtool --mode=link gcc -g -O2 -Dlinux -o snmpd snmpd.lo libnetsnmpmibs.la libnetsnmpagent.la helpers/libnetsnmphelpers.la ../snmplib/libnetsnmp.la -ldl -lcrypto -lm
gcc -g -O2 -Dlinux -o .libs/snmpd snmpd.o ./.libs/libnetsnmpmibs.so ./.libs/libnetsnmpagent.so helpers/.libs/libnetsnmphelpers.so ../snmplib/.libs/libnetsnmp.so -ldl -lcrypto -lm -Wl,--rpath -Wl,/usr/local/lib
./.libs/libnetsnmpmibs.so: undefined reference to `soap_call_ns__processClient'
./.libs/libnetsnmpmibs.so: undefined reference to `soap_done'
./.libs/libnetsnmpmibs.so: undefined reference to `soap_init'
./.libs/libnetsnmpmibs.so: undefined reference to `soap_end'
./.libs/libnetsnmpmibs.so: undefined reference to `soap_delete'
collect2: ld returned 1 exit status
make[1]: *** [snmpd] Error 1
make[1]: Leaving directory `/root/SNMP/cmpCjEntryNumberIn-S/net-snmp-5.2.1/agent'
make: *** [subdirs] Error 1
Make gives undefined reference for the soap functions i added. I had put all the .h and library files in the
net-SNMP 5.2.1/agent/mibgroups directory ( previously it gives compiler error for not founding the .h files, afterputting the files in that dir it is solved)
To make my SOAP server calls, Am i have to change some Makefiles.(please give me steps what i have to do, to make this run..............)
by
Sam
Title: Calling SOAP calls while Extending mibs using mib2c code giving "./.libs/libnetsnmpmibs.so: undefined reference ..."
- Calling SOAP calls while Extending mibs using mib2c code givi... kanda.samy