--- zzzz-none-000/linux-5.4.213/include/net/xfrm.h 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/include/net/xfrm.h 2024-08-14 09:02:08.000000000 +0000 @@ -259,6 +259,21 @@ void *data; }; +enum xfrm_event_type { + XFRM_EVENT_NONE = 0, + XFRM_EVENT_STATE_ADD, + XFRM_EVENT_STATE_DEL, + XFRM_EVENT_MAX +}; + +struct xfrm_event_notifier { + struct list_head list; + void (*state_notify)(struct xfrm_state *x, enum xfrm_event_type event); +}; + +int xfrm_event_register_notifier(struct net *net, struct xfrm_event_notifier *event); +void xfrm_event_unregister_notifier(struct net *net, struct xfrm_event_notifier *event); + static inline struct net *xs_net(struct xfrm_state *x) { return read_pnet(&x->xs_net); @@ -267,6 +282,7 @@ /* xflags - make enum if more show up */ #define XFRM_TIME_DEFER 1 #define XFRM_SOFT_EXPIRE 2 +#define XFRM_STATE_OFFLOAD_NSS 4 enum { XFRM_STATE_VOID, @@ -374,6 +390,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family); struct xfrm_state_afinfo *xfrm_state_afinfo_get_rcu(unsigned int family); +struct xfrm_state_afinfo *xfrm_state_update_afinfo(unsigned int family, struct xfrm_state_afinfo *new); struct xfrm_input_afinfo { unsigned int family; @@ -404,6 +421,8 @@ int (*reject)(struct xfrm_state *, struct sk_buff *, const struct flowi *); int (*hdr_offset)(struct xfrm_state *, struct sk_buff *, u8 **); + /* Estimate maximal size of result of transformation of a dgram */ + u32 (*get_mtu)(struct xfrm_state *, int size); }; int xfrm_register_type(const struct xfrm_type *type, unsigned short family); @@ -1501,6 +1520,7 @@ const xfrm_address_t *saddr, u8 proto, unsigned short family); +void xfrm_state_change_notify(struct xfrm_state *x, enum xfrm_event_type); #ifdef CONFIG_XFRM_SUB_POLICY void xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, unsigned short family); @@ -1680,6 +1700,7 @@ xfrm_address_t *addr); void xfrm_input_init(void); +void xfrm_output_init(void); int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, __be32 *spi, __be32 *seq); void xfrm_probe_algs(void);