1: /*
   2:  * Copyright (c) 1982, 1986 Regents of the University of California.
   3:  * All rights reserved.
   4:  *
   5:  * Redistribution and use in source and binary forms are permitted
   6:  * provided that this notice is preserved and that due credit is given
   7:  * to the University of California at Berkeley. The name of the University
   8:  * may not be used to endorse or promote products derived from this
   9:  * software without specific prior written permission. This software
  10:  * is provided ``as is'' without express or implied warranty.
  11:  *
  12:  *	@(#)in_proto.c	7.2.1 (2.11BSD) 1995/10/09
  13:  */
  14: 
  15: #include "param.h"
  16: #include "socket.h"
  17: #include "protosw.h"
  18: #include "domain.h"
  19: #include "mbuf.h"
  20: 
  21: #include "in.h"
  22: #include "in_systm.h"
  23: #include "ip.h"
  24: 
  25: /*
  26:  * TCP/IP protocol family: IP, ICMP, UDP, TCP.
  27:  */
  28: int ip_output(),ip_ctloutput();
  29: int ip_init(),ip_slowtimo(),ip_drain(), ip_sysctl();
  30: int icmp_input(), icmp_sysctl();
  31: int udp_input(),udp_ctlinput(), udp_sysctl();
  32: int udp_usrreq();
  33: int udp_init();
  34: int tcp_input(),tcp_ctlinput();
  35: int tcp_usrreq(),tcp_ctloutput();
  36: int tcp_init(),tcp_fasttimo(),tcp_slowtimo(),tcp_drain();
  37: int rip_input(),rip_output(),rip_ctloutput();
  38: extern  int raw_usrreq();
  39: /*
  40:  * IMP protocol family: raw interface.
  41:  * Using the raw interface entry to get the timer routine
  42:  * in is a kludge.
  43:  */
  44: #include "imp.h"
  45: #if NIMP > 0
  46: int rimp_output(), hostslowtimo();
  47: #endif
  48: 
  49: #ifdef NSIP
  50: int idpip_input(), nsip_ctlinput();
  51: #endif
  52: 
  53: extern  struct domain inetdomain;
  54: 
  55: struct protosw inetsw[] = {
  56: { 0,        &inetdomain,    0,      0,
  57:   0,        ip_output,  0,      0,
  58:   0,
  59:   ip_init,  0,      ip_slowtimo,    ip_drain,   ip_sysctl
  60: },
  61: { SOCK_DGRAM,   &inetdomain,    IPPROTO_UDP,    PR_ATOMIC|PR_ADDR,
  62:   udp_input,    0,      udp_ctlinput,   ip_ctloutput,
  63:   udp_usrreq,
  64:   udp_init, 0,      0,      0,      udp_sysctl
  65: },
  66: { SOCK_STREAM,  &inetdomain,    IPPROTO_TCP,    PR_CONNREQUIRED|PR_WANTRCVD,
  67:   tcp_input,    0,      tcp_ctlinput,   tcp_ctloutput,
  68:   tcp_usrreq,
  69:   tcp_init, tcp_fasttimo,   tcp_slowtimo,   tcp_drain,
  70: },
  71: { SOCK_RAW, &inetdomain,    IPPROTO_RAW,    PR_ATOMIC|PR_ADDR,
  72:   rip_input,    rip_output, 0,      rip_ctloutput,
  73:   raw_usrreq,
  74:   0,        0,      0,      0,
  75: },
  76: { SOCK_RAW, &inetdomain,    IPPROTO_ICMP,   PR_ATOMIC|PR_ADDR,
  77:   icmp_input,   rip_output, 0,      rip_ctloutput,
  78:   raw_usrreq,
  79:   0,        0,      0,      0,      icmp_sysctl
  80: },
  81: #ifdef NSIP
  82: { SOCK_RAW, &inetdomain,    IPPROTO_IDP,    PR_ATOMIC|PR_ADDR,
  83:   idpip_input,  rip_output, nsip_ctlinput,  0,
  84:   raw_usrreq,
  85:   0,        0,      0,      0,
  86: },
  87: #endif
  88:     /* raw wildcard */
  89: { SOCK_RAW, &inetdomain,    0,      PR_ATOMIC|PR_ADDR,
  90:   rip_input,    rip_output, 0,      rip_ctloutput,
  91:   raw_usrreq,
  92:   0,        0,      0,      0,
  93: },
  94: };
  95: 
  96: struct domain inetdomain =
  97:     { AF_INET, "internet", 0, 0, 0,
  98:       inetsw, &inetsw[sizeof(inetsw)/sizeof(inetsw[0])] };
  99: 
 100: #if NIMP > 0
 101: extern  struct domain impdomain;
 102: 
 103: struct protosw impsw[] = {
 104: { SOCK_RAW, &impdomain, 0,      PR_ATOMIC|PR_ADDR,
 105:   0,        rimp_output,    0,      0,
 106:   raw_usrreq,
 107:   0,        0,      hostslowtimo,   0,
 108: },
 109: };
 110: 
 111: struct domain impdomain =
 112:     { AF_IMPLINK, "imp", 0, 0, 0,
 113:       impsw, &impsw[sizeof (impsw)/sizeof(impsw[0])] };
 114: #endif
 115: 
 116: #include "hy.h"
 117: #if NHY > 0
 118: /*
 119:  * HYPERchannel protocol family: raw interface.
 120:  */
 121: int rhy_output();
 122: extern  struct domain hydomain;
 123: 
 124: struct protosw hysw[] = {
 125: { SOCK_RAW, &hydomain,  0,      PR_ATOMIC|PR_ADDR,
 126:   0,        rhy_output, 0,      0,
 127:   raw_usrreq,
 128:   0,        0,      0,      0,
 129: },
 130: };
 131: 
 132: struct domain hydomain =
 133:     { AF_HYLINK, "hy", 0, 0, 0, hysw, &hysw[sizeof (hysw)/sizeof(hysw[0])] };
 134: #endif
 135: 
 136: #ifndef IPFORWARDING
 137: #define IPFORWARDING    1
 138: #endif
 139: 
 140: #ifndef IPSENDREDIRECTS
 141: #define IPSENDREDIRECTS 1
 142: #endif
 143: 
 144: #ifndef IPFORWARDSRCRT
 145: #if !defined(IPFORWARDING)
 146: #define IPFORWARDSRCRT  0
 147: #else
 148: #define IPFORWARDSRCRT  1
 149: #endif
 150: #endif
 151: 
 152: int ipforwarding = IPFORWARDING;
 153: int ipsendredirects = IPSENDREDIRECTS;
 154: int ipforward_srcrt = IPFORWARDSRCRT;
 155: int ip_defttl = IPDEFTTL;
 156: 
 157: #ifdef  GATEWAY
 158: int icmpmaskrepl = 1;
 159: #else
 160: int icmpmaskrepl = 0;
 161: #endif

Defined variables

hydomain defined in line 132; used 2 times
hysw defined in line 124; used 4 times
  • in line 133(4)
icmpmaskrepl defined in line 160; never used
impdomain defined in line 111; used 2 times
impsw defined in line 103; used 4 times
  • in line 113(4)
inetdomain declared in line 53; defined in line 96; used 8 times
inetsw defined in line 55; used 4 times
  • in line 98(4)
ip_defttl defined in line 155; never used
ipforward_srcrt defined in line 154; never used
ipforwarding defined in line 152; never used
ipsendredirects defined in line 153; never used

Defined macros

IPFORWARDING defined in line 137; used 3 times
IPFORWARDSRCRT defined in line 148; used 2 times
IPSENDREDIRECTS defined in line 141; used 2 times
Last modified: 1995-10-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3861
Valid CSS Valid XHTML 1.0 Strict