]>
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 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
27 * Copyright (c) 1988, 1989 Apple Computer, Inc.
30 #ifndef _NETAT_AT_DDP_BRT_H_
31 #define _NETAT_AT_DDP_BRT_H_
32 #include <sys/appleapiopts.h>
33 #ifdef __APPLE_API_PRIVATE
38 struct etalk_addr et_addr
;
42 #define BRT_SWEEP_INT (10 * PR_SLOWHZ)
43 #define BRT_BSIZ 4 /* bucket size */
44 #define BRT_NB 16 /* number of buckets */
45 #define BRTSIZE (BRT_BSIZ * BRT_NB)
48 #define BRT_EMPTY 0 /* the BRT entry is empty */
50 #define BRT_VALID 1 /* BRT entry contains valid */
52 #define BRT_GETTING_OLD 2 /* BRT entry is a candidate */
55 #define BRT_HASH(a) ((a) % BRT_NB)
57 #define BRT_LOOK(brt, dst_net) { \
59 brt = &at_ddp_brt[BRT_HASH(dst_net) * BRT_BSIZ]; \
60 for (n = 0 ; ; brt++) { \
61 if (brt->net == dst_net) \
63 if (++n >= BRT_BSIZ) { \
70 #define NEW_BRT(brt, net) { \
72 brt = &at_ddp_brt[BRT_HASH(net) * BRT_BSIZ]; \
73 for (n = 0 ; ; brt++) { \
74 if (brt->age_flag == BRT_EMPTY) \
76 if (++n >= BRT_BSIZ) { \
83 /* Best Router Cache */
84 extern ddp_brt_t at_ddp_brt
[BRTSIZE
];
86 #endif /* __APPLE_API_PRIVATE */
87 #endif /* _NETAT_AT_DDP_BRT_H_ */