'\" te .\" Copyright (C) 2003, Sun Microsystems, Inc. All Rights Reserved .\" 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. .\" 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. .\" 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] .TH GETIPSECPROTOBYNAME 3NSL "Aug 13, 2003" .SH NAME getipsecprotobyname, getipsecprotobynum \- query IPsec protocols entries .SH SYNOPSIS .LP .nf \fBcc \fR\fB-flag \&.\|.\|.\fR \fIfile \fR\&.\|.\|.\fB-l\fRnsl [\fB -library \&.\|.\|. \fR] #include \fBint\fR \fBgetipsecprotobyname\fR(\fBconst char *\fR\fIproto_name\fR .fi .LP .nf \fBchar *\fR\fBgetipsecprotobynum\fR(\fBint\fR \fIproto_num\fRp .fi .SH DESCRIPTION .sp .LP Use the \fBgetipsecprotobyname()\fR and \fBgetipsecprotobynum()\fR functions to obtain the IPsec algorithm mappings that are defined by \fBipsecalgs\fR(1M). You can also use the \fBgetipsecprotobyname()\fR and \fBgetipsecprotobynum()\fR functions in conjunction with \fBgetipsecalgbyname\fR(3NSL) and \fBgetipsecalgbynum\fR(3NSL) to obtain information about the supported IPsec algorithms. The IPsec algorithms and associated protocol name spaces are defined by \fIRFC 2407\fR. .sp .LP \fBgetipsecprotobyname()\fR takes as an argument the name of an IPsec protocol and returns its assigned protocol number. The character string returned by the \fBgetipsecprotobyname()\fR function must be freed by the called when it is no longer needed. .sp .LP \fBgetipsecprotobynum()\fR takes as an argument a protocol number and returns the corresponding protocol name. .sp .LP The following protocol numbers are pre-defined: .sp .ne 2 .na \fB\fBIPSEC_PROTO_ESP\fR\fR .ad .RS 19n Defines the encryption algorithms (transforms) that can be used by IPsec to provide data confidentiality. .RE .sp .ne 2 .na \fB\fBIPSEC_PROTO_AH\fR\fR .ad .RS 19n Defines the authentication algorithms (transforms) that can be used by IPsec to provide authentication. .RE .SH PARAMETERS .sp .ne 2 .na \fB\fIproto_name\fR\fR .ad .RS 14n A pointer to the name of an IPsec protocol. .RE .sp .ne 2 .na \fB\fIproto_num\fR\fR .ad .RS 14n A pointer to a protocol number. conditions. .RE .SH RETURN VALUES .sp .LP The \fBgetipsecprotobyname()\fR function returns a protocol number upon success, or \fB-1\fR if the protocol specified does not exist. .sp .LP The \fBgetipsecprotobynum()\fR function returns a protocol name upon success, or the \fINULL\fR value if the protocol number specified does not exist. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE MT Level MT Safe _ Interface Stability Evolving .TE .SH SEE ALSO .sp .LP \fBipsecalgs\fR(1M), \fBgetipsecalgbyname\fR(3NSL), \fBgetipsecalgbyname\fR(3NSL), \fBattributes\fR(5) .sp .LP Piper, D. \fIRFC 2407, The Internet IP Security Domain of Interpretation for ISAKMP\fR. Network Working Group. November, 1998.