in.h File Reference

Go to the source code of this file.

Data Structures

struct  in_addr
 Internet address. More...
struct  sockaddr_in

Defines

#define __SOCK_SIZE__   16
 Structure describing an Internet (IP) socket address. sizeof(struct sockaddr).
#define sin_zero   __pad
 for BSD UNIX comp. -FvK
#define IN_CLASSA(a)   ((((long int) (a)) & 0x80000000) == 0)
#define IN_CLASSA_NET   0xff000000
#define IN_CLASSA_NSHIFT   24
#define IN_CLASSA_HOST   (0xffffffff & ~IN_CLASSA_NET)
#define IN_CLASSA_MAX   128
#define IN_CLASSB(a)   ((((long int) (a)) & 0xc0000000) == 0x80000000)
#define IN_CLASSB_NET   0xffff0000
#define IN_CLASSB_NSHIFT   16
#define IN_CLASSB_HOST   (0xffffffff & ~IN_CLASSB_NET)
#define IN_CLASSB_MAX   65536
#define IN_CLASSC(a)   ((((long int) (a)) & 0xc0000000) == 0xc0000000)
#define IN_CLASSC_NET   0xffffff00
#define IN_CLASSC_NSHIFT   8
#define IN_CLASSC_HOST   (0xffffffff & ~IN_CLASSC_NET)
#define IN_CLASSD(a)   ((((long int) (a)) & 0xf0000000) == 0xe0000000)
#define IN_MULTICAST(a)   IN_CLASSD(a)
#define IN_EXPERIMENTAL(a)   ((((long int) (a)) & 0xe0000000) == 0xe0000000)
#define IN_BADCLASS(a)   ((((long int) (a)) & 0xf0000000) == 0xf0000000)
#define INADDR_ANY   ((unsigned long int) 0x00000000)
 Address to accept any incoming messages.
#define INADDR_BROADCAST   ((unsigned long int) 0xffffffff)
 Address to send to all hosts.
#define INADDR_NONE   0xffffffff
 Address indicating an error return.
#define IN_LOOPBACKNET   127
 Network number for local host loopback.
#define INADDR_LOOPBACK   0x7f000001
 Address to loopback in software to local host. 127.0.0.1.
#define IP_HDRINCL   2
 raw packet header option
#define __htonl(x)   __ntohl(x)
#define __htons(x)   __ntohs(x)
#define __constant_htonl(x)   __constant_ntohl(x)
#define __constant_htons(x)   __constant_ntohs(x)

Enumerations

enum  {
  IPPROTO_IP = 0, IPPROTO_ICMP = 1, IPPROTO_GGP = 2, IPPROTO_TCP = 6,
  IPPROTO_EGP = 8, IPPROTO_PUP = 12, IPPROTO_UDP = 17, IPPROTO_IDP = 22,
  IPPROTO_RAW = 255, IPPROTO_MAX
}
 Standard well-defined IP protocols. More...

Functions

unsigned long int ntohl (unsigned long int)
 Linux Internet number representation function declarations.
unsigned short int ntohs (unsigned short int)
unsigned long int htonl (unsigned long int)
unsigned short int htons (unsigned short int)
static __inline__ unsigned
long int 
__ntohl (unsigned long int x)
static __inline__ unsigned
long int 
__constant_ntohl (unsigned long int x)
static __inline__ unsigned
short int 
__ntohs (unsigned short int x)
static __inline__ unsigned
short int 
__constant_ntohs (unsigned short int x)


Define Documentation

#define __constant_htonl (  )     __constant_ntohl(x)

Definition at line 174 of file in.h.

#define __constant_htons (  )     __constant_ntohs(x)

Definition at line 175 of file in.h.

#define __htonl (  )     __ntohl(x)

Definition at line 172 of file in.h.

#define __htons (  )     __ntohs(x)

Definition at line 173 of file in.h.

#define __SOCK_SIZE__   16

Structure describing an Internet (IP) socket address. sizeof(struct sockaddr).

Definition at line 49 of file in.h.

#define IN_BADCLASS (  )     ((((long int) (a)) & 0xf0000000) == 0xf0000000)

Definition at line 92 of file in.h.

#define IN_CLASSA (  )     ((((long int) (a)) & 0x80000000) == 0)

Definitions of the bits in an Internet address integer. On subnets, host and network parts are found according to the subnet mask, not these masks.

Definition at line 71 of file in.h.

#define IN_CLASSA_HOST   (0xffffffff & ~IN_CLASSA_NET)

Definition at line 74 of file in.h.

#define IN_CLASSA_MAX   128

Definition at line 75 of file in.h.

#define IN_CLASSA_NET   0xff000000

Definition at line 72 of file in.h.

#define IN_CLASSA_NSHIFT   24

Definition at line 73 of file in.h.

#define IN_CLASSB (  )     ((((long int) (a)) & 0xc0000000) == 0x80000000)

Definition at line 77 of file in.h.

#define IN_CLASSB_HOST   (0xffffffff & ~IN_CLASSB_NET)

Definition at line 80 of file in.h.

#define IN_CLASSB_MAX   65536

Definition at line 81 of file in.h.

#define IN_CLASSB_NET   0xffff0000

Definition at line 78 of file in.h.

#define IN_CLASSB_NSHIFT   16

Definition at line 79 of file in.h.

#define IN_CLASSC (  )     ((((long int) (a)) & 0xc0000000) == 0xc0000000)

Definition at line 83 of file in.h.

#define IN_CLASSC_HOST   (0xffffffff & ~IN_CLASSC_NET)

Definition at line 86 of file in.h.

#define IN_CLASSC_NET   0xffffff00

Definition at line 84 of file in.h.

#define IN_CLASSC_NSHIFT   8

Definition at line 85 of file in.h.

#define IN_CLASSD (  )     ((((long int) (a)) & 0xf0000000) == 0xe0000000)

Definition at line 88 of file in.h.

#define IN_EXPERIMENTAL (  )     ((((long int) (a)) & 0xe0000000) == 0xe0000000)

Definition at line 91 of file in.h.

#define IN_LOOPBACKNET   127

Network number for local host loopback.

Definition at line 104 of file in.h.

#define IN_MULTICAST (  )     IN_CLASSD(a)

Definition at line 89 of file in.h.

#define INADDR_ANY   ((unsigned long int) 0x00000000)

Address to accept any incoming messages.

Definition at line 95 of file in.h.

#define INADDR_BROADCAST   ((unsigned long int) 0xffffffff)

Address to send to all hosts.

Definition at line 98 of file in.h.

#define INADDR_LOOPBACK   0x7f000001

Address to loopback in software to local host. 127.0.0.1.

Definition at line 107 of file in.h.

#define INADDR_NONE   0xffffffff

Address indicating an error return.

Definition at line 101 of file in.h.

#define IP_HDRINCL   2

raw packet header option

Options for use with `getsockopt' and `setsockopt' at the IP level. LINUX does not yet have the IP_OPTIONS option (grin), so we undefine it for now.- HJ && FvK

Definition at line 122 of file in.h.

#define sin_zero   __pad

for BSD UNIX comp. -FvK

Definition at line 59 of file in.h.


Enumeration Type Documentation

anonymous enum

Standard well-defined IP protocols.

INET An implementation of the TCP/IP protocol suite for the LINUX operating system. INET is implemented using the BSD Socket interface as the means of communication with the user level.

Definitions of the Internet Protocol.

Version: @(#)in.h 1.0.1 04/21/93

Authors: Original taken from the GNU Project <netinet/in.h> file. Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Enumerator:
IPPROTO_IP  Dummy protocol for TCP.
IPPROTO_ICMP  Internet Control Message Protocol.
IPPROTO_GGP  Gateway Protocol (deprecated).
IPPROTO_TCP  Transmission Control Protocol.
IPPROTO_EGP  Exterior Gateway Protocol.
IPPROTO_PUP  PUP protocol.
IPPROTO_UDP  User Datagram Protocol.
IPPROTO_IDP  XNS IDP protocol.
IPPROTO_RAW  Raw IP packets.
IPPROTO_MAX 

Definition at line 27 of file in.h.


Function Documentation

static __inline__ unsigned long int __constant_ntohl ( unsigned long int  x  )  [static]

Definition at line 148 of file in.h.

static __inline__ unsigned short int __constant_ntohs ( unsigned short int  x  )  [static]

Definition at line 166 of file in.h.

static __inline__ unsigned long int __ntohl ( unsigned long int  x  )  [static]

< swap lower bytes

< swap words

< swap higher bytes

Definition at line 137 of file in.h.

static __inline__ unsigned short int __ntohs ( unsigned short int  x  )  [static]

< swap bytes

Definition at line 157 of file in.h.

unsigned long int htonl ( unsigned long  int  ) 

unsigned short int htons ( unsigned short  int  ) 

unsigned long int ntohl ( unsigned long  int  ) 

Linux Internet number representation function declarations.

unsigned short int ntohs ( unsigned short  int  ) 


Generated on Mon May 1 21:47:01 2006 for KernelAPI by  doxygen 1.4.6-5