linux/net/sched/act_csum.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Checksum updating actions
 *
 * Copyright (c) 2010 Gregoire Baron <[email protected]>
 */

#include <linux/types.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spinlock.h>

#include <linux/netlink.h>
#include <net/netlink.h>
#include <linux/rtnetlink.h>

#include <linux/skbuff.h>

#include <net/ip.h>
#include <net/ipv6.h>
#include <net/icmp.h>
#include <linux/icmpv6.h>
#include <linux/igmp.h>
#include <net/tcp.h>
#include <net/udp.h>
#include <net/ip6_checksum.h>
#include <net/sctp/checksum.h>

#include <net/act_api.h>
#include <net/pkt_cls.h>

#include <linux/tc_act/tc_csum.h>
#include <net/tc_act/tc_csum.h>
#include <net/tc_wrapper.h>

static const struct nla_policy csum_policy[TCA_CSUM_MAX + 1] =;

static struct tc_action_ops act_csum_ops;

static int tcf_csum_init(struct net *net, struct nlattr *nla,
			 struct nlattr *est, struct tc_action **a,
			 struct tcf_proto *tp,
			 u32 flags, struct netlink_ext_ack *extack)
{}

/**
 * tcf_csum_skb_nextlayer - Get next layer pointer
 * @skb: sk_buff to use
 * @ihl: previous summed headers length
 * @ipl: complete packet length
 * @jhl: next header length
 *
 * Check the expected next layer availability in the specified sk_buff.
 * Return the next layer pointer if pass, NULL otherwise.
 */
static void *tcf_csum_skb_nextlayer(struct sk_buff *skb,
				    unsigned int ihl, unsigned int ipl,
				    unsigned int jhl)
{}

static int tcf_csum_ipv4_icmp(struct sk_buff *skb, unsigned int ihl,
			      unsigned int ipl)
{}

static int tcf_csum_ipv4_igmp(struct sk_buff *skb,
			      unsigned int ihl, unsigned int ipl)
{}

static int tcf_csum_ipv6_icmp(struct sk_buff *skb, unsigned int ihl,
			      unsigned int ipl)
{}

static int tcf_csum_ipv4_tcp(struct sk_buff *skb, unsigned int ihl,
			     unsigned int ipl)
{}

static int tcf_csum_ipv6_tcp(struct sk_buff *skb, unsigned int ihl,
			     unsigned int ipl)
{}

static int tcf_csum_ipv4_udp(struct sk_buff *skb, unsigned int ihl,
			     unsigned int ipl, int udplite)
{}

static int tcf_csum_ipv6_udp(struct sk_buff *skb, unsigned int ihl,
			     unsigned int ipl, int udplite)
{}

static int tcf_csum_sctp(struct sk_buff *skb, unsigned int ihl,
			 unsigned int ipl)
{}

static int tcf_csum_ipv4(struct sk_buff *skb, u32 update_flags)
{}

static int tcf_csum_ipv6_hopopts(struct ipv6_opt_hdr *ip6xh, unsigned int ixhl,
				 unsigned int *pl)
{}

static int tcf_csum_ipv6(struct sk_buff *skb, u32 update_flags)
{}

TC_INDIRECT_SCOPE int tcf_csum_act(struct sk_buff *skb,
				   const struct tc_action *a,
				   struct tcf_result *res)
{}

static int tcf_csum_dump(struct sk_buff *skb, struct tc_action *a, int bind,
			 int ref)
{}

static void tcf_csum_cleanup(struct tc_action *a)
{}

static size_t tcf_csum_get_fill_size(const struct tc_action *act)
{}

static int tcf_csum_offload_act_setup(struct tc_action *act, void *entry_data,
				      u32 *index_inc, bool bind,
				      struct netlink_ext_ack *extack)
{}

static struct tc_action_ops act_csum_ops =;
MODULE_ALIAS_NET_ACT();

static __net_init int csum_init_net(struct net *net)
{}

static void __net_exit csum_exit_net(struct list_head *net_list)
{}

static struct pernet_operations csum_net_ops =;

MODULE_DESCRIPTION();
MODULE_LICENSE();

static int __init csum_init_module(void)
{}

static void __exit csum_cleanup_module(void)
{}

module_init();
module_exit(csum_cleanup_module);