include/net/xfrm.h

Source file repositories/reference/linux-study-clean/include/net/xfrm.h

File Facts

System
Linux kernel
Corpus path
include/net/xfrm.h
Extension
.h
Size
66144 bytes
Lines
2369
Domain
Networking Core
Bucket
Sockets, Protocols, Packet Path, And Network Policy
Inferred role
Networking Core: implementation source
Status
source implementation candidate

Why This File Exists

Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.

Dependency Surface

Detected Declarations

Annotated Snippet

struct xfrm_state_walk {
	struct list_head	all;
	u8			state;
	u8			dying;
	u8			proto;
	u32			seq;
	struct xfrm_address_filter *filter;
};

enum {
	XFRM_DEV_OFFLOAD_IN = 1,
	XFRM_DEV_OFFLOAD_OUT,
	XFRM_DEV_OFFLOAD_FWD,
};

enum {
	XFRM_DEV_OFFLOAD_UNSPECIFIED,
	XFRM_DEV_OFFLOAD_CRYPTO,
	XFRM_DEV_OFFLOAD_PACKET,
};

enum {
	XFRM_DEV_OFFLOAD_FLAG_ACQ = 1,
};

struct xfrm_dev_offload {
	/* The device for this offload.
	 * Device drivers should not use this directly, as that will prevent
	 * them from working with bonding device. Instead, the device passed
	 * to the add/delete callbacks should be used.
	 */
	struct net_device	*dev;
	netdevice_tracker	dev_tracker;
	/* This is a private pointer used by the bonding driver (and eventually
	 * should be moved there). Device drivers should not use it.
	 * Protected by xfrm_state.lock AND bond.ipsec_lock in most cases,
	 * except in the .xdo_dev_state_del() flow, where only xfrm_state.lock
	 * is held.
	 */
	struct net_device	*real_dev;
	unsigned long		offload_handle;
	u8			dir : 2;
	u8			type : 2;
	u8			flags : 2;
};

struct xfrm_mode {
	u8 encap;
	u8 family;
	u8 flags;
};

/* Flags for xfrm_mode. */
enum {
	XFRM_MODE_FLAG_TUNNEL = 1,
};

enum xfrm_replay_mode {
	XFRM_REPLAY_MODE_LEGACY,
	XFRM_REPLAY_MODE_BMP,
	XFRM_REPLAY_MODE_ESN,
};

/* Full description of state of transformer. */
struct xfrm_state {
	possible_net_t		xs_net;
	union {
		struct hlist_node	gclist;
		struct hlist_node	bydst;
	};
	union {
		struct hlist_node	dev_gclist;
		struct hlist_node	bysrc;
	};
	struct hlist_node	byspi;
	struct hlist_node	byseq;
	struct hlist_node	state_cache;
	struct hlist_node	state_cache_input;

	refcount_t		refcnt;
	spinlock_t		lock;

	u32			pcpu_num;
	struct xfrm_id		id;
	struct xfrm_selector	sel;
	struct xfrm_mark	mark;
	u32			if_id;
	u32			tfcpad;

	u32			genid;

Annotation

Implementation Notes