|
|
1.1 ! root 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 the above copyright notice and this paragraph are ! 7: * duplicated in all such forms and that any documentation, ! 8: * advertising materials, and other materials related to such ! 9: * distribution and use acknowledge that the software was developed ! 10: * by the University of California, Berkeley. The name of the ! 11: * University may not be used to endorse or promote products derived ! 12: * from this software without specific prior written permission. ! 13: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 14: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 15: * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 16: * ! 17: * @(#)af.c 7.4 (Berkeley) 6/27/88 ! 18: */ ! 19: ! 20: #include "param.h" ! 21: #include "mbuf.h" ! 22: #include "protosw.h" ! 23: #include "socket.h" ! 24: #include "socketvar.h" ! 25: #include "af.h" ! 26: ! 27: /* ! 28: * Address family support routines ! 29: */ ! 30: int null_hash(), null_netmatch(); ! 31: #define AFNULL \ ! 32: { null_hash, null_netmatch } ! 33: ! 34: #ifdef INET ! 35: extern int inet_hash(), inet_netmatch(); ! 36: #define AFINET \ ! 37: { inet_hash, inet_netmatch } ! 38: #else ! 39: #define AFINET AFNULL ! 40: #endif ! 41: ! 42: #ifdef NS ! 43: extern int ns_hash(), ns_netmatch(); ! 44: #define AFNS \ ! 45: { ns_hash, ns_netmatch } ! 46: #else ! 47: #define AFNS AFNULL ! 48: #endif ! 49: ! 50: struct afswitch afswitch[AF_MAX] = { ! 51: AFNULL, AFNULL, AFINET, AFINET, AFNULL, ! 52: AFNULL, AFNS, AFNULL, AFNULL, AFNULL, ! 53: AFNULL, AFNULL, AFNULL, AFNULL, AFNULL, ! 54: AFNULL, AFNULL, /* through 16 */ ! 55: }; ! 56: ! 57: null_init() ! 58: { ! 59: register struct afswitch *af; ! 60: ! 61: for (af = afswitch; af < &afswitch[AF_MAX]; af++) ! 62: if (af->af_hash == (int (*)())NULL) { ! 63: af->af_hash = null_hash; ! 64: af->af_netmatch = null_netmatch; ! 65: } ! 66: } ! 67: ! 68: /*ARGSUSED*/ ! 69: null_hash(addr, hp) ! 70: struct sockaddr *addr; ! 71: struct afhash *hp; ! 72: { ! 73: ! 74: hp->afh_nethash = hp->afh_hosthash = 0; ! 75: } ! 76: ! 77: /*ARGSUSED*/ ! 78: null_netmatch(a1, a2) ! 79: struct sockaddr *a1, *a2; ! 80: { ! 81: ! 82: return (0); ! 83: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.