Documentation/networking/xfrm/xfrm_sync.rst

Source file repositories/reference/linux-study-clean/Documentation/networking/xfrm/xfrm_sync.rst

File Facts

System
Linux kernel
Corpus path
Documentation/networking/xfrm/xfrm_sync.rst
Extension
.rst
Size
6849 bytes
Lines
193
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct xfrm_aevent_id {
	     struct xfrm_usersa_id           sa_id;
	     xfrm_address_t                  saddr;
	     __u32                           flags;
	     __u32                           reqid;
   };

The unique SA is identified by the combination of xfrm_usersa_id,
reqid and saddr.

flags are used to indicate different things. The possible
flags are::

	XFRM_AE_RTHR=1, /* replay threshold*/
	XFRM_AE_RVAL=2, /* replay value */
	XFRM_AE_LVAL=4, /* lifetime value */
	XFRM_AE_ETHR=8, /* expiry timer threshold */
	XFRM_AE_CR=16, /* Event cause is replay update */
	XFRM_AE_CE=32, /* Event cause is timer expiry */
	XFRM_AE_CU=64, /* Event cause is policy update */

How these flags are used is dependent on the direction of the
message (kernel<->user) as well the cause (config, query or event).
This is described below in the different messages.

The pid will be set appropriately in netlink to recognize direction
(0 to the kernel and pid = processid that created the event
when going from kernel to user space)

A program needs to subscribe to multicast group XFRMNLGRP_AEVENTS
to get notified of these events.

2) TLVS reflect the different parameters
----------------------------------------

a) byte value (XFRMA_LTIME_VAL)

   This TLV carries the running/current counter for byte lifetime since
   last event.

b) replay value (XFRMA_REPLAY_VAL)

   This TLV carries the running/current counter for replay sequence since
   last event.

c) replay threshold (XFRMA_REPLAY_THRESH)

   This TLV carries the threshold being used by the kernel to trigger events
   when the replay sequence is exceeded.

d) expiry timer (XFRMA_ETIMER_THRESH)

   This is a timer value in milliseconds which is used as the nagle
   value to rate limit the events.

3) Default configurations for the parameters
--------------------------------------------

By default these events should be turned off unless there is
at least one listener registered to listen to the multicast
group XFRMNLGRP_AEVENTS.

Programs installing SAs will need to specify the two thresholds, however,
in order to not change existing applications such as racoon
we also provide default threshold values for these different parameters
in case they are not specified.

the two sysctls/proc entries are:

a) /proc/sys/net/core/sysctl_xfrm_aevent_etime

Annotation

Implementation Notes