All,
   Got it!!!!!!!!!!!! :) It's so simple - I do not know anyone would need
this!!!! Still posting so that a nard like me could be helped.:) The logic -
it takes the 32-bit long and divides it up into octets and turns it around -
the lowest octet becomes the highest octet in the IPAddress. Example:

   0x1F9FB77D will become, 125.183.159.31..........................,
Thanks and regards,
Arijit

-----Original Message-----
From: Mukherjee, Arijit (Arijit) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 02, 2004 4:32 PM
To: [EMAIL PROTECTED]
Subject: RE: Mapping between long and ASN_IPADDRESS 


Dave,
Got it. However, I wanted to know the logic of how the agent converts the
long to four-octet binary. That will help me specify the correct long in the
mib-module,
Thanks and regards,
Arijit

-----Original Message-----
From: Dave Shield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 02, 2004 3:14 PM
To: Mukherjee, Arijit (Arijit)
Cc: [EMAIL PROTECTED]
Subject: Re: Mapping between long and ASN_IPADDRESS 


> However, when queried from manager, the agent returns the . separated
> IPAddress.

No - the agent returns a four-octet binary string (ratehr than an
unsigned long).  It's the client that *displays* this as a dotted-quad.

Given the varbind ('vb') that's returned, the code is basically:

    printf( "IP Address is %d.%d.%d.%d\n",
                vb->val.string[0],
                vb->val.string[1],
                vb->val.string[2],
                vb->val.string[3] );

Dave


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
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


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
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

Reply via email to