Print this page
Current snapshot of OpenSolaris port.
Checkpoint
Checkpoint
Merge from parent.
Merge with WIDE update.
Pull from WIDE.
Pull from WIDE.
Checkpoint
Re-update.
blah
WIDE update
Update from WIDE.
| Split |
Close |
| Expand all |
| Collapse all |
--- old/iked/ike_pfkey.h
+++ new/iked/ike_pfkey.h
1 1 /* $Id: ike_pfkey.h,v 1.20 2008/02/05 09:03:22 mk Exp $ */
2 2
3 3 /*
4 4 * Copyright (C) 2004 WIDE Project.
5 5 * All rights reserved.
6 6 *
7 7 * Redistribution and use in source and binary forms, with or without
8 8 * modification, are permitted provided that the following conditions
9 9 * are met:
10 10 * 1. Redistributions of source code must retain the above copyright
11 11 * notice, this list of conditions and the following disclaimer.
12 12 * 2. Redistributions in binary form must reproduce the above copyright
13 13 * notice, this list of conditions and the following disclaimer in the
14 14 * documentation and/or other materials provided with the distribution.
15 15 * 3. Neither the name of the project nor the names of its contributors
16 16 * may be used to endorse or promote products derived from this software
17 17 * without specific prior written permission.
18 18 *
19 19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 29 * SUCH DAMAGE.
30 30 */
31 31
32 32 #ifndef __IKE_PFKEY_H__
33 33 #define __IKE_PFKEY_H__
34 34
35 35 #include <sys/types.h>
36 36 #include <sys/queue.h>
37 37 #if 1
38 38 /* #include "if_pfkeyv2.h" */
39 39 #else
40 40 #include "if_pfkey.h"
41 41 #endif
42 42
43 43 #include "var.h"
44 44
45 45 /*
46 46 * +--------------------+
47 47 * |child_sa |
48 48 * +--------------------+ +--------------------+
49 49 * | | ..|(*getspi)() ------->sadb_getspi()
50 50 * |+------------+ | : |(*acquire_error)() ------>sadb_acquire_error()
51 51 * ||sadb_request|......... |(*update_inbound)() ------->sadb_update()
52 52 * || |... | |(*update_outbound)() ------->sadb_add()
53 53 * |+------------+ : | +--------------------+
54 54 * | : |
55 55 * +----------------:---+
56 56 * ........(*getspi_response)()
57 57 */
58 58
59 59 /*
60 60 * conf_to_proposal ikev2_child_proposal_spi<---+
61 61 * | ^ |
62 62 * | |(*req->method->getspi)() |(*req->getspi_response)()
63 63 * v | |
64 64 * sadb_getspi |
65 65 * | ^ sadb_getspi_callback
66 66 * | | ^
67 67 * | | | |
68 68 * v | | |
69 69 * rcpfk_send_getspi v |
70 70 * | ^ rcpfk_handler---->rcpfk_recv_getspi
71 71 * | | ^
72 72 * | | :
73 73 * v | :
74 74 * SADB_GETSPI --------------[response]
|
↓ open down ↓ |
74 lines elided |
↑ open up ↑ |
75 75 *
76 76 */
77 77
78 78 struct sadb_request_method {
79 79 int (*getspi) ();
80 80 int (*acquire_error) ();
81 81 int (*update_inbound) ();
82 82 int (*add_outbound) ();
83 83 int (*delete_sa) ();
84 84 int (*get) ();
85 +#ifdef sun
86 + int (*inverse_acquire)();
87 +#endif /* sun/OpenSolaris */
85 88 };
86 89
87 90 struct sadb_response_method {
88 91 int (*getspi_response)();
89 92 int (*update_response)();
90 93 int (*expired)();
91 94 int (*get_response)();
92 95 };
93 96
94 97 #define SADB_LIST_HEAD(nam_, typ_) TAILQ_HEAD(nam_, typ_)
95 98 #define SADB_LIST_INIT(head_) TAILQ_INIT(head_)
96 99 #define SADB_LIST_ENTRY(typ_) TAILQ_ENTRY(typ_)
97 100 #define SADB_LIST_FIRST(head_) ((head_)->tqh_first)
98 101 #define SADB_LIST_NEXT(p_) TAILQ_NEXT((p_), link)
99 102 #define SADB_LIST_END(p_) (! (p_))
100 103 #define SADB_LIST_LINK(head_, p_) TAILQ_INSERT_TAIL((head_), (p_), link)
101 104 #define SADB_LIST_REMOVE(head_, p_) TAILQ_REMOVE((head_), (p_), link)
102 105
103 106 struct sadb_request {
104 107 struct sadb_request_method *method;
105 108 struct sadb_response_method *callback;
106 109 uint32_t seqno;
107 110 /* pid_t pid; */
108 111 void *sa; /* should be a pointer to child_sa */
109 112
110 113 SADB_LIST_ENTRY(sadb_request) link;
111 114 };
112 115
113 116 extern struct sadb_request_method sadb_initiator_request_method;
114 117 extern struct sadb_request_method sadb_responder_request_method;
115 118 extern struct sadb_request_method sadb_rekey_request_method;
116 119 extern struct sadb_request_method sadb_null_method;
117 120 extern struct sadb_request_method sadb_force_initiate_method;
118 121
119 122 /* #ifdef DEBUG */
120 123 extern struct sadb_request_method sadb_debug_method;
121 124 /* #endif */
122 125 #endif
123 126
124 127 extern int sadb_init(void);
125 128 #ifdef DEBUG
126 129 void sadb_list_dump(void);
|
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
127 130 #endif
128 131 extern int sadb_socket(void);
129 132 extern uint32_t sadb_new_seq(void);
130 133 extern void sadb_poll(void);
131 134 extern void sadb_request_initialize(struct sadb_request *,
132 135 struct sadb_request_method *,
133 136 struct sadb_response_method *,
134 137 uint32_t,
135 138 void *);
136 139 extern void sadb_request_finish(struct sadb_request *);
140 +#ifdef sun
141 +#ifndef _INVACQ_T
142 +#define _INVACQ_T /* Guard against double-include. */
143 +typedef struct invacq_s {
144 + /* IKEv1 data */
145 + struct ph2handle *iph2; /* Referenced */
146 +
147 + /* IKEv2 data */
148 + struct ikev2_sa *ikev2_sa; /* Referenced */
149 + struct sockaddr *local; /* Alloced/copied */
150 + struct sockaddr *remote; /* Alloced/copied */
151 + struct ikev2_payload_header *sa_payload;/* Alloced/copied */
152 + struct ikev2_payload_header *ts_i; /* Alloced/copied */
153 + struct ikev2_payload_header *ts_r; /* Alloced/copied */
154 + struct ikev2_payload_header *cfg; /* Alloced/copied */
155 + rc_vchar_t *g_i; /* Alloced/copied */
156 + rc_vchar_t *n_i; /* Alloced/copied */
157 + struct ikev2_child_param *child_param; /* Alloced/copied */
158 + struct ikev2_child_sa *old_child_sa; /* Referenced. */
159 + uint32_t message_id; /* Copied */
160 + boolean_t is_createchild; /* Copied */
161 + rc_vchar_t *packet;
162 +
163 + /* inverse-ACQUIRE data. */
164 + struct rcpfk_msg *answer;
165 + int (*receiver)(struct invacq_s *);
166 + struct sadb_request request;
167 +} invacq_t;
168 +#endif
169 +extern int extract_extended_acquire(struct rcpfk_msg *, struct rcf_selector **,
170 + struct rcf_remote **);
171 +#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX