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
Defined variables
Defined macros
AFNS
defined in line
36; used 1 times
AFNULL
defined in line
20; used 16 times