2 .\" Copyright (C) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH GETIPSECALGBYNAME 3NSL "Aug 20, 2003"
8 getipsecalgbyname, getipsecalgbynum, freeipsecalgent \- query algorithm mapping
13 \fBcc\fR \fB-flag \&.\|.\|.\fR \fIfile\fR \&.\|.\|.\fB-l\fRnsl [\fB -library \&.\|.\|. \fR]
18 \fBstruct ipsecalgent *\fR\fBgetipsecalgbyname\fR
19 (\fBconst char *\fR\fIalg_name\fR, \fBint\fR \fIprotocol_num\fR, \fBint *\fR\fIerrnop\fR
24 \fBstruct ipsecalgent *\fR\fBgetipsecalgbynum\fR(\fBint\fR \fIalg_num\fR, \fBint\fR \fIprotocol_num\fR,
25 \fBint *\fR\fIerrnop\fR
30 \fBvoid\fR \fBfreeipsecalgent\fR(\fBstruct ipsecalgent *\fR\fIptr\fR
36 Use the \fBgetipsecalgbyname()\fR, \fBgetipsecalgbynum()\fR,
37 \fBfreeipsecalgent()\fR functions to obtain the IPsec algorithm mappings that
38 are defined by \fBipsecalgs\fR(1M). The IPsec algorithms and associated
39 protocol name spaces are defined by \fIRFC 2407\fR.
42 \fBgetipsecalgbyname()\fR and \fBgetipsecalgbynum()\fR return a structure that
43 describes the algorithm entry found. This structure is described in the
44 \fBRETURN VALUES\fR section below.
47 \fBfreeipsecalgent()\fR must be used by the caller to free the structures
48 returned by \fBgetipsecalgbyname()\fR and \fBgetipsecalgbynum()\fR when they
52 Both \fBgetipsecalgbyname()\fR and \fBgetipsecalgbynum()\fR take as parameter
53 the protocol identifier in which the algorithm is defined. See
54 \fBgetipsecprotobyname\fR(3NSL) and \fBgetipsecprotobyname\fR(3NSL).
57 The following protocol numbers are pre-defined:
61 \fB\fBIPSEC_PROTO_ESP\fR\fR
64 Defines the encryption algorithms (transforms) that can be used by IPsec to
65 provide data confidentiality.
71 \fB\fBIPSEC_PROTO_AH\fR\fR
74 Defines the authentication algorithms (transforms) that can be used by IPsec to
75 provide authentication.
80 \fBgetipsecalgbyname()\fR looks up the algorithm by its name, while
81 \fBgetipsecalgbynum()\fR looks up the algorithm by its assigned number.
89 A pointer to an integer used to return an error status value on certain error
90 conditions. See \fBERRORS\fR.
96 The \fBgetipsecalgbyname()\fR and \fBgetipsecalgbynum()\fR functions return a
97 pointer to the structure \fBipsecalgent_t\fR, defined in <\fBnetdb.h\fR>. If
98 the requested algorithm cannot be found, these functions return \fINULL\fR.
101 The structure \fBipsecalgent_t\fR is defined as follows:
105 typedef struct ipsecalgent {
106 char **a_names; /* algorithm names */
107 int a_proto_num; /* protocol number */
108 int a_alg_num; /* algorithm number */
109 char *a_mech_name; /* mechanism name */
110 int *a_block_sizes; /* supported block sizes */
111 int *a_key_sizes; /* supported key sizes */
112 int a_key_increment; /* key size increment */
119 If \fBa_key_increment\fR is non-zero, \fBa_key_sizes[0]\fR contains the default
120 key size for the algorithm. \fBa_key_sizes[1]\fR and \fBa_key_sizes[2]\fR
121 specify the smallest and biggest key sizes support by the algorithm, and
122 \fBa_key_increment\fR specifies the valid key size increments in that range.
125 If \fBa_key_increment\fR is zero, the array \fBa_key_sizes\fR contains the set
126 of key sizes, in bits, supported by the algorithm. The last key length in the
127 array is followed by an element of value \fB0\fR. The first element of this
128 array is used as the default key size for the algorithm.
131 \fBa_name\fR is an array of algorithm names, terminated by an element
132 containing a \fINULL\fR pointer. \fBa_name[0]\fR is the primary name for the
136 \fBa_proto_num\fR is the protocol identifer of this algorithm. \fBa_alg_num\fR
137 is the algorithm number. \fBa_mech_name\fR contains the mechanism name
138 associated with the algorithm.
141 \fBa_block_sizes\fR is an array containing the supported block lengths or MAC
142 lengths, in bytes, supported by the algorithm. The last valid value in the
143 array is followed by an element containing the value \fB0\fR.
147 When the specified algorithm cannot be returned to the caller,
148 \fBgetipsecalgbynam()\fR and \fBgetipsecalgbynum()\fR return a value of
149 \fINULL\fR and set the integer pointed to by the \fIerrnop\fR parameter to one
150 of the following values:
166 Specified algorithm not found
175 Specified protocol number not found
181 See \fBattributes\fR(5) for descriptions of the following attributes:
189 ATTRIBUTE TYPE ATTRIBUTE VALUE
192 Interface Stability Evolving
198 \fBcryptoadm\fR(1M), \fBipsecalgs\fR(1M), \fBgetipsecprotobyname\fR(3NSL),
199 \fBgetipsecprotobyname\fR(3NSL), \fBattributes\fR(5)
202 Piper, D. \fIRFC 2407, The Internet IP Security Domain of Interpretation for
203 ISAKMP\fR. Network Working Group. November, 1998.