#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/net.h>
#include <linux/in6.h>
#include <linux/slab.h>
#include <linux/rhashtable.h>
#include <net/ipv6.h>
#include <net/protocol.h>
#include <net/seg6.h>
#include <net/genetlink.h>
#include <linux/seg6.h>
#include <linux/seg6_genl.h>
#include <net/seg6_hmac.h>
bool seg6_validate_srh(struct ipv6_sr_hdr *srh, int len, bool reduced)
{ … }
struct ipv6_sr_hdr *seg6_get_srh(struct sk_buff *skb, int flags)
{ … }
void seg6_icmp_srh(struct sk_buff *skb, struct inet6_skb_parm *opt)
{ … }
static struct genl_family seg6_genl_family;
static const struct nla_policy seg6_genl_policy[SEG6_ATTR_MAX + 1] = …;
#ifdef CONFIG_IPV6_SEG6_HMAC
static int seg6_genl_sethmac(struct sk_buff *skb, struct genl_info *info)
{ … }
#else
static int seg6_genl_sethmac(struct sk_buff *skb, struct genl_info *info)
{
return -ENOTSUPP;
}
#endif
static int seg6_genl_set_tunsrc(struct sk_buff *skb, struct genl_info *info)
{ … }
static int seg6_genl_get_tunsrc(struct sk_buff *skb, struct genl_info *info)
{ … }
#ifdef CONFIG_IPV6_SEG6_HMAC
static int __seg6_hmac_fill_info(struct seg6_hmac_info *hinfo,
struct sk_buff *msg)
{ … }
static int __seg6_genl_dumphmac_element(struct seg6_hmac_info *hinfo,
u32 portid, u32 seq, u32 flags,
struct sk_buff *skb, u8 cmd)
{ … }
static int seg6_genl_dumphmac_start(struct netlink_callback *cb)
{ … }
static int seg6_genl_dumphmac_done(struct netlink_callback *cb)
{ … }
static int seg6_genl_dumphmac(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
#else
static int seg6_genl_dumphmac_start(struct netlink_callback *cb)
{
return 0;
}
static int seg6_genl_dumphmac_done(struct netlink_callback *cb)
{
return 0;
}
static int seg6_genl_dumphmac(struct sk_buff *skb, struct netlink_callback *cb)
{
return -ENOTSUPP;
}
#endif
static int __net_init seg6_net_init(struct net *net)
{ … }
static void __net_exit seg6_net_exit(struct net *net)
{ … }
static struct pernet_operations ip6_segments_ops = …;
static const struct genl_ops seg6_genl_ops[] = …;
static struct genl_family seg6_genl_family __ro_after_init = …;
int __init seg6_init(void)
{ … }
void seg6_exit(void)
{ … }