linux/net/ipv6/seg6_hmac.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  SR-IPv6 implementation -- HMAC functions
 *
 *  Author:
 *  David Lebrun <[email protected]>
 */

#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/in6.h>
#include <linux/icmpv6.h>
#include <linux/mroute6.h>
#include <linux/slab.h>
#include <linux/rhashtable.h>

#include <linux/netfilter.h>
#include <linux/netfilter_ipv6.h>

#include <net/sock.h>
#include <net/snmp.h>

#include <net/ipv6.h>
#include <net/protocol.h>
#include <net/transp_v6.h>
#include <net/rawv6.h>
#include <net/ndisc.h>
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/xfrm.h>

#include <crypto/hash.h>
#include <net/seg6.h>
#include <net/genetlink.h>
#include <net/seg6_hmac.h>
#include <linux/random.h>

static DEFINE_PER_CPU(char [SEG6_HMAC_RING_SIZE], hmac_ring);

static int seg6_hmac_cmpfn(struct rhashtable_compare_arg *arg, const void *obj)
{}

static inline void seg6_hinfo_release(struct seg6_hmac_info *hinfo)
{}

static void seg6_free_hi(void *ptr, void *arg)
{}

static const struct rhashtable_params rht_params =;

static struct seg6_hmac_algo hmac_algos[] =;

static struct sr6_tlv_hmac *seg6_get_tlv_hmac(struct ipv6_sr_hdr *srh)
{}

static struct seg6_hmac_algo *__hmac_get_algo(u8 alg_id)
{}

static int __do_hmac(struct seg6_hmac_info *hinfo, const char *text, u8 psize,
		     u8 *output, int outlen)
{}

int seg6_hmac_compute(struct seg6_hmac_info *hinfo, struct ipv6_sr_hdr *hdr,
		      struct in6_addr *saddr, u8 *output)
{}
EXPORT_SYMBOL();

/* checks if an incoming SR-enabled packet's HMAC status matches
 * the incoming policy.
 *
 * called with rcu_read_lock()
 */
bool seg6_hmac_validate_skb(struct sk_buff *skb)
{}
EXPORT_SYMBOL();

/* called with rcu_read_lock() */
struct seg6_hmac_info *seg6_hmac_info_lookup(struct net *net, u32 key)
{}
EXPORT_SYMBOL();

int seg6_hmac_info_add(struct net *net, u32 key, struct seg6_hmac_info *hinfo)
{}
EXPORT_SYMBOL();

int seg6_hmac_info_del(struct net *net, u32 key)
{}
EXPORT_SYMBOL();

int seg6_push_hmac(struct net *net, struct in6_addr *saddr,
		   struct ipv6_sr_hdr *srh)
{}
EXPORT_SYMBOL();

static int seg6_hmac_init_algo(void)
{}

int __init seg6_hmac_init(void)
{}

int __net_init seg6_hmac_net_init(struct net *net)
{}

void seg6_hmac_exit(void)
{}
EXPORT_SYMBOL();

void __net_exit seg6_hmac_net_exit(struct net *net)
{}
EXPORT_SYMBOL();