8446 uts: pci_check_bios() should check for BIOS
[unleashed.git] / include / inet / spdsock.h
blob7cc065d7404226d419ef127b6ca32d68ea01781b
1 /*
2 * CDDL HEADER START
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.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _INET_SPDSOCK_H
26 #define _INET_SPDSOCK_H
28 #include <sys/netstack.h>
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
35 * SPDSOCK stack instances
37 struct spd_stack {
38 netstack_t *spds_netstack; /* Common netstack */
40 caddr_t spds_g_nd;
41 struct spdsockparam_s *spds_params;
42 kmutex_t spds_param_lock;
43 /* Protects the NDD variables. */
46 * To save algorithm update messages that are processed only after
47 * IPsec is loaded.
49 struct spd_ext *spds_extv_algs[SPD_EXT_MAX + 1];
50 mblk_t *spds_mp_algs;
51 struct ipsec_alginfo
52 *spds_algs[IPSEC_NALGTYPES][IPSEC_MAX_ALGS];
53 int spds_algs_exec_mode[IPSEC_NALGTYPES];
54 kmutex_t spds_alg_lock;
56 typedef struct spd_stack spd_stack_t;
60 * spdsock (PF_POLICY) session state; one per open PF_POLICY socket.
62 * These are kept on a linked list by the spdsock module.
65 typedef struct spdsock_s
67 uint_t spdsock_state; /* TLI gorp */
69 minor_t spdsock_minor;
72 * In-progress SPD_DUMP state, valid if spdsock_dump_req is non-NULL.
74 * spdsock_dump_req is the request which got us started.
75 * spdsock_dump_head is a reference to a policy head.
76 * spdsock_dump_cur_* tell us where we are in the policy walk,
77 * validated by looking at spdsock_dump_gen vs
78 * dump_head->iph_gen after taking a read lock on the policy
79 * head.
81 mblk_t *spdsock_dump_req;
82 ipsec_policy_head_t *spdsock_dump_head;
83 uint64_t spdsock_dump_gen;
84 timeout_id_t spdsock_timeout;
85 mblk_t *spdsock_timeout_arg;
86 int spdsock_dump_cur_type;
87 int spdsock_dump_cur_af;
88 ipsec_policy_t *spdsock_dump_cur_rule;
89 uint32_t spdsock_dump_cur_chain;
90 uint32_t spdsock_dump_count;
91 spd_stack_t *spdsock_spds;
92 /* These are used for all-polhead dumps. */
93 int spdsock_dump_tun_gen;
94 boolean_t spdsock_dump_active;
95 boolean_t spdsock_dump_tunnel;
96 int spdsock_dump_remaining_polheads;
97 ipsec_tun_pol_t *spdsock_itp;
98 } spdsock_t;
100 #define LOADCHECK_INTERVAL (drv_usectohz(30000))
103 * Socket option boilerplate code.
106 extern optdb_obj_t spdsock_opt_obj;
107 extern uint_t spdsock_max_optsize;
109 extern int spdsock_opt_get(queue_t *, int, int, uchar_t *);
110 extern int spdsock_opt_set(queue_t *, uint_t, int, int, uint_t, uchar_t *,
111 uint_t *, uchar_t *, void *, cred_t *);
113 #ifdef __cplusplus
115 #endif
117 #endif /* _INET_SPDSOCK_H */