further fixes, rn_inithead called with wrong offsets and
[unix-history] / usr / src / sys / netiso / tuba_table.h
CommitLineData
1ff4d8b6 1/*-
10cc936d
KB
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
1ff4d8b6
KS
4 *
5 * %sccs.include.redist.c%
6 *
2c604b97 7 * @(#)tuba_table.h 8.2 (Berkeley) %G%
1ff4d8b6
KS
8 */
9
10struct tuba_cache {
11 struct radix_node tc_nodes[2]; /* convenient lookup */
12 int tc_refcnt;
13 int tc_time; /* last looked up */
14 int tc_flags;
15#define TCF_PERM 1
16 int tc_index;
8c53a772
KS
17 u_short tc_sum; /* cksum of nsap inc. length */
18 u_short tc_ssum; /* swab(tc_sum) */
ff38aee7 19 struct sockaddr_iso tc_siso; /* for responding */
2c604b97 20 struct iso_addr tc_addr;
1ff4d8b6
KS
21};
22
77db2796
KS
23#define ADDCARRY(x) (x >= 65535 ? x -= 65535 : x)
24#define REDUCE(a, b) { union { u_short s[2]; long l;} l_util; long x; \
8c53a772
KS
25 l_util.l = (b); x = l_util.s[0] + l_util.s[1]; ADDCARRY(x); \
26 if (x == 0) x = 0xffff; a = x;}
7cfe65b5
KS
27#define SWAB(a, b) { union { u_char c[2]; u_short s;} s; u_char t; \
28 s.s = (b); t = s.c[0]; s.c[0] = s.c[1]; s.c[1] = t; a = s.s;}
1ff4d8b6
KS
29
30#ifdef KERNEL
7cfe65b5
KS
31extern int tuba_table_size;
32extern struct tuba_cache **tuba_table;
33extern struct radix_node_head *tuba_tree;
1ff4d8b6 34#endif