#ifndef _INET_IP6_ASP_H
#define _INET_IP6_ASP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <netinet/in.h>
#include <sys/types.h>
#include <inet/ip6.h>
#define IP6_ASP_MAXLABELSIZE 16
typedef struct ip6_asp {
in6_addr_t ip6_asp_prefix;
in6_addr_t ip6_asp_mask;
union {
char iau_label_c[IP6_ASP_MAXLABELSIZE];
int64_t iau_label_i[IP6_ASP_MAXLABELSIZE / sizeof (int64_t)];
} ip6_asp_u;
uint32_t ip6_asp_precedence;
} ip6_asp_t;
#define ip6_asp_label ip6_asp_u.iau_label_c
#if defined(_SYSCALL32) && _LONG_LONG_ALIGNMENT_32 == 4
typedef struct ip6_asp32 {
in6_addr_t ip6_asp_prefix;
in6_addr_t ip6_asp_mask;
union {
char iau_label_c[IP6_ASP_MAXLABELSIZE];
int32_t iau_label_i[IP6_ASP_MAXLABELSIZE / sizeof (int32_t)];
} ip6_asp_u;
uint32_t ip6_asp_precedence;
} ip6_asp32_t;
#endif
#define IP6_ASP_TABLE_REFHOLD(ipst) { \
ipst->ips_ip6_asp_refcnt++; \
ASSERT(ipst->ips_ip6_asp_refcnt != 0); \
}
#define IP6_ASP_TABLE_REFRELE(ipst) { \
mutex_enter(&ipst->ips_ip6_asp_lock); \
ASSERT(ipst->ips_ip6_asp_refcnt != 0); \
if (--ipst->ips_ip6_asp_refcnt == 0) { \
mutex_exit(&ipst->ips_ip6_asp_lock); \
ip6_asp_check_for_updates(ipst); \
} else { \
mutex_exit(&ipst->ips_ip6_asp_lock); \
} \
}
struct dstinforeq {
in6_addr_t dir_daddr;
in6_addr_t dir_saddr;
in6addr_scope_t dir_dscope;
in6addr_scope_t dir_sscope;
t_uscalar_t dir_dmactype;
uint32_t dir_precedence;
uint8_t dir_dreachable : 1,
dir_sdeprecated : 1,
dir_labelmatch: 1,
dir_padbits : 5;
};
#ifdef _KERNEL
typedef void (*aspfunc_t)(ipsq_t *, queue_t *, mblk_t *, void *);
extern void ip6_asp_free(ip_stack_t *);
extern void ip6_asp_init(ip_stack_t *);
extern boolean_t ip6_asp_can_lookup(ip_stack_t *);
extern void ip6_asp_table_refrele(ip_stack_t *);
extern char *ip6_asp_lookup(const in6_addr_t *, uint32_t *, ip_stack_t *);
extern void ip6_asp_replace(mblk_t *mp, ip6_asp_t *, size_t, boolean_t,
ip_stack_t *, model_t);
extern int ip6_asp_get(ip6_asp_t *, size_t, ip_stack_t *);
extern boolean_t ip6_asp_labelcmp(const char *, const char *);
extern void ip6_asp_pending_op(queue_t *, mblk_t *, aspfunc_t);
#endif
#ifdef __cplusplus
}
#endif
#endif