linux/include/net/fib_rules.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NET_FIB_RULES_H
#define __NET_FIB_RULES_H

#include <linux/types.h>
#include <linux/slab.h>
#include <linux/netdevice.h>
#include <linux/fib_rules.h>
#include <linux/refcount.h>
#include <net/flow.h>
#include <net/rtnetlink.h>
#include <net/fib_notifier.h>
#include <linux/indirect_call_wrapper.h>

struct fib_kuid_range {};

struct fib_rule {};

struct fib_lookup_arg {};

struct fib_rules_ops {};

struct fib_rule_notifier_info {};

static inline void fib_rule_get(struct fib_rule *rule)
{}

static inline void fib_rule_put(struct fib_rule *rule)
{}

#ifdef CONFIG_NET_L3_MASTER_DEV
static inline u32 fib_rule_get_table(struct fib_rule *rule,
				     struct fib_lookup_arg *arg)
{}
#else
static inline u32 fib_rule_get_table(struct fib_rule *rule,
				     struct fib_lookup_arg *arg)
{
	return rule->table;
}
#endif

static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
{}

static inline bool fib_rule_port_range_set(const struct fib_rule_port_range *range)
{}

static inline bool fib_rule_port_inrange(const struct fib_rule_port_range *a,
					 __be16 port)
{}

static inline bool fib_rule_port_range_valid(const struct fib_rule_port_range *a)
{}

static inline bool fib_rule_port_range_compare(struct fib_rule_port_range *a,
					       struct fib_rule_port_range *b)
{}

static inline bool fib_rule_requires_fldissect(struct fib_rule *rule)
{}

struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *,
					 struct net *);
void fib_rules_unregister(struct fib_rules_ops *);

int fib_rules_lookup(struct fib_rules_ops *, struct flowi *, int flags,
		     struct fib_lookup_arg *);
int fib_default_rule_add(struct fib_rules_ops *, u32 pref, u32 table);
bool fib_rule_matchall(const struct fib_rule *rule);
int fib_rules_dump(struct net *net, struct notifier_block *nb, int family,
		   struct netlink_ext_ack *extack);
unsigned int fib_rules_seq_read(struct net *net, int family);

int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,
		   struct netlink_ext_ack *extack);
int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr *nlh,
		   struct netlink_ext_ack *extack);

INDIRECT_CALLABLE_DECLARE();
INDIRECT_CALLABLE_DECLARE();

INDIRECT_CALLABLE_DECLARE();
INDIRECT_CALLABLE_DECLARE();

INDIRECT_CALLABLE_DECLARE();
INDIRECT_CALLABLE_DECLARE();
#endif