include/uapi/linux/xfrm.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/xfrm.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/xfrm.h- Extension
.h- Size
- 14120 bytes
- Lines
- 613
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/in6.hlinux/types.hlinux/stddef.h
Detected Declarations
struct xfrm_idstruct xfrm_sec_ctxstruct xfrm_selectorstruct xfrm_lifetime_cfgstruct xfrm_lifetime_curstruct xfrm_replay_statestruct xfrm_replay_state_esnstruct xfrm_algostruct xfrm_algo_authstruct xfrm_algo_aeadstruct xfrm_statsstruct xfrm_user_sec_ctxstruct xfrm_user_tmplstruct xfrm_encap_tmplstruct xfrm_userpolicy_typestruct xfrm_markstruct xfrmu_sadhinfostruct xfrmu_spdinfostruct xfrmu_spdhinfostruct xfrmu_spdhthreshstruct xfrm_usersa_infostruct xfrm_usersa_idstruct xfrm_aevent_idstruct xfrm_userspi_infostruct xfrm_userpolicy_infostruct xfrm_userpolicy_idstruct xfrm_user_acquirestruct xfrm_user_expirestruct xfrm_user_polexpirestruct xfrm_usersa_flushstruct xfrm_user_reportstruct xfrm_user_kmaddressstruct xfrm_user_migratestruct xfrm_user_migrate_statestruct xfrm_user_mappingstruct xfrm_address_filterstruct xfrm_user_offloadstruct xfrm_userpolicy_defaultenum xfrm_sa_direnum xfrm_ae_ftype_tenum xfrm_attr_type_tenum xfrm_sadattr_type_tenum xfrm_spdattr_type_tenum xfrm_migrate_state_flagsenum xfrm_nlgroups
Annotated Snippet
struct xfrm_id {
xfrm_address_t daddr;
__be32 spi;
__u8 proto;
};
struct xfrm_sec_ctx {
__u8 ctx_doi;
__u8 ctx_alg;
__u16 ctx_len;
__u32 ctx_sid;
char ctx_str[] __counted_by(ctx_len);
};
/* Security Context Domains of Interpretation */
#define XFRM_SC_DOI_RESERVED 0
#define XFRM_SC_DOI_LSM 1
/* Security Context Algorithms */
#define XFRM_SC_ALG_RESERVED 0
#define XFRM_SC_ALG_SELINUX 1
/* Selector, used as selector both on policy rules (SPD) and SAs. */
struct xfrm_selector {
xfrm_address_t daddr;
xfrm_address_t saddr;
__be16 dport;
__be16 dport_mask;
__be16 sport;
__be16 sport_mask;
__u16 family;
__u8 prefixlen_d;
__u8 prefixlen_s;
__u8 proto;
int ifindex;
__kernel_uid32_t user;
};
#define XFRM_INF (~(__u64)0)
struct xfrm_lifetime_cfg {
__u64 soft_byte_limit;
__u64 hard_byte_limit;
__u64 soft_packet_limit;
__u64 hard_packet_limit;
__u64 soft_add_expires_seconds;
__u64 hard_add_expires_seconds;
__u64 soft_use_expires_seconds;
__u64 hard_use_expires_seconds;
};
struct xfrm_lifetime_cur {
__u64 bytes;
__u64 packets;
__u64 add_time;
__u64 use_time;
};
struct xfrm_replay_state {
__u32 oseq;
__u32 seq;
__u32 bitmap;
};
#define XFRMA_REPLAY_ESN_MAX 4096
struct xfrm_replay_state_esn {
unsigned int bmp_len;
__u32 oseq;
__u32 seq;
__u32 oseq_hi;
__u32 seq_hi;
__u32 replay_window;
__u32 bmp[];
};
struct xfrm_algo {
char alg_name[64];
unsigned int alg_key_len; /* in bits */
char alg_key[];
};
struct xfrm_algo_auth {
char alg_name[64];
unsigned int alg_key_len; /* in bits */
unsigned int alg_trunc_len; /* in bits */
char alg_key[];
};
Annotation
- Immediate include surface: `linux/in6.h`, `linux/types.h`, `linux/stddef.h`.
- Detected declarations: `struct xfrm_id`, `struct xfrm_sec_ctx`, `struct xfrm_selector`, `struct xfrm_lifetime_cfg`, `struct xfrm_lifetime_cur`, `struct xfrm_replay_state`, `struct xfrm_replay_state_esn`, `struct xfrm_algo`, `struct xfrm_algo_auth`, `struct xfrm_algo_aead`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.