Hi all

 

I have found a solution to my problem.

Instead of receiving the new value using
"requests->requestvb->val.integer" I used
"requests->requestvb->val.string" which is actually an array of
characters representing the IP address as follow:

                ip = (u_char*)requests->requestvb->val.string;

                sprintf(val_ip_ascii, "%d.%d.%d.%d", ip[0], ip[1],
ip[2], ip[3]);

 

Enjoy!

 

 

From: Naama Bar Menachem 
Sent: Sunday, October 16, 2011 3:17 PM
To: 'net-snmp-users@lists.sourceforge.net'
Subject: Set IPADDRS value

 

Hello

 

When setting an IP-address value, how do I retrieve the value from the
requests?

When reading the value - *(requests->requestvb->val.integer) -  under
case MODE_SET_ACTION, I always receive 0.

I tried to print the value directly or by saving it to in_addr_t: 

      in_addr_t ip_addrs = *(requests->requestvb->val.integer);

 

help!

 

Best Regards,

 

Naama Bar Menachem

SW Eng.

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to