ipsec_dump_policy()

Updated: April 19, 2023

Generate a readable string from an IPsec policy specification

Synopsis:

#include <netinet6/ipsec.h>

char* ipsec_dump_policy(char *buf, 
                        char *delim);

Arguments:

buf
A pointer to an IPsec policy structure struct sadb_x_policy.
delim
Delimiter string, usually a NULL, which indicates a space.

Library:

libipsec

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

Description:

The ipsec_dump_policy() function generates a readable string from an IPSEC policy specification. Refer to ipsec_set_policy() for details about the policies.

The ipsec_dump_policy() function converts IPsec policy structure into a readable form. Therefore, ipsec_dump_policy() is the inverse of ipsec_set_policy(). If you set delim to NULL, a single whitespace is assumed. The function ipsec_dump_policy() returns a pointer to a dynamically allocated string. It is the caller's responsibility to reclaim the region, by using free().

Returns:

A pointer to dynamically allocated string, or NULL if an error occurs.

Examples:

See ipsec_set_policy().

Classification:

Unix

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