1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)in.h	7.1 (Berkeley) 6/5/86
   7:  */
   8: 
   9: /*
  10:  * Constants and structures defined by the internet system,
  11:  * Per RFC 790, September 1981.
  12:  */
  13: 
  14: /*
  15:  * Protocols
  16:  */
  17: #define IPPROTO_IP      0       /* dummy for IP */
  18: #define IPPROTO_ICMP        1       /* control message protocol */
  19: #define IPPROTO_GGP     2       /* gateway^2 (deprecated) */
  20: #define IPPROTO_TCP     6       /* tcp */
  21: #define IPPROTO_EGP     8       /* exterior gateway protocol */
  22: #define IPPROTO_PUP     12      /* pup */
  23: #define IPPROTO_UDP     17      /* user datagram protocol */
  24: #define IPPROTO_IDP     22      /* xns idp */
  25: 
  26: #define IPPROTO_RAW     255     /* raw IP packet */
  27: #define IPPROTO_MAX     256
  28: 
  29: 
  30: /*
  31:  * Ports < IPPORT_RESERVED are reserved for
  32:  * privileged processes (e.g. root).
  33:  * Ports > IPPORT_USERRESERVED are reserved
  34:  * for servers, not necessarily privileged.
  35:  */
  36: #define IPPORT_RESERVED     1024
  37: #define IPPORT_USERRESERVED 5000
  38: 
  39: /*
  40:  * Link numbers
  41:  */
  42: #define IMPLINK_IP      155
  43: #define IMPLINK_LOWEXPER    156
  44: #define IMPLINK_HIGHEXPER   158
  45: 
  46: /*
  47:  * Internet address (a structure for historical reasons)
  48:  */
  49: struct in_addr {
  50:     u_long s_addr;
  51: };
  52: 
  53: /*
  54:  * Definitions of bits in internet address integers.
  55:  * On subnets, the decomposition of addresses to host and net parts
  56:  * is done according to subnet mask, not the masks here.
  57:  */
  58: #define IN_CLASSA(i)        (((long)(i) & 0x80000000) == 0)
  59: #define IN_CLASSA_NET       0xff000000
  60: #define IN_CLASSA_NSHIFT    24
  61: #define IN_CLASSA_HOST      0x00ffffff
  62: #define IN_CLASSA_MAX       128
  63: 
  64: #define IN_CLASSB(i)        (((long)(i) & 0xc0000000) == 0x80000000)
  65: #define IN_CLASSB_NET       0xffff0000
  66: #define IN_CLASSB_NSHIFT    16
  67: #define IN_CLASSB_HOST      0x0000ffff
  68: #define IN_CLASSB_MAX       65536
  69: 
  70: #define IN_CLASSC(i)        (((long)(i) & 0xc0000000) == 0xc0000000)
  71: #define IN_CLASSC_NET       0xffffff00
  72: #define IN_CLASSC_NSHIFT    8
  73: #define IN_CLASSC_HOST      0x000000ff
  74: 
  75: #define INADDR_ANY      (u_long)0x00000000
  76: #define INADDR_BROADCAST    (u_long)0xffffffff  /* must be masked */
  77: 
  78: /*
  79:  * Socket address, internet style.
  80:  */
  81: struct sockaddr_in {
  82:     short   sin_family;
  83:     u_short sin_port;
  84:     struct  in_addr sin_addr;
  85:     char    sin_zero[8];
  86: };
  87: 
  88: /*
  89:  * Options for use with [gs]etsockopt at the IP level.
  90:  */
  91: #define IP_OPTIONS  1       /* set/get IP per-packet options */
  92: 
  93: #if !defined(vax) && !defined(ntohl) && !defined(lint)
  94: /*
  95:  * Macros for number representation conversion.
  96:  */
  97: #define ntohl(x)    (x)
  98: #define ntohs(x)    (x)
  99: #define htonl(x)    (x)
 100: #define htons(x)    (x)
 101: #endif
 102: 
 103: #if !defined(ntohl) && (defined(vax) || defined(lint))
 104: u_short ntohs(), htons();
 105: u_long  ntohl(), htonl();
 106: #endif
 107: 
 108: #ifdef KERNEL
 109: extern  struct domain inetdomain;
 110: extern  struct protosw inetsw[];
 111: struct  in_addr in_makeaddr();
 112: u_long  in_netof(), in_lnaof();
 113: #endif

Defined struct's

in_addr defined in line 49; used 164 times
sockaddr_in defined in line 81; used 168 times

Defined macros

IMPLINK_HIGHEXPER defined in line 44; used 1 times
IMPLINK_LOWEXPER defined in line 43; used 1 times
IN_CLASSA defined in line 58; used 7 times
IN_CLASSA_HOST defined in line 61; used 2 times
IN_CLASSA_MAX defined in line 62; never used
IN_CLASSA_NET defined in line 59; used 5 times
IN_CLASSA_NSHIFT defined in line 60; never used
IN_CLASSB defined in line 64; used 7 times
IN_CLASSB_HOST defined in line 67; used 2 times
IN_CLASSB_MAX defined in line 68; never used
IN_CLASSB_NET defined in line 65; used 5 times
IN_CLASSB_NSHIFT defined in line 66; never used
IN_CLASSC defined in line 70; never used
IN_CLASSC_HOST defined in line 73; used 2 times
IN_CLASSC_NET defined in line 71; used 5 times
IN_CLASSC_NSHIFT defined in line 72; never used
IPPORT_RESERVED defined in line 36; used 3 times
IPPORT_USERRESERVED defined in line 37; used 1 times
IPPROTO_EGP defined in line 21; never used
IPPROTO_GGP defined in line 19; never used
IPPROTO_IDP defined in line 24; used 2 times
IPPROTO_MAX defined in line 27; used 2 times
IPPROTO_PUP defined in line 22; never used
IPPROTO_RAW defined in line 26; used 3 times
IP_OPTIONS defined in line 91; never used

Usage of this include

in.h used 37 times
Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1716
Valid CSS Valid XHTML 1.0 Strict