RE: Set IPADDRS value

"Naama Bar Menachem" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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: '[email protected]'
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
[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.