1getipsecalgbyname(3NSLN)etworking Services Library Functiognestipsecalgbyname(3NSL)
2
3
4

NAME

6       getipsecalgbyname,  getipsecalgbynum, freeipsecalgent - query algorithm
7       mapping entries
8

SYNOPSIS

10       cc -flag ...  file ...-lnsl [ -library ... ]
11       #include <netdb.h>
12
13
14
15       struct ipsecalgent *getipsecalgbyname
16            (const char *alg_name, int protocol_num, int *errnop
17
18
19       struct ipsecalgent *getipsecalgbynum(int alg_num, int protocol_num,
20            int *errnop
21
22
23       void freeipsecalgent(struct ipsecalgent *ptr
24
25

DESCRIPTION

27       Use  the  getipsecalgbyname(),  getipsecalgbynum(),   freeipsecalgent()
28       functions  to  obtain the IPsec algorithm mappings  that are defined by
29       ipsecalgs(1M). The IPsec algorithms and associated protocol name spaces
30       are defined by RFC 2407.
31
32
33       getipsecalgbyname()  and  getipsecalgbynum()  return  a  structure that
34       describes the algorithm entry found. This structure is described in the
35       RETURN VALUES section below.
36
37
38       freeipsecalgent()  must  be  used  by the caller to free the structures
39       returned by getipsecalgbyname() and getipsecalgbynum() when they are no
40       longer needed.
41
42
43       Both  getipsecalgbyname()  and getipsecalgbynum() take as parameter the
44       protocol identifier in which the algorithm is defined. See getipsecpro‐
45       tobyname(3NSL) and getipsecprotobyname(3NSL).
46
47
48       The following protocol numbers are pre-defined:
49
50       IPSEC_PROTO_ESP    Defines  the encryption algorithms (transforms) that
51                          can be used by IPsec to provide  data  confidential‐
52                          ity.
53
54
55       IPSEC_PROTO_AH     Defines  the  authentication algorithms (transforms)
56                          that can be used by IPsec to provide authentication.
57
58
59
60       getipsecalgbyname() looks up the algorithm by its name, while  getipse‐
61       calgbynum() looks up the algorithm by its assigned number.
62

PARAMETERS

64       errnop    A  pointer to an integer used to return an error status value
65                 on certain error conditions. See ERRORS.
66
67

RETURN VALUES

69       The  getipsecalgbyname()  and  getipsecalgbynum()  functions  return  a
70       pointer  to the structure ipsecalgent_t, defined in <netdb.h>.   If the
71       requested algorithm cannot be found, these functions return NULL.
72
73
74       The structure ipsecalgent_t is defined as follows:
75
76         typedef struct ipsecalgent {
77              char **a_names;      /* algorithm names */
78              int a_proto_num;     /* protocol number */
79              int a_alg_num;       /* algorithm number */
80              char *a_mech_name;   /* mechanism name */
81              int *a_block_sizes;  /* supported block sizes */
82              int *a_key_sizes;    /* supported key sizes */
83              int a_key_increment; /* key size increment */
84         } ipsecalgent_t;
85
86
87
88       If a_key_increment is non-zero, a_key_sizes[0] contains the default key
89       size  for  the algorithm. a_key_sizes[1] and a_key_sizes[2] specify the
90       smallest  and  biggest  key  sizes  support  by  the   algorithm,   and
91       a_key_increment specifies the valid key size increments in that range.
92
93
94       If  a_key_increment is zero, the array a_key_sizes  contains the set of
95       key sizes, in bits, supported by the  algorithm. The last key length in
96       the  array  is  followed by an element of value 0. The first element of
97       this array is used as the default key size for the algorithm.
98
99
100       a_name is an array of algorithm names, terminated by  an  element  con‐
101       taining  a  NULL  pointer. a_name[0] is the  primary name for the algo‐
102       rithm.
103
104
105       a_proto_num is the protocol identifer of this algorithm.  a_alg_num  is
106       the  algorithm  number. a_mech_name contains the mechanism name associ‐
107       ated with the algorithm.
108
109
110       a_block_sizes is an array containing the supported block lengths or MAC
111       lengths, in bytes, supported by the algorithm.  The last valid value in
112       the array is followed by an element containing the value 0.
113

ERRORS

115       When the specified algorithm cannot be returned to the caller, getipse‐
116       calgbynam()  and  getipsecalgbynum() return a value of NULL and set the
117       integer pointed to by the errnop parameter to one of the following val‐
118       ues:
119
120       ENOMEM    Not enough memory
121
122
123       ENOENT    Specified algorithm not found
124
125
126       EINVAL    Specified protocol number not found
127
128

ATTRIBUTES

130       See attributes(5)  for descriptions of the following attributes:
131
132
133
134
135       ┌─────────────────────────────┬─────────────────────────────┐
136       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
137       ├─────────────────────────────┼─────────────────────────────┤
138       │Availability                 │SUNWcsl (32 bit)             │
139       │                             │SUNWcslx (64 bit)            │
140       ├─────────────────────────────┼─────────────────────────────┤
141       │MT Level                     │MT Safe                      │
142       ├─────────────────────────────┼─────────────────────────────┤
143       │Interface Stability          │Evolving                     │
144       └─────────────────────────────┴─────────────────────────────┘
145

SEE ALSO

147       cryptoadm(1M), ipsecalgs(1M), getipsecprotobyname(3NSL), getipsecproto‐
148       byname(3NSL), attributes(5)
149
150
151       Piper, D. RFC 2407, The Internet IP Security Domain  of  Interpretation
152       for ISAKMP. Network Working Group. November, 1998.
153
154
155
156SunOS 5.11                        20 Aug 2003          getipsecalgbyname(3NSL)
Impressum