Networking Services Library Functions getipsecalgbyname(3NSL)
NAME
getipsecalgbyname, getipsecalgbynum, freeipsecalgent - query
algorithm mapping entries
SYNOPSIS
cc -flag ... file ...-lnsl [ -library ... ]
#include
struct ipsecalgent *getipsecalgbyname
(const char *algname, int protocolnum, int *errnop
struct ipsecalgent *getipsecalgbynum(int algnum, int protocolnum,
int *errnop
void freeipsecalgent(struct ipsecalgent *ptr
DESCRIPTION
Use the getipsecalgbyname(), getipsecalgbynum(), freeip-
secalgent() functions to obtain the IPsec algorithm mappings
that are defined by ipsecalgs(1M). The IPsec algorithms and
associated protocol name spaces are defined by RFC 2407.
getipsecalgbyname() and getipsecalgbynum() return a struc-
ture that describes the algorithm entry found. This struc-
ture is described in the RETURN VALUES section below.
freeipsecalgent() must be used by the caller to free the
structures returned by getipsecalgbyname() and getipsecalg-
bynum() when they are no longer needed.
Both getipsecalgbyname() and getipsecalgbynum() take as
parameter the protocol identifier in which the algorithm is
defined. See getipsecprotobyname(3NSL) and
getipsecprotobyname(3NSL).
The following protocol numbers are pre-defined:
IPSECPROTOESP Defines the encryption algorithms
(transforms) that can be used by IPsec to
provide data confidentiality.
SunOS 5.11 Last change: 20 Aug 2003 1
Networking Services Library Functions getipsecalgbyname(3NSL)
IPSECPROTOAH Defines the authentication algorithms
(transforms) that can be used by IPsec to
provide authentication.
getipsecalgbyname() looks up the algorithm by its name,
while getipsecalgbynum() looks up the algorithm by its
assigned number.
PARAMETERS
errnop A pointer to an integer used to return an error
status value on certain error conditions. See
ERORS.
RETURN VALUES
The getipsecalgbyname() and getipsecalgbynum() functions
return a pointer to the structure ipsecalgentt, defined in
. If the requested algorithm cannot be found,
these functions return NUL.
The structure ipsecalgentt is defined as follows:
typedef struct ipsecalgent {
char **anames; /* algorithm names */
int aprotonum; /* protocol number */
int aalgnum; /* algorithm number */
char *amechname; /* mechanism name */
int *ablocksizes; /* supported block sizes */
int *akeysizes; /* supported key sizes */
int akeyincrement; /* key size increment */
} ipsecalgentt;
If akeyincrement is non-zero, akeysizes[0] contains the
default key size for the algorithm. akeysizes[1] and
akeysizes[2] specify the smallest and biggest key sizes
support by the algorithm, and akeyincrement specifies the
valid key size increments in that range.
If akeyincrement is zero, the array akeysizes contains
the set of key sizes, in bits, supported by the algorithm.
The last key length in the array is followed by an element
of value 0. The first element of this array is used as the
default key size for the algorithm.
SunOS 5.11 Last change: 20 Aug 2003 2
Networking Services Library Functions getipsecalgbyname(3NSL)
aname is an array of algorithm names, terminated by an ele-
ment containing a NUL pointer. aname[0] is the primary
name for the algorithm.
aprotonum is the protocol identifer of this algorithm.
aalgnum is the algorithm number. amechname contains the
mechanism name associated with the algorithm.
ablocksizes is an array containing the supported block
lengths or MAC lengths, in bytes, supported by the algo-
rithm. The last valid value in the array is followed by an
element containing the value 0.
ERORS
When the specified algorithm cannot be returned to the
caller, getipsecalgbynam() and getipsecalgbynum() return a
value of NUL and set the integer pointed to by the errnop
parameter to one of the following values:
ENOMEM Not enough memory
ENOENT Specified algorithm not found
EINVAL Specified protocol number not found
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 20 Aug 2003 3
Networking Services Library Functions getipsecalgbyname(3NSL)
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWcsl (32 bit)
SUNWcslx (64 bit)
MT Level MT Safe
Interface Stability Evolving
SEE ALSO
cryptoadm(1M), ipsecalgs(1M), getipsecprotobyname(3NSL),
getipsecprotobyname(3NSL), attributes(5)
Piper, D. RFC 2407, The Internet IP Security Domain of
Interpretation for ISAKMP. Network Working Group. November,
1998.
SunOS 5.11 Last change: 20 Aug 2003 4
|