libnl: Lifetime Configuration Object

libnl 3.7.0

Functions
Lifetime Configuration Object

Abstract data type representing XFRM SA lifetime properties. More...

## Functions
void | xfrmnl_user_tmpl_free (struct xfrmnl_user_tmpl *utmpl)

## XFRM Template Mode Translations
char * | xfrmnl_user_tmpl_mode2str (int mode, char *buf, size_t len)
int | xfrmnl_user_tmpl_str2mode (const char *name)

## Creating Selector
struct xfrmnl_ltime_cfg * | xfrmnl_ltime_cfg_alloc ()
| Allocate new lifetime config object. More...
struct xfrmnl_ltime_cfg * | xfrmnl_ltime_cfg_clone (struct xfrmnl_ltime_cfg *ltime)
| Clone existing lifetime config object. More...

## Managing Usage References
struct xfrmnl_ltime_cfg * | xfrmnl_ltime_cfg_get (struct xfrmnl_ltime_cfg *ltime)
void | xfrmnl_ltime_cfg_put (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_shared (struct xfrmnl_ltime_cfg *ltime)
| Check whether an lifetime config object is shared. More...

## Miscellaneous
int | xfrmnl_ltime_cfg_cmp (struct xfrmnl_ltime_cfg *a, struct xfrmnl_ltime_cfg *b)
| Compares two lifetime config objects. More...

## Attributes
unsigned long long | xfrmnl_ltime_cfg_get_soft_bytelimit (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_soft_bytelimit (struct xfrmnl_ltime_cfg *ltime, unsigned long long soft_byte_limit)
unsigned long long | xfrmnl_ltime_cfg_get_hard_bytelimit (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_hard_bytelimit (struct xfrmnl_ltime_cfg *ltime, unsigned long long hard_byte_limit)
unsigned long long | xfrmnl_ltime_cfg_get_soft_packetlimit (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_soft_packetlimit (struct xfrmnl_ltime_cfg *ltime, unsigned long long soft_packet_limit)
unsigned long long | xfrmnl_ltime_cfg_get_hard_packetlimit (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_hard_packetlimit (struct xfrmnl_ltime_cfg *ltime, unsigned long long hard_packet_limit)
unsigned long long | xfrmnl_ltime_cfg_get_soft_addexpires (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_soft_addexpires (struct xfrmnl_ltime_cfg *ltime, unsigned long long soft_add_expires_seconds)
unsigned long long | xfrmnl_ltime_cfg_get_hard_addexpires (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_hard_addexpires (struct xfrmnl_ltime_cfg *ltime, unsigned long long hard_add_expires_seconds)
unsigned long long | xfrmnl_ltime_cfg_get_soft_useexpires (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_soft_useexpires (struct xfrmnl_ltime_cfg *ltime, unsigned long long soft_use_expires_seconds)
unsigned long long | xfrmnl_ltime_cfg_get_hard_useexpires (struct xfrmnl_ltime_cfg *ltime)
int | xfrmnl_ltime_cfg_set_hard_useexpires (struct xfrmnl_ltime_cfg *ltime, unsigned long long hard_use_expires_seconds)

## Creating Selector
struct xfrmnl_sel * | xfrmnl_sel_alloc ()
| Allocate new selector object. More...
struct xfrmnl_sel * | xfrmnl_sel_clone (struct xfrmnl_sel *sel)
| Clone existing selector object. More...

## Managing Usage References
struct xfrmnl_sel * | xfrmnl_sel_get (struct xfrmnl_sel *sel)
void | xfrmnl_sel_put (struct xfrmnl_sel *sel)
int | xfrmnl_sel_shared (struct xfrmnl_sel *sel)
| Check whether an selector object is shared. More...

## Miscellaneous
int | xfrmnl_sel_cmp (struct xfrmnl_sel *a, struct xfrmnl_sel *b)
| Compares two selector objects. More...
void | xfrmnl_sel_dump (struct xfrmnl_sel *sel, struct nl_dump_params *p)

## Attributes
struct nl_addr * | xfrmnl_sel_get_daddr (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_daddr (struct xfrmnl_sel *sel, struct nl_addr *addr)
struct nl_addr * | xfrmnl_sel_get_saddr (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_saddr (struct xfrmnl_sel *sel, struct nl_addr *addr)
int | xfrmnl_sel_get_dport (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_dport (struct xfrmnl_sel *sel, unsigned int dport)
int | xfrmnl_sel_get_dportmask (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_dportmask (struct xfrmnl_sel *sel, unsigned int dport_mask)
int | xfrmnl_sel_get_sport (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_sport (struct xfrmnl_sel *sel, unsigned int sport)
int | xfrmnl_sel_get_sportmask (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_sportmask (struct xfrmnl_sel *sel, unsigned int sport_mask)
int | xfrmnl_sel_get_family (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_family (struct xfrmnl_sel *sel, unsigned int family)
int | xfrmnl_sel_get_prefixlen_d (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_prefixlen_d (struct xfrmnl_sel *sel, unsigned int prefixlen)
int | xfrmnl_sel_get_prefixlen_s (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_prefixlen_s (struct xfrmnl_sel *sel, unsigned int prefixlen)
int | xfrmnl_sel_get_proto (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_proto (struct xfrmnl_sel *sel, unsigned int protocol)
int | xfrmnl_sel_get_ifindex (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_ifindex (struct xfrmnl_sel *sel, unsigned int ifindex)
int | xfrmnl_sel_get_userid (struct xfrmnl_sel *sel)
int | xfrmnl_sel_set_userid (struct xfrmnl_sel *sel, unsigned int userid)

## Creating User Template Object
struct xfrmnl_user_tmpl * | xfrmnl_user_tmpl_alloc ()
| Allocate new user template object. More...
struct xfrmnl_user_tmpl * | xfrmnl_user_tmpl_clone (struct xfrmnl_user_tmpl *utmpl)
| Clone existing user template object. More...

## Miscellaneous
int | xfrmnl_user_tmpl_cmp (struct xfrmnl_user_tmpl *a, struct xfrmnl_user_tmpl *b)
| Compares two user template objects. More...
void | xfrmnl_user_tmpl_dump (struct xfrmnl_user_tmpl *tmpl, struct nl_dump_params *p)

## Attributes
struct nl_addr * | xfrmnl_user_tmpl_get_daddr (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_daddr (struct xfrmnl_user_tmpl *utmpl, struct nl_addr *addr)
int | xfrmnl_user_tmpl_get_spi (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_spi (struct xfrmnl_user_tmpl *utmpl, unsigned int spi)
int | xfrmnl_user_tmpl_get_proto (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_proto (struct xfrmnl_user_tmpl *utmpl, unsigned int protocol)
int | xfrmnl_user_tmpl_get_family (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_family (struct xfrmnl_user_tmpl *utmpl, unsigned int family)
struct nl_addr * | xfrmnl_user_tmpl_get_saddr (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_saddr (struct xfrmnl_user_tmpl *utmpl, struct nl_addr *addr)
int | xfrmnl_user_tmpl_get_reqid (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_reqid (struct xfrmnl_user_tmpl *utmpl, unsigned int reqid)
int | xfrmnl_user_tmpl_get_mode (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_mode (struct xfrmnl_user_tmpl *utmpl, unsigned int mode)
int | xfrmnl_user_tmpl_get_share (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_share (struct xfrmnl_user_tmpl *utmpl, unsigned int share)
int | xfrmnl_user_tmpl_get_optional (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_optional (struct xfrmnl_user_tmpl *utmpl, unsigned int optional)
int | xfrmnl_user_tmpl_get_aalgos (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_aalgos (struct xfrmnl_user_tmpl *utmpl, unsigned int aalgos)
int | xfrmnl_user_tmpl_get_ealgos (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_ealgos (struct xfrmnl_user_tmpl *utmpl, unsigned int ealgos)
int | xfrmnl_user_tmpl_get_calgos (struct xfrmnl_user_tmpl *utmpl)
int | xfrmnl_user_tmpl_set_calgos (struct xfrmnl_user_tmpl *utmpl, unsigned int calgos)

## Detailed Description

Abstract data type representing XFRM SA lifetime properties.

Abstract data type representing XFRM SA properties.

Abstract data type representing XFRM SA/SP selector properties.

## Header

#include <netlink/xfrm/lifetime.h>

## Header

#include <netlink/xfrm/selector.h>

## Header

#include <netlink/xfrm/template.h>

## Function Documentation

## ◆ xfrmnl_ltime_cfg_alloc()

struct xfrmnl_ltime_cfg* xfrmnl_ltime_cfg_alloc | ( | void |  | ) |

Allocate new lifetime config object.

Returns
  Newly allocated lifetime config object or NULL

Definition at line 76 of file lifetime.c.

Referenced by xfrmnl_ltime_cfg_clone().

Here is the caller graph for this function:

## ◆ xfrmnl_ltime_cfg_clone()

struct xfrmnl_ltime_cfg* xfrmnl_ltime_cfg_clone | ( | struct xfrmnl_ltime_cfg * | ltime | ) |

Clone existing lifetime config object.

Parameters

  ltime | Selector object.

Returns
  Newly allocated lifetime config object being a duplicate of the specified lifetime config object or NULL if a failure occured.

Definition at line 95 of file lifetime.c.

References xfrmnl_ltime_cfg_alloc().

Here is the call graph for this function:

## ◆ xfrmnl_ltime_cfg_shared()

int xfrmnl_ltime_cfg_shared | ( | struct xfrmnl_ltime_cfg * | ltime | ) |

Check whether an lifetime config object is shared.

Parameters

  addr | Selector object.

Returns
  Non-zero if the lifetime config object is shared, otherwise 0.

Definition at line 136 of file lifetime.c.

## ◆ xfrmnl_ltime_cfg_cmp()

int xfrmnl_ltime_cfg_cmp | ( | struct xfrmnl_ltime_cfg * | a,
|  | struct xfrmnl_ltime_cfg * | b
| ) |  |

Compares two lifetime config objects.

Parameters

  a | A lifetime config object.
  b | Another lifetime config object.

Returns
  Non zero if difference is found, 0 otherwise if both the objects are identical.

Definition at line 156 of file lifetime.c.

## ◆ xfrmnl_sel_alloc()

struct xfrmnl_sel* xfrmnl_sel_alloc | ( | void |  | ) |

Allocate new selector object.

Returns
  Newly allocated selector object or NULL

Definition at line 78 of file selector.c.

Referenced by xfrmnl_sel_clone().

Here is the caller graph for this function:

## ◆ xfrmnl_sel_clone()

struct xfrmnl_sel* xfrmnl_sel_clone | ( | struct xfrmnl_sel * | sel | ) |

Clone existing selector object.

Parameters

  sel | Selector object.

Returns
  Newly allocated selector object being a duplicate of the specified selector object or NULL if a failure occured.

Definition at line 97 of file selector.c.

References nl_addr_clone(), and xfrmnl_sel_alloc().

Here is the call graph for this function:

## ◆ xfrmnl_sel_shared()

int xfrmnl_sel_shared | ( | struct xfrmnl_sel * | sel | ) |

Check whether an selector object is shared.

Parameters

  addr | Selector object.

Returns
  Non-zero if the selector object is shared, otherwise 0.

Definition at line 142 of file selector.c.

## ◆ xfrmnl_sel_cmp()

int xfrmnl_sel_cmp | ( | struct xfrmnl_sel * | a,
|  | struct xfrmnl_sel * | b
| ) |  |

Compares two selector objects.

Parameters

  a | A selector object.
  b | Another selector object.

Returns
  Non zero if difference is found, 0 otherwise if both the objects are identical.

Definition at line 162 of file selector.c.

References nl_addr_cmp_prefix().

Here is the call graph for this function:

## ◆ xfrmnl_user_tmpl_alloc()

struct xfrmnl_user_tmpl* xfrmnl_user_tmpl_alloc | ( | void |  | ) |

Allocate new user template object.

Returns
  Newly allocated user template object or NULL

Definition at line 72 of file template.c.

Referenced by xfrmnl_user_tmpl_clone().

Here is the caller graph for this function:

## ◆ xfrmnl_user_tmpl_clone()

struct xfrmnl_user_tmpl* xfrmnl_user_tmpl_clone | ( | struct xfrmnl_user_tmpl * | utmpl | ) |

Clone existing user template object.

Parameters

  utmpl | Selector object.

Returns
  Newly allocated user template object being a duplicate of the specified user template object or NULL if a failure occured.

Definition at line 91 of file template.c.

References nl_addr_clone(), and xfrmnl_user_tmpl_alloc().

Here is the call graph for this function:

## ◆ xfrmnl_user_tmpl_cmp()

int xfrmnl_user_tmpl_cmp | ( | struct xfrmnl_user_tmpl * | a,
|  | struct xfrmnl_user_tmpl * | b
| ) |  |

Compares two user template objects.

Parameters

  a | A user template object.
  b | Another user template object.

Returns
  Non zero if difference is found, 0 otherwise if both the objects are identical.

Definition at line 144 of file template.c.

References nl_addr_cmp_prefix().

Here is the call graph for this function: