On Wed, 2005-10-19 at 09:50 -0700, Wes Hardaker wrote:
> >>>>> On Wed, 19 Oct 2005 10:00:53 +0100, Dave Shield <[EMAIL PROTECTED]> 
> >>>>> said:
> 
> Dave> I'm not sure that the on-the-wire representation is particularly
> Dave> relevant here. Surely what's important is how the Net-SNMP library
> Dave> stores an IP address internally?


> The routines expect 4 bytes handed to it in proper order.  How those 4
> bytes are stored doesn't matter...  I think it's *mistakenly* stored
> as a integer many times because the C datatype is conveniently 4 bytes.

Ummmm....

>From <netinet/in.h>:

        /* Internet address.  */
        typedef uint32_t in_addr_t;
        struct in_addr
          {
            in_addr_t s_addr;
          };


So the "natural" representation of an IP address (on Linux, at least)
*is* an integer.   Though that header file doesn't seem to indicate
whether this should be host-order or network-order.   :-(
Does anyone know whether this is specified anywhere?

Dave



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to