Could you please help me to solve this problem

mai wang <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi

I ask question about net-snmp.

How can I send response in the same port not random port ? (in Version 1 or
Version 2)

11:20:20.629170 IP 10.56.230.xx.57994 > 10.56.230.xx.8060: UDP, length 45

11:20:20.630846 IP 10.56.230.xx.60737 > 10.56.230.xx.57994: UDP, length 47

11:20:30.356526 IP 10.56.230.xx.55253 > 10.56.230.xx.8060: UDP, length 45

11:20:30.358235 IP 10.56.230.xx.48567 > 10.56.230.xx.55253: UDP, length 47


I make some codes, but unfortunately it doesn’t work fine

struct snmp_session session;
//initialize session
snmp_sess_init(&session);
//set session parameters
session.version = ver;
session.flags = 0;
session.isAuthoritative = SNMP_SESS_AUTHORITATIVE;
session.remote_port=address._port;
session.local_port=0; //set to 0 for traps--------------
string tmp=address.get_printable();
tmp+=":";
tmp+=ltoa(address._port);
session.peername=(char* )tmp.c_str();
session.callback=0;
void * tmpsession=snmp_sess_open(&session);

 I know if local_port =0, there is random port.

if I set other value like 8061, snmp_sess_open will return NULL and return
error information -3(SNMPERR_BAD_ADDRESS)

Could you give some idea about this? Thanks

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.