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

Defined functions

null_hash defined in line 64; used 3 times
null_init defined in line 52; never used
null_netmatch defined in line 73; used 3 times

Defined variables

afswitch defined in line 45; used 2 times
  • in line 56(2)

Defined macros

AFINET defined in line 34; used 2 times
  • in line 46(2)
AFNS defined in line 42; used 1 times
  • in line 47
AFNULL defined in line 26; used 16 times
Last modified: 1988-04-27
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3296
Valid CSS Valid XHTML 1.0 Strict