ip_ire.h (45916cd2) ip_ire.h (c793af95)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 21 unchanged lines hidden (view full) ---

30#pragma ident "%Z%%M% %I% %E% SMI"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#define IPV6_LL_PREFIXLEN 10 /* Number of bits in link-local pref */
37
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 21 unchanged lines hidden (view full) ---

30#pragma ident "%Z%%M% %I% %E% SMI"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#define IPV6_LL_PREFIXLEN 10 /* Number of bits in link-local pref */
37
38#define IP_FTABLE_HASH_SIZE 32 /* size of each hash table in ptrs */
39#define IP_CACHE_TABLE_SIZE 256
40#define IP_MRTUN_TABLE_SIZE 256 /* Mobile IP reverse tunnel table */
41 /* size. Only used by mipagent */
42#define IP_SRCIF_TABLE_SIZE 256 /* Per interface routing table size */
43#define IP_MASK_TABLE_SIZE (IP_ABITS + 1) /* 33 ptrs */
44
45#define IP6_FTABLE_HASH_SIZE 32 /* size of each hash table in ptrs */
46#define IP6_CACHE_TABLE_SIZE 256

--- 76 unchanged lines hidden (view full) ---

123#define MATCH_IRE_PARENT 0x2000 /* Match parent ire, if any, */
124 /* even if ire is not matched. */
125#define MATCH_IRE_ZONEONLY 0x4000 /* Match IREs in specified zone, ie */
126 /* don't match IRE_LOCALs from other */
127 /* zones or shared IREs */
128#define MATCH_IRE_MARK_PRIVATE_ADDR 0x8000 /* Match IRE ire_marks with */
129 /* IRE_MARK_PRIVATE_ADDR. */
130#define MATCH_IRE_SECATTR 0x10000 /* Match gateway security attributes */
38#define IP_CACHE_TABLE_SIZE 256
39#define IP_MRTUN_TABLE_SIZE 256 /* Mobile IP reverse tunnel table */
40 /* size. Only used by mipagent */
41#define IP_SRCIF_TABLE_SIZE 256 /* Per interface routing table size */
42#define IP_MASK_TABLE_SIZE (IP_ABITS + 1) /* 33 ptrs */
43
44#define IP6_FTABLE_HASH_SIZE 32 /* size of each hash table in ptrs */
45#define IP6_CACHE_TABLE_SIZE 256

--- 76 unchanged lines hidden (view full) ---

122#define MATCH_IRE_PARENT 0x2000 /* Match parent ire, if any, */
123 /* even if ire is not matched. */
124#define MATCH_IRE_ZONEONLY 0x4000 /* Match IREs in specified zone, ie */
125 /* don't match IRE_LOCALs from other */
126 /* zones or shared IREs */
127#define MATCH_IRE_MARK_PRIVATE_ADDR 0x8000 /* Match IRE ire_marks with */
128 /* IRE_MARK_PRIVATE_ADDR. */
129#define MATCH_IRE_SECATTR 0x10000 /* Match gateway security attributes */
130#define MATCH_IRE_COMPLETE 0x20000 /* ire_ftable_lookup() can return */
131 /* IRE_CACHE entry only if it is */
132 /* ND_REACHABLE */
131
133
134/*
135 * Any ire to nce association is long term, and
136 * the refhold and refrele may be done by different
137 * threads. So all cases of making or breaking ire to
138 * nce association should all effectively use the NOTR variants.
139 * To understand the *effectively* part read on.
140 *
141 * ndp_lookup() and ndp_add() implicitly does NCE_REFHOLD. So wherever we
142 * make ire to nce association after calling these functions,
143 * we effectively want to end up with NCE_REFHOLD_NOTR,
144 * We call this macro to achieve this effect. This macro changes
145 * a NCE_REFHOLD to a NCE_REFHOLD_NOTR. The macro's NCE_REFRELE
146 * cancels off ndp_lookup[ndp_add]'s implicit NCE_REFHOLD, and what
147 * you are left with is a NCE_REFHOLD_NOTR
148 */
149#define NCE_REFHOLD_TO_REFHOLD_NOTR(nce) { \
150 NCE_REFHOLD_NOTR(nce); \
151 NCE_REFRELE(nce); \
152}
153
132/* Structure for ire_cache_count() */
133typedef struct {
134 int icc_total; /* Total number of IRE_CACHE */
135 int icc_unused; /* # off/no PMTU unused since last reclaim */
136 int icc_offlink; /* # offlink without PMTU information */
137 int icc_pmtu; /* # offlink with PMTU information */
138 int icc_onlink; /* # onlink */
139} ire_cache_count_t;

--- 12 unchanged lines hidden (view full) ---

152typedef struct {
153 uint64_t ire_stats_alloced; /* # of ires alloced */
154 uint64_t ire_stats_freed; /* # of ires freed */
155 uint64_t ire_stats_inserted; /* # of ires inserted in the bucket */
156 uint64_t ire_stats_deleted; /* # of ires deleted from the bucket */
157} ire_stats_t;
158
159extern ire_stats_t ire_stats_v4;
154/* Structure for ire_cache_count() */
155typedef struct {
156 int icc_total; /* Total number of IRE_CACHE */
157 int icc_unused; /* # off/no PMTU unused since last reclaim */
158 int icc_offlink; /* # offlink without PMTU information */
159 int icc_pmtu; /* # offlink with PMTU information */
160 int icc_onlink; /* # onlink */
161} ire_cache_count_t;

--- 12 unchanged lines hidden (view full) ---

174typedef struct {
175 uint64_t ire_stats_alloced; /* # of ires alloced */
176 uint64_t ire_stats_freed; /* # of ires freed */
177 uint64_t ire_stats_inserted; /* # of ires inserted in the bucket */
178 uint64_t ire_stats_deleted; /* # of ires deleted from the bucket */
179} ire_stats_t;
180
181extern ire_stats_t ire_stats_v4;
182extern uint32_t ip_cache_table_size;
183extern uint32_t ip6_cache_table_size;
184extern irb_t *ip_cache_table;
185extern uint32_t ip6_ftable_hash_size;
160
161/*
162 * We use atomics so that we get an accurate accounting on the ires.
163 * Otherwise we can't determine leaks correctly.
164 */
165#define BUMP_IRE_STATS(ire_stats, x) atomic_add_64(&(ire_stats).x, 1)
166
167extern irb_t *ip_forwarding_table_v6[];

--- 17 unchanged lines hidden (view full) ---

185extern int ip_ire_delete(queue_t *, mblk_t *, cred_t *);
186extern boolean_t ip_ire_clookup_and_delete(ipaddr_t, ipif_t *);
187extern void ip_ire_clookup_and_delete_v6(const in6_addr_t *);
188
189extern int ip_ire_report(queue_t *, mblk_t *, caddr_t, cred_t *);
190extern int ip_ire_report_mrtun(queue_t *, mblk_t *, caddr_t, cred_t *);
191extern int ip_ire_report_srcif(queue_t *, mblk_t *, caddr_t, cred_t *);
192extern int ip_ire_report_v6(queue_t *, mblk_t *, caddr_t, cred_t *);
186
187/*
188 * We use atomics so that we get an accurate accounting on the ires.
189 * Otherwise we can't determine leaks correctly.
190 */
191#define BUMP_IRE_STATS(ire_stats, x) atomic_add_64(&(ire_stats).x, 1)
192
193extern irb_t *ip_forwarding_table_v6[];

--- 17 unchanged lines hidden (view full) ---

211extern int ip_ire_delete(queue_t *, mblk_t *, cred_t *);
212extern boolean_t ip_ire_clookup_and_delete(ipaddr_t, ipif_t *);
213extern void ip_ire_clookup_and_delete_v6(const in6_addr_t *);
214
215extern int ip_ire_report(queue_t *, mblk_t *, caddr_t, cred_t *);
216extern int ip_ire_report_mrtun(queue_t *, mblk_t *, caddr_t, cred_t *);
217extern int ip_ire_report_srcif(queue_t *, mblk_t *, caddr_t, cred_t *);
218extern int ip_ire_report_v6(queue_t *, mblk_t *, caddr_t, cred_t *);
219extern void ire_report_ftable(ire_t *, char *);
193
194extern void ip_ire_req(queue_t *, mblk_t *);
195
196extern int ip_mask_to_plen(ipaddr_t);
197extern int ip_mask_to_plen_v6(const in6_addr_t *);
198
199extern ire_t *ipif_to_ire(const ipif_t *);
200extern ire_t *ipif_to_ire_v6(const ipif_t *);
201
220
221extern void ip_ire_req(queue_t *, mblk_t *);
222
223extern int ip_mask_to_plen(ipaddr_t);
224extern int ip_mask_to_plen_v6(const in6_addr_t *);
225
226extern ire_t *ipif_to_ire(const ipif_t *);
227extern ire_t *ipif_to_ire_v6(const ipif_t *);
228
202extern int ire_add(ire_t **, queue_t *, mblk_t *, ipsq_func_t);
229extern int ire_add(ire_t **, queue_t *, mblk_t *, ipsq_func_t, boolean_t);
203extern int ire_add_mrtun(ire_t **, queue_t *, mblk_t *, ipsq_func_t);
204extern void ire_add_then_send(queue_t *, ire_t *, mblk_t *);
205extern int ire_add_v6(ire_t **, queue_t *, mblk_t *, ipsq_func_t);
206extern int ire_atomic_start(irb_t *irb_ptr, ire_t *ire, queue_t *q,
207 mblk_t *mp, ipsq_func_t func);
208extern void ire_atomic_end(irb_t *irb_ptr, ire_t *ire);
209
210extern void ire_cache_count(ire_t *, char *);

--- 64 unchanged lines hidden (view full) ---

275
276extern void ire_expire(ire_t *, char *);
277extern void ire_fastpath_flush(ire_t *, void *);
278extern boolean_t ire_fastpath_update(ire_t *, void *);
279
280extern void ire_flush_cache_v4(ire_t *, int);
281extern void ire_flush_cache_v6(ire_t *, int);
282
230extern int ire_add_mrtun(ire_t **, queue_t *, mblk_t *, ipsq_func_t);
231extern void ire_add_then_send(queue_t *, ire_t *, mblk_t *);
232extern int ire_add_v6(ire_t **, queue_t *, mblk_t *, ipsq_func_t);
233extern int ire_atomic_start(irb_t *irb_ptr, ire_t *ire, queue_t *q,
234 mblk_t *mp, ipsq_func_t func);
235extern void ire_atomic_end(irb_t *irb_ptr, ire_t *ire);
236
237extern void ire_cache_count(ire_t *, char *);

--- 64 unchanged lines hidden (view full) ---

302
303extern void ire_expire(ire_t *, char *);
304extern void ire_fastpath_flush(ire_t *, void *);
305extern boolean_t ire_fastpath_update(ire_t *, void *);
306
307extern void ire_flush_cache_v4(ire_t *, int);
308extern void ire_flush_cache_v6(ire_t *, int);
309
283extern ire_t *ire_ftable_lookup(ipaddr_t, ipaddr_t, ipaddr_t, int,
284 const ipif_t *, ire_t **, zoneid_t, uint32_t,
285 const struct ts_label_s *, int);
286
287extern ire_t *ire_ftable_lookup_v6(const in6_addr_t *, const in6_addr_t *,
288 const in6_addr_t *, int, const ipif_t *, ire_t **, zoneid_t,
289 uint32_t, const struct ts_label_s *, int);
290
291extern ire_t *ire_ihandle_lookup_onlink(ire_t *);
292extern ire_t *ire_ihandle_lookup_offlink(ire_t *, ire_t *);
293extern ire_t *ire_ihandle_lookup_offlink_v6(ire_t *, ire_t *);
294

--- 18 unchanged lines hidden (view full) ---

313extern ill_t *ire_to_ill(const ire_t *);
314
315extern void ire_walk(pfv_t, void *);
316extern void ire_walk_ill(uint_t, uint_t, pfv_t, void *, ill_t *);
317extern void ire_walk_ill_mrtun(uint_t, uint_t, pfv_t, void *, ill_t *);
318extern void ire_walk_ill_v4(uint_t, uint_t, pfv_t, void *, ill_t *);
319extern void ire_walk_ill_v6(uint_t, uint_t, pfv_t, void *, ill_t *);
320extern void ire_walk_v4(pfv_t, void *, zoneid_t);
310extern ire_t *ire_ftable_lookup_v6(const in6_addr_t *, const in6_addr_t *,
311 const in6_addr_t *, int, const ipif_t *, ire_t **, zoneid_t,
312 uint32_t, const struct ts_label_s *, int);
313
314extern ire_t *ire_ihandle_lookup_onlink(ire_t *);
315extern ire_t *ire_ihandle_lookup_offlink(ire_t *, ire_t *);
316extern ire_t *ire_ihandle_lookup_offlink_v6(ire_t *, ire_t *);
317

--- 18 unchanged lines hidden (view full) ---

336extern ill_t *ire_to_ill(const ire_t *);
337
338extern void ire_walk(pfv_t, void *);
339extern void ire_walk_ill(uint_t, uint_t, pfv_t, void *, ill_t *);
340extern void ire_walk_ill_mrtun(uint_t, uint_t, pfv_t, void *, ill_t *);
341extern void ire_walk_ill_v4(uint_t, uint_t, pfv_t, void *, ill_t *);
342extern void ire_walk_ill_v6(uint_t, uint_t, pfv_t, void *, ill_t *);
343extern void ire_walk_v4(pfv_t, void *, zoneid_t);
344extern void ire_walk_ill_tables(uint_t match_flags, uint_t ire_type,
345 pfv_t func, void *arg, size_t ftbl_sz, size_t htbl_sz,
346 irb_t **ipftbl, size_t ctbl_sz, irb_t *ipctbl, ill_t *ill,
347 zoneid_t zoneid);
321extern void ire_walk_srcif_table_v4(pfv_t, void *);
322extern void ire_walk_v6(pfv_t, void *, zoneid_t);
323
324extern boolean_t ire_multirt_lookup(ire_t **, ire_t **, uint32_t,
325 const struct ts_label_s *);
326extern boolean_t ire_multirt_need_resolve(ipaddr_t,
327 const struct ts_label_s *);
328extern boolean_t ire_multirt_lookup_v6(ire_t **, ire_t **, uint32_t,

--- 9 unchanged lines hidden (view full) ---

338extern void ire_fastpath_list_delete(ill_t *, ire_t *);
339
340extern mblk_t *ip_nexthop_route(const struct sockaddr *, char *);
341extern mblk_t *ip_nexthop(const struct sockaddr *, const char *);
342
343extern ire_t *ire_get_next_bcast_ire(ire_t *, ire_t *);
344extern ire_t *ire_get_next_default_ire(ire_t *, ire_t *);
345
348extern void ire_walk_srcif_table_v4(pfv_t, void *);
349extern void ire_walk_v6(pfv_t, void *, zoneid_t);
350
351extern boolean_t ire_multirt_lookup(ire_t **, ire_t **, uint32_t,
352 const struct ts_label_s *);
353extern boolean_t ire_multirt_need_resolve(ipaddr_t,
354 const struct ts_label_s *);
355extern boolean_t ire_multirt_lookup_v6(ire_t **, ire_t **, uint32_t,

--- 9 unchanged lines hidden (view full) ---

365extern void ire_fastpath_list_delete(ill_t *, ire_t *);
366
367extern mblk_t *ip_nexthop_route(const struct sockaddr *, char *);
368extern mblk_t *ip_nexthop(const struct sockaddr *, const char *);
369
370extern ire_t *ire_get_next_bcast_ire(ire_t *, ire_t *);
371extern ire_t *ire_get_next_default_ire(ire_t *, ire_t *);
372
373extern void ire_arpresolve(ire_t *, ill_t *);
374extern void ire_freemblk(ire_t *);
375extern void ire_fastpath(ire_t *);
376extern boolean_t ire_match_args(ire_t *, ipaddr_t, ipaddr_t, ipaddr_t,
377 int, const ipif_t *, zoneid_t, uint32_t, const struct ts_label_s *, int);
378extern int ire_nce_init(ire_t *, mblk_t *, mblk_t *);
379extern boolean_t ire_walk_ill_match(uint_t, uint_t, ire_t *, ill_t *,
380 zoneid_t);
381
346#endif /* _KERNEL */
347
348#ifdef __cplusplus
349}
350#endif
351
352#endif /* _INET_IP_IRE_H */
382#endif /* _KERNEL */
383
384#ifdef __cplusplus
385}
386#endif
387
388#endif /* _INET_IP_IRE_H */