2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * Headers and definitions for support functions that are shared by 2N/A * the ipsec utilities ipseckey and ikeadm. 2N/A/* macros for array manipulation */ 2N/A/* used for file parsing */ 2N/A * Input buffer size limits maximum line length for both file parsing and 2N/A * interactive mode. 4K chars should be enough even for broad commands and 2N/A * all possible key lengths of today's symmetric ciphers entered via 2N/A * ipseckey(1M) which has the most bifurcated grammar from all IPsec commands. 2N/A/* used for command-line parsing */ 2N/A/* Flags for {bytecnt,secs}2out() */ 2N/A#
define SPC_BEGIN 0x00000001 /* put space at the beginning */ 2N/A#
define SPC_END 0x00000002 /* put space at the end */ 2N/A * The following lengths should be sufficient for character buffers passed to 2N/A * bytecnt2str(),secs2str(). This is because the string output of these 2N/A * functions consists of limited number and units. The lengths should be also 2N/A * sufficient for bytecnt2out(),secs2out() functions. 2N/A * Time printing defines... 2N/A * TBUF_SIZE is pretty arbitrary. Perhaps it shouldn't be. 2N/A * Solaris UDP port used to communicate with the Solaris Cluster 2N/A * daemon. It is used only when the node is booted in cluster mode. 2N/A/* For keyword-lookup tables */ 2N/A * These different exit states are designed to give consistant behaviour 2N/A * when a program needs to exit because of an error. These exit_types 2N/A * are used in macros, defined later in this file, which call ipsecutil_exit(). 2N/A * What happens when ipsecutil_exit() may differ if the command was started 2N/A * on the command line or via smf(5), See ipsecutil_exit() source for details. 2N/A * Note: The calling function should decide what "debug mode" is before calling 2N/A * ipsecutil_exit() with DEBUG_FATAL. 2N/A * Function Prototypes 2N/A * Print errno and if cmdline or readfile, exit; if interactive reset state 2N/A * Localization macro - Only to be used from usr/src/cmd because Macros 2N/A * are not expanded in usr/src/lib when message catalogs are built. 2N/A * Print caller-supplied, variable-arg error message, then exit if cmdline 2N/A * or readfile, or reset state if interactive. 2N/A * dump_XXX functions produce ASCII output from the passed in data. 2N/A * Because certain errors need to do this stderr, dump_XXX functions 2N/A * take a FILE pointer. 2N/A/* return true if sadb string is printable (based on type), false otherwise */ 2N/A * do_interactive: Enter a mode where commands are read from a file; 2N/A * treat stdin special. infile is the file cmds are read from; 2N/A * promptstring is the string printed to stdout (if the cmds are 2N/A * being read from stdin) to prompt for a new command; parseit is 2N/A * the function to be called to process the command line once it's 2N/A/* callback function passed in to do_interactive() */ 2N/A/* convert a string to an IKE_PRIV_* constant */ 2N/A/* convert a string to a D_* debug flag */ 2N/A/* convert a string of debug strings with +|- delimiters to a debug level */ 2N/A * SSL library (OpenSSL) 2N/A * crypto library (OpenSSL) 2N/A * functions to manipulate the kmcookie-label mapping file 2N/A * Insert a mapping into the file (if it's not already there), given the 2N/A * new label. Return the assigned cookie, or -1 on error. 2N/A * Lookup the given cookie and return its corresponding label. Return 2N/A * a pointer to the label on success, NULL on error (or if the label is 2N/A * refer to them also... 2N/A/* For error recovery in interactive or read-file mode. */ 2N/A * Back-end stuff for getalgby*(). 2N/A * - A dynamically-grown (optionally sorted) array of IPsec protocols 2N/A * - Each protocol has an array (again, dynamically grown and sorted) 2N/A * of algorithms, each a full-fledged struct ipsecalgent. 2N/A * - The getipsecalg*() routines will search the list, then duplicate the 2N/A * struct ipsecalgent and return it. 2N/A * Helper definitions for indices into array of key sizes when key sizes 2N/A * are defined by range. 2N/A/* Error codes for IPsec algorithms management */ 2N/A/* Put these in libnsl for and process caching testing. */ 2N/A/* spdsock support functions */ 2N/A/* Return values for spdsock_get_ext(). */ 2N/A/* PF_KEY (keysock) support functions */ 2N/A/* SA support functions */ 2N/A * Label conversion convenience functions. 2N/A * These exit macros give a consistent exit behaviour for all 2N/A * programs that use libipsecutil. These wll work in usr/src/cmd 2N/A * expanded when I18N message catalogs are built, avoid using 2N/A * these with text inside libipsecutil. See source of ipsecutil_exit() 2N/A#
endif /* _IPSEC_UTIL_H */