linux/net/xfrm/xfrm_replay.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * xfrm_replay.c - xfrm replay detection, derived from xfrm_state.c.
 *
 * Copyright (C) 2010 secunet Security Networks AG
 * Copyright (C) 2010 Steffen Klassert <[email protected]>
 */

#include <linux/export.h>
#include <net/xfrm.h>

u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq)
{}
EXPORT_SYMBOL();

static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event);
static void xfrm_replay_notify_esn(struct xfrm_state *x, int event);

void xfrm_replay_notify(struct xfrm_state *x, int event)
{}

static int __xfrm_replay_overflow(struct xfrm_state *x, struct sk_buff *skb)
{}

static int xfrm_replay_check_legacy(struct xfrm_state *x,
				    struct sk_buff *skb, __be32 net_seq)
{}

static void xfrm_replay_advance_bmp(struct xfrm_state *x, __be32 net_seq);
static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq);

void xfrm_replay_advance(struct xfrm_state *x, __be32 net_seq)
{}

static int xfrm_replay_overflow_bmp(struct xfrm_state *x, struct sk_buff *skb)
{}

static int xfrm_replay_check_bmp(struct xfrm_state *x,
				 struct sk_buff *skb, __be32 net_seq)
{}

static void xfrm_replay_advance_bmp(struct xfrm_state *x, __be32 net_seq)
{}

static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event)
{}

static void xfrm_replay_notify_esn(struct xfrm_state *x, int event)
{}

static int xfrm_replay_overflow_esn(struct xfrm_state *x, struct sk_buff *skb)
{}

static int xfrm_replay_check_esn(struct xfrm_state *x,
				 struct sk_buff *skb, __be32 net_seq)
{}

int xfrm_replay_check(struct xfrm_state *x,
		      struct sk_buff *skb, __be32 net_seq)
{}

static int xfrm_replay_recheck_esn(struct xfrm_state *x,
				   struct sk_buff *skb, __be32 net_seq)
{}

int xfrm_replay_recheck(struct xfrm_state *x,
			struct sk_buff *skb, __be32 net_seq)
{}

static void xfrm_replay_advance_esn(struct xfrm_state *x, __be32 net_seq)
{}

#ifdef CONFIG_XFRM_OFFLOAD
static int xfrm_replay_overflow_offload(struct xfrm_state *x, struct sk_buff *skb)
{}

static int xfrm_replay_overflow_offload_bmp(struct xfrm_state *x, struct sk_buff *skb)
{}

static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff *skb)
{}

int xfrm_replay_overflow(struct xfrm_state *x, struct sk_buff *skb)
{}
#else
int xfrm_replay_overflow(struct xfrm_state *x, struct sk_buff *skb)
{
	switch (x->repl_mode) {
	case XFRM_REPLAY_MODE_LEGACY:
		break;
	case XFRM_REPLAY_MODE_BMP:
		return xfrm_replay_overflow_bmp(x, skb);
	case XFRM_REPLAY_MODE_ESN:
		return xfrm_replay_overflow_esn(x, skb);
	}

	return __xfrm_replay_overflow(x, skb);
}
#endif

int xfrm_init_replay(struct xfrm_state *x, struct netlink_ext_ack *extack)
{}
EXPORT_SYMBOL();