1: /*
   2:  * Copyright (c) 1983, 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:  *	@(#)af.c	7.1 (Berkeley) 6/4/86
   7:  */
   8: 
   9: #include "param.h"
  10: #include "mbuf.h"
  11: #include "protosw.h"
  12: #include "socket.h"
  13: #include "socketvar.h"
  14: #include "af.h"
  15: 
  16: /*
  17:  * Address family support routines
  18:  */
  19: int null_hash(), null_netmatch();
  20: #define AFNULL \
  21:     { null_hash,    null_netmatch }
  22: 
  23: #ifdef INET
  24: extern int inet_hash(), inet_netmatch();
  25: #define AFINET \
  26:     { inet_hash,    inet_netmatch }
  27: #else
  28: #define AFINET  AFNULL
  29: #endif
  30: 
  31: #ifdef NS
  32: extern int ns_hash(), ns_netmatch();
  33: #define AFNS \
  34:     { ns_hash,  ns_netmatch }
  35: #else
  36: #define AFNS    AFNULL
  37: #endif
  38: 
  39: struct afswitch afswitch[AF_MAX] = {
  40:     AFNULL, AFNULL, AFINET, AFINET, AFNULL,
  41:     AFNULL, AFNS,   AFNULL, AFNULL, AFNULL,
  42:     AFNULL, AFNULL, AFNULL, AFNULL, AFNULL,
  43:     AFNULL, AFNULL,                 /* through 16 */
  44: };
  45: 
  46: null_init()
  47: {
  48:     register struct afswitch *af;
  49: 
  50:     for (af = afswitch; af < &afswitch[AF_MAX]; af++)
  51:         if (af->af_hash == (int (*)())NULL) {
  52:             af->af_hash = null_hash;
  53:             af->af_hash = null_hash;
  54:         }
  55: }
  56: 
  57: /*ARGSUSED*/
  58: null_hash(addr, hp)
  59:     struct sockaddr *addr;
  60:     struct afhash *hp;
  61: {
  62: 
  63:     hp->afh_nethash = hp->afh_hosthash = 0;
  64: }
  65: 
  66: /*ARGSUSED*/
  67: null_netmatch(a1, a2)
  68:     struct sockaddr *a1, *a2;
  69: {
  70: 
  71:     return (0);
  72: }

Defined functions

null_hash defined in line 58; used 4 times
null_init defined in line 46; used 1 times
null_netmatch defined in line 67; used 2 times

Defined variables

afswitch defined in line 39; used 2 times
  • in line 50(2)

Defined macros

AFINET defined in line 28; used 2 times
  • in line 40(2)
AFNS defined in line 36; used 1 times
  • in line 41
AFNULL defined in line 20; used 16 times
Last modified: 1986-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1074
Valid CSS Valid XHTML 1.0 Strict