Back to index

glibc  2.9
Defines | Typedefs | Functions
inet.h File Reference
#include <features.h>
#include <netinet/in.h>

Go to the source code of this file.

Defines

#define __socklen_t_defined

Typedefs

typedef __socklen_t socklen_t

Functions

__BEGIN_DECLS in_addr_t inet_addr (__const char *__cp) __THROW
in_addr_t inet_lnaof (struct in_addr __in) __THROW
struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host) __THROW
in_addr_t inet_netof (struct in_addr __in) __THROW
in_addr_t inet_network (__const char *__cp) __THROW
char * inet_ntoa (struct in_addr __in) __THROW
int inet_pton (int __af, __const char *__restrict __cp, void *__restrict __buf) __THROW
__const char * inet_ntop (int __af, __const void *__restrict __cp, char *__restrict __buf, socklen_t __len) __THROW

Define Documentation

Definition at line 28 of file inet.h.


Typedef Documentation

Definition at line 27 of file inet.h.


Function Documentation

Here is the caller graph for this function:

in_addr_t inet_lnaof ( struct in_addr  __in)

Definition at line 44 of file inet_lnaof.c.

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

       if (IN_CLASSA(i))
              return ((i)&IN_CLASSA_HOST);
       else if (IN_CLASSB(i))
              return ((i)&IN_CLASSB_HOST);
       else
              return ((i)&IN_CLASSC_HOST);
}

Here is the call graph for this function:

struct in_addr inet_makeaddr ( in_addr_t  __net,
in_addr_t  __host 
) [read]

Definition at line 43 of file inet_mkadr.c.

{
       struct in_addr in;

       if (net < 128)
              in.s_addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST);
       else if (net < 65536)
              in.s_addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST);
       else if (net < 16777216L)
              in.s_addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST);
       else
              in.s_addr = net | host;
       in.s_addr = htonl(in.s_addr);
       return in;
}

Here is the caller graph for this function:

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:

in_addr_t inet_network ( __const char *  __cp)

Here is the caller graph for this function:

char* inet_ntoa ( struct in_addr  __in)

Definition at line 32 of file inet_ntoa.c.

{
  unsigned char *bytes = (unsigned char *) &in;
  __snprintf (buffer, sizeof (buffer), "%d.%d.%d.%d",
             bytes[0], bytes[1], bytes[2], bytes[3]);

  return buffer;
}

Here is the call graph for this function:

Here is the caller graph for this function:

__const char* inet_ntop ( int  __af,
__const void *__restrict  __cp,
char *__restrict  __buf,
socklen_t  __len 
)

Here is the caller graph for this function:

int inet_pton ( int  __af,
__const char *__restrict  __cp,
void *__restrict  __buf 
)

Here is the caller graph for this function: