Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

getipsecprotobynum(3C)

Name

getipsecprotobyname, getipsecprotobynum - query IPsec protocols entries

Synopsis

#include <netdb.h>

int getipsecprotobyname(const char *proto_name);
char *getipsecprotobynum(int proto_num);

Description

Use the getipsecprotobyname() and getipsecprotobynum() functions to obtain the IPsec algorithm mappings that are defined by ipsecalgs(8). You can also use the getipsecprotobyname() and getipsecprotobynum() functions in conjunction with getipsecalgbyname(3C) and getipsecalgbynum(3C) to obtain information about the supported IPsec algorithms. The IPsec algorithms and associated protocol name spaces are defined by RFC 2407.

getipsecprotobyname() takes as an argument the name of an IPsec protocol and returns its assigned protocol number. The character string returned by the getipsecprotobyname() function must be freed by the caller when it is no longer needed.

getipsecprotobynum() takes as an argument a protocol number and returns the corresponding protocol name.

The following protocol numbers are pre-defined:

IPSEC_PROTO_ESP

Defines the encryption algorithms (transforms) that can be used by IPsec to provide data confidentiality.

IPSEC_PROTO_AH

Defines the authentication algorithms (transforms) that can be used by IPsec to provide authentication.

Parameters

proto_name

A pointer to the name of an IPsec protocol.

proto_num

A protocol number.

Return Values

The getipsecprotobyname() function returns a protocol number upon success, or −1 if the protocol specified does not exist.

The getipsecprotobynum() function returns a protocol name upon success, or the NULL value if the protocol number specified does not exist.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
MT-Level
MT-Safe
Interface Stability
Committed

See Also

getipsecalgbyname(3C), getipsecalgbynum(3C), attributes(7), ipsecalgs(8)

Piper, D. RFC 2407, The Internet IP Security Domain of Interpretation for ISAKMP. Network Working Group. November, 1998. https://tools.ietf.org/html/rfc2407.

History

The getipsecprotobyname() and getipsecprotobynum() functions were added to Oracle Solaris in the Solaris 10 3/05 release.