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
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _IPSEC_UTIL_H
27 #define _IPSEC_UTIL_H
28
29 /*
30 * Headers and definitions for support functions that are shared by
31 * the ipsec utilities ipseckey and ikeadm.
32 */
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #include <sys/types.h>
39 #include <sys/socket.h>
40 #include <net/pfkeyv2.h>
41 #include <netinet/in.h>
42 #include <inet/ip.h>
43 #include <setjmp.h>
44 #include <stdio.h>
208 extern int dbgstr2num(char *);
209
210 /* convert a string of debug strings with +|- delimiters to a debug level */
211 extern int parsedbgopts(char *);
212
213 /*
214 * SSL library (OpenSSL)
215 */
216 #define LIBSSL "libssl.so"
217
218 void libssl_load(void);
219
220 /*
221 * crypto library (OpenSSL)
222 */
223 #define LIBCRYPTO "libcrypto.so"
224
225 void libcrypto_load(void);
226
227 /*
228 * functions to manipulate the kmcookie-label mapping file
229 */
230
231 #define KMCFILE "/var/run/ipsec_kmc_map"
232
233 /*
234 * Insert a mapping into the file (if it's not already there), given the
235 * new label. Return the assigned cookie, or -1 on error.
236 */
237 extern int kmc_insert_mapping(char *);
238
239 /*
240 * Lookup the given cookie and return its corresponding label. Return
241 * a pointer to the label on success, NULL on error (or if the label is
242 * not found).
243 */
244 extern char *kmc_lookup_by_cookie(int);
245
246 /*
247 * These globals are declared for us in ipsec_util.c, since it needs to
248 * refer to them also...
|
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
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25 /*
26 * Copyright 2017 Joyent, Inc.
27 */
28
29 #ifndef _IPSEC_UTIL_H
30 #define _IPSEC_UTIL_H
31
32 /*
33 * Headers and definitions for support functions that are shared by
34 * the ipsec utilities ipseckey and ikeadm.
35 */
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #include <sys/types.h>
42 #include <sys/socket.h>
43 #include <net/pfkeyv2.h>
44 #include <netinet/in.h>
45 #include <inet/ip.h>
46 #include <setjmp.h>
47 #include <stdio.h>
211 extern int dbgstr2num(char *);
212
213 /* convert a string of debug strings with +|- delimiters to a debug level */
214 extern int parsedbgopts(char *);
215
216 /*
217 * SSL library (OpenSSL)
218 */
219 #define LIBSSL "libssl.so"
220
221 void libssl_load(void);
222
223 /*
224 * crypto library (OpenSSL)
225 */
226 #define LIBCRYPTO "libcrypto.so"
227
228 void libcrypto_load(void);
229
230 /*
231 * functions to manipulate the IKEv1 kmcookie-label mapping file
232 */
233
234 #define KMCFILE "/var/run/ipsec_kmc_map"
235
236 /*
237 * Insert a mapping into the file (if it's not already there), given the
238 * new label. Return the assigned cookie, or -1 on error.
239 */
240 extern int kmc_insert_mapping(char *);
241
242 /*
243 * Lookup the given cookie and return its corresponding label. Return
244 * a pointer to the label on success, NULL on error (or if the label is
245 * not found).
246 */
247 extern char *kmc_lookup_by_cookie(int);
248
249 /*
250 * These globals are declared for us in ipsec_util.c, since it needs to
251 * refer to them also...
|