ipsec_get_policylen()

Get the length of the IPsec policy

Synopsis:

#include <netinet6/ipsec.h>

int ipsec_get_policylen(char *buf);

Arguments:

buf
A pointer to an IPsec policy structure struct sadb_x_policy.

Library:

libipsec

Use the -l ipsec option to qcc to link against this library.

Description:

The function ipsec_get_policylen() gets the length of the IPsec policy. Please refer to ipsec_set_policy() for details about the policies.

You may want the length of the generated buffer when calling setsockopt(). The function ipsec_get_policylen() returns the length.

Returns:

The size of the buffer, or a negative value if an error occurs.

Examples:

See ipsec_set_policy().

Classification:

Unix

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

IPsec, ipsec_dump_policy(), ipsec_set_policy(), ipsec_strerror()

setkey in the Utilities Reference