3 * ===================================
4 * HARP | Host ATM Research Platform
5 * ===================================
8 * This Host ATM Research Platform ("HARP") file (the "Software") is
9 * made available by Network Computing Services, Inc. ("NetworkCS")
10 * "AS IS". NetworkCS does not provide maintenance, improvements or
11 * support of any kind.
13 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
14 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
15 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
16 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
17 * In no event shall NetworkCS be responsible for any damages, including
18 * but not limited to consequential damages, arising from or relating to
19 * any use of the Software or related support.
21 * Copyright 1994-1998 Network Computing Services, Inc.
23 * Copies of this Software may be made, however, the above copyright
24 * notice must be reproduced on all copies.
31 * Server Cache Synchronization Protocol (SCSP) Support
32 * ----------------------------------------------------
34 * SCSP-ATMARP server interface: control blocks
38 #ifndef _ATMARP_ATMARP_VAR_H
39 #define _ATMARP_ATMARP_VAR_H
50 * Operational constants
52 #define ATMARP_DIR "/tmp"
53 #define ATMARP_SOCK_PREFIX "AA_"
54 #define ATMARP_CACHE_INTERVAL 50
55 #define ATMARP_PERM_INTERVAL 600
56 #define ATMARP_KEEPALIVE_INTERVAL 5
60 * Macros for manipulating ATMARP tables and entries
62 #define ATMARP_HASHSIZ 19 /* Hash table size */
64 #define ATMARP_HASH(ip) ((u_long)(ip) % ATMARP_HASHSIZ)
66 #define ATMARP_ADD(ai, aa) \
69 h = &ai->ai_arptbl[ATMARP_HASH((aa)->aa_dstip.s_addr)]; \
70 LINK2TAIL((aa), Atmarp, *h, aa_next); \
73 #define ATMARP_DELETE(ai, aa) \
76 h = &ai->ai_arptbl[ATMARP_HASH((aa)->aa_dstip.s_addr)]; \
77 UNLINK((aa), Atmarp, *h, aa_next); \
80 #define ATMARP_LOOKUP(ai, ip, aa) \
82 for ((aa) = (ai)->ai_arptbl[ATMARP_HASH(ip)]; \
83 (aa); (aa) = (aa)->aa_next) { \
84 if ((aa)->aa_dstip.s_addr == (ip)) \
91 * Macro to compare originator ID structures
93 #define OID_EQUAL(id1, id2) \
94 (((id1)->id_len == (id2)->id_len) && \
95 (bcmp((caddr_t)(id1)->id, \
99 #define KEY_EQUAL(key1, key2) \
100 (((key1)->key_len == (key2)->key_len) && \
101 (bcmp((caddr_t)(key1)->key, \
102 (caddr_t)(key2)->key, \
103 (key1)->key_len) == 0))
107 * Interface entry for ATMARP SCSP interface daemon
110 struct atmarp_intf *ai_next; /* Next chained I/F */
111 char ai_intf[IFNAMSIZ]; /* Network I/F name */
112 struct in_addr ai_ip_addr; /* IP address */
113 struct in_addr ai_subnet_mask; /* Subnet mask */
114 int ai_mtu; /* IP MTU */
115 Atm_addr ai_atm_addr; /* ATM address */
116 Atm_addr ai_atm_subaddr; /* ATM subaddress */
117 int ai_scsp_sock; /* Socket to SCSP */
118 Harp_timer ai_keepalive_t; /* Keepalive timer */
119 char *ai_scsp_sockname; /* Socket name */
120 u_char ai_state; /* Interface state */
122 struct atmarp *ai_arptbl[ATMARP_HASHSIZ]; /* ARP cache */
124 typedef struct atmarp_intf Atmarp_intf;
126 #define AI_STATE_NULL 0
127 #define AI_STATE_UP 1
131 * Super-LIS control block for ATMARP server daemon
134 struct atmarp_slis *as_next; /* Next super-LIS */
135 char *as_name; /* Name of super-LIS */
136 int as_cnt; /* LIS count */
137 Atmarp_intf *as_intfs; /* List of intfs */
139 typedef struct atmarp_slis Atmarp_slis;
143 * ATMARP cache entry format
146 struct atmarp *aa_next; /* Hash chain link */
147 struct in_addr aa_dstip; /* Destination IP addr */
148 Atm_addr aa_dstatm; /* Destination ATM addr */
149 Atm_addr aa_dstatmsub; /* Destination ATM subaddr */
150 struct scsp_ckey aa_key; /* SCSP cache key */
151 struct scsp_id aa_oid; /* SCSP originator ID */
152 long aa_seq; /* SCSP sequence no. */
153 Atmarp_intf *aa_intf; /* Interface for entry */
154 u_char aa_flags; /* Flags (see below) */
155 u_char aa_origin; /* Entry origin */
156 char aa_mark; /* Mark */
158 typedef struct atmarp Atmarp;
163 #define AAF_PERM 0x01 /* Entry is permanent */
164 #define AAF_SERVER 0x02 /* Entry is for the server */
171 extern int atmarp_debug_mode;
172 extern int atmarp_max_socket;
173 extern Atmarp_intf *atmarp_intf_head;
174 extern Atmarp_slis *atmarp_slis_head;
175 extern FILE *atmarp_log_file;
179 * Function definitions
182 /* atmarp_config.c */
183 extern int atmarp_cfg_netif __P((char *));
187 extern void atmarp_log __P((const int, const char *, ...));
189 extern void atmarp_log __P((int, char *, va_alist));
191 extern void atmarp_mem_err __P((char *));
194 extern int atmarp_scsp_cache __P((Atmarp_intf *, Scsp_if_msg *));
195 extern int atmarp_scsp_update __P((Atmarp *, int));
196 extern int atmarp_scsp_update_in __P((Atmarp_intf *,
198 extern int atmarp_scsp_read __P((Atmarp_intf *));
199 extern int atmarp_scsp_out __P((Atmarp_intf *, char *, int));
200 extern int atmarp_scsp_connect __P((Atmarp_intf *));
201 extern void atmarp_scsp_close __P((Atmarp_intf *));
202 extern int atmarp_scsp_disconnect __P((Atmarp_intf *));
205 extern Atmarp_intf *atmarp_find_intf_sock __P((int));
206 extern Atmarp_intf *atmarp_find_intf_name __P((char *));
207 extern void atmarp_clear_marks __P(());
208 extern int atmarp_is_server __P((Atmarp_intf *));
209 extern int atmarp_if_ready __P((Atmarp_intf *));
210 extern Atmarp * atmarp_copy_cache_entry __P((struct air_arp_rsp *));
211 extern int atmarp_update_kernel __P((Atmarp *));
212 extern void atmarp_get_updated_cache __P(());
213 extern void atmarp_process_cache_entry __P((struct air_arp_rsp *));
214 extern void print_atmarp_intf __P((FILE *, Atmarp_intf *));
215 extern void print_atmarp_cache __P((FILE *, Atmarp *));
216 extern void dump_atmarp_cache __P((FILE *, Atmarp_intf *));
217 extern void atmarp_sigint __P((int));
220 extern void atmarp_cache_timeout __P((Harp_timer *));
221 extern void atmarp_perm_timeout __P((Harp_timer *));
222 extern void atmarp_keepalive_timeout __P((Harp_timer *));
225 #endif /* _ATMARP_ATMARP_VAR_H */