]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netat/at_ddp_brt.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1988, 1989 Apple Computer, Inc.
27 #ifndef _NETAT_AT_DDP_BRT_H_
28 #define _NETAT_AT_DDP_BRT_H_
29 #include <sys/appleapiopts.h>
31 #ifdef __APPLE_API_OBSOLETE
36 struct etalk_addr et_addr
;
40 #define BRT_SWEEP_INT (10 * PR_SLOWHZ)
41 #define BRT_BSIZ 4 /* bucket size */
42 #define BRT_NB 16 /* number of buckets */
43 #define BRTSIZE (BRT_BSIZ * BRT_NB)
46 #define BRT_EMPTY 0 /* the BRT entry is empty */
48 #define BRT_VALID 1 /* BRT entry contains valid */
50 #define BRT_GETTING_OLD 2 /* BRT entry is a candidate */
53 #define BRT_HASH(a) ((a) % BRT_NB)
55 #define BRT_LOOK(brt, dst_net) { \
57 brt = &at_ddp_brt[BRT_HASH(dst_net) * BRT_BSIZ]; \
58 for (n = 0 ; ; brt++) { \
59 if (brt->net == dst_net) \
61 if (++n >= BRT_BSIZ) { \
68 #define NEW_BRT(brt, net) { \
70 brt = &at_ddp_brt[BRT_HASH(net) * BRT_BSIZ]; \
71 for (n = 0 ; ; brt++) { \
72 if (brt->age_flag == BRT_EMPTY) \
74 if (++n >= BRT_BSIZ) { \
81 /* Best Router Cache */
82 extern ddp_brt_t at_ddp_brt
[BRTSIZE
];
84 #endif /* __APPLE_API_OBSOLETE */
85 #endif /* KERNEL_PRIVATE */
86 #endif /* _NETAT_AT_DDP_BRT_H_ */