'\" te .\" Copyright (C) 2003, Sun Microsystems, Inc. All Rights Reserved .TH getipsecprotobyname 3NSL "13 Aug 2003" "SunOS 5.11" "Networking Services Library Functions" .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 .mk .na \fB\fBIPSEC_PROTO_ESP\fR\fR .ad .RS 19n .rt Defines the encryption algorithms (transforms) that can be used by IPsec to provide data confidentiality. .RE .sp .ne 2 .mk .na \fB\fBIPSEC_PROTO_AH\fR\fR .ad .RS 19n .rt Defines the authentication algorithms (transforms) that can be used by IPsec to provide authentication. .RE .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIproto_name\fR\fR .ad .RS 14n .rt A pointer to the name of an IPsec protocol. .RE .sp .ne 2 .mk .na \fB\fIproto_num\fR\fR .ad .RS 14n .rt 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 tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/library (32 bit) SUNWcslx (64 bit) _ MT LevelMT Safe _ Interface StabilityCommitted .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.