Back to index

glibc  2.9
Functions
inet_netof.c File Reference
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>

Go to the source code of this file.

Functions

in_addr_t inet_netof (struct in_addr in)

Function Documentation

in_addr_t inet_netof ( struct in_addr  in)

Definition at line 43 of file inet_netof.c.

{
       register u_int32_t i = ntohl(in.s_addr);

       if (IN_CLASSA(i))
              return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT);
       else if (IN_CLASSB(i))
              return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT);
       else
              return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT);
}

Here is the call graph for this function: