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