#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/rcupdate.h>
#include <linux/in6.h>
#include <linux/slab.h>
#include <net/addrconf.h>
#include <linux/if_addrlabel.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#if 0
#define ADDRLABEL …
#else
#define ADDRLABEL(x...) …
#endif
struct ip6addrlbl_entry { … };
#define IPV6_ADDR_LABEL_DEFAULT …
static const __net_initconst struct ip6addrlbl_init_table
{ … } ip6addrlbl_init_table[] = …;
static bool __ip6addrlbl_match(const struct ip6addrlbl_entry *p,
const struct in6_addr *addr,
int addrtype, int ifindex)
{ … }
static struct ip6addrlbl_entry *__ipv6_addr_label(struct net *net,
const struct in6_addr *addr,
int type, int ifindex)
{ … }
u32 ipv6_addr_label(struct net *net,
const struct in6_addr *addr, int type, int ifindex)
{ … }
static struct ip6addrlbl_entry *ip6addrlbl_alloc(const struct in6_addr *prefix,
int prefixlen, int ifindex,
u32 label)
{ … }
static int __ip6addrlbl_add(struct net *net, struct ip6addrlbl_entry *newp,
int replace)
{ … }
static int ip6addrlbl_add(struct net *net,
const struct in6_addr *prefix, int prefixlen,
int ifindex, u32 label, int replace)
{ … }
static int __ip6addrlbl_del(struct net *net,
const struct in6_addr *prefix, int prefixlen,
int ifindex)
{ … }
static int ip6addrlbl_del(struct net *net,
const struct in6_addr *prefix, int prefixlen,
int ifindex)
{ … }
static int __net_init ip6addrlbl_net_init(struct net *net)
{ … }
static void __net_exit ip6addrlbl_net_exit(struct net *net)
{ … }
static struct pernet_operations ipv6_addr_label_ops = …;
int __init ipv6_addr_label_init(void)
{ … }
void ipv6_addr_label_cleanup(void)
{ … }
static const struct nla_policy ifal_policy[IFAL_MAX+1] = …;
static bool addrlbl_ifindex_exists(struct net *net, int ifindex)
{ … }
static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{ … }
static void ip6addrlbl_putmsg(struct nlmsghdr *nlh,
int prefixlen, int ifindex, u32 lseq)
{
struct ifaddrlblmsg *ifal = nlmsg_data(nlh);
ifal->ifal_family = AF_INET6;
ifal->__ifal_reserved = 0;
ifal->ifal_prefixlen = prefixlen;
ifal->ifal_flags = 0;
ifal->ifal_index = ifindex;
ifal->ifal_seq = lseq;
};
static int ip6addrlbl_fill(struct sk_buff *skb,
const struct ip6addrlbl_entry *p,
u32 lseq,
u32 portid, u32 seq, int event,
unsigned int flags)
{ … }
static int ip6addrlbl_valid_dump_req(const struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{ … }
static int ip6addrlbl_dump(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static inline int ip6addrlbl_msgsize(void)
{ … }
static int ip6addrlbl_valid_get_req(struct sk_buff *skb,
const struct nlmsghdr *nlh,
struct nlattr **tb,
struct netlink_ext_ack *extack)
{ … }
static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{ … }
int __init ipv6_addr_label_rtnl_register(void)
{ … }