#ifndef _NET_DST_H
#define _NET_DST_H
#include <net/dst_ops.h>
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>
#include <linux/rcupdate.h>
#include <linux/bug.h>
#include <linux/jiffies.h>
#include <linux/refcount.h>
#include <linux/rcuref.h>
#include <net/neighbour.h>
#include <asm/processor.h>
#include <linux/indirect_call_wrapper.h>
struct sk_buff;
struct dst_entry { … };
struct dst_metrics { … } __aligned(…);
extern const struct dst_metrics dst_default_metrics;
u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
#define DST_METRICS_READ_ONLY …
#define DST_METRICS_REFCOUNTED …
#define DST_METRICS_FLAGS …
#define __DST_METRICS_PTR(Y) …
#define DST_METRICS_PTR(X) …
static inline bool dst_metrics_read_only(const struct dst_entry *dst)
{ … }
void __dst_destroy_metrics_generic(struct dst_entry *dst, unsigned long old);
static inline void dst_destroy_metrics_generic(struct dst_entry *dst)
{ … }
static inline u32 *dst_metrics_write_ptr(struct dst_entry *dst)
{ … }
static inline void dst_init_metrics(struct dst_entry *dst,
const u32 *src_metrics,
bool read_only)
{ … }
static inline void dst_copy_metrics(struct dst_entry *dest, const struct dst_entry *src)
{ … }
static inline u32 *dst_metrics_ptr(struct dst_entry *dst)
{ … }
static inline u32
dst_metric_raw(const struct dst_entry *dst, const int metric)
{ … }
static inline u32
dst_metric(const struct dst_entry *dst, const int metric)
{ … }
static inline u32
dst_metric_advmss(const struct dst_entry *dst)
{ … }
static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
{ … }
#define DST_FEATURE_ECN_CA …
#define DST_FEATURE_MASK …
#define DST_FEATURE_ECN_MASK …
static inline u32
dst_feature(const struct dst_entry *dst, u32 feature)
{ … }
INDIRECT_CALLABLE_DECLARE(…);
INDIRECT_CALLABLE_DECLARE(…);
static inline u32 dst_mtu(const struct dst_entry *dst)
{ … }
static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metric)
{ … }
static inline int
dst_metric_locked(const struct dst_entry *dst, int metric)
{ … }
static inline void dst_hold(struct dst_entry *dst)
{ … }
static inline void dst_use_noref(struct dst_entry *dst, unsigned long time)
{ … }
static inline struct dst_entry *dst_clone(struct dst_entry *dst)
{ … }
void dst_release(struct dst_entry *dst);
void dst_release_immediate(struct dst_entry *dst);
static inline void refdst_drop(unsigned long refdst)
{ … }
static inline void skb_dst_drop(struct sk_buff *skb)
{ … }
static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
{ … }
static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
{ … }
static inline bool dst_hold_safe(struct dst_entry *dst)
{ … }
static inline bool skb_dst_force(struct sk_buff *skb)
{ … }
static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
struct net *net)
{ … }
static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
struct net *net)
{ … }
static inline u32 dst_tclassid(const struct sk_buff *skb)
{ … }
int dst_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb);
static inline int dst_discard(struct sk_buff *skb)
{ … }
void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
int initial_obsolete, unsigned short flags);
void dst_init(struct dst_entry *dst, struct dst_ops *ops,
struct net_device *dev, int initial_obsolete,
unsigned short flags);
void dst_dev_put(struct dst_entry *dst);
static inline void dst_confirm(struct dst_entry *dst)
{ … }
static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
{ … }
static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst,
struct sk_buff *skb)
{ … }
static inline void dst_confirm_neigh(const struct dst_entry *dst,
const void *daddr)
{ … }
static inline void dst_link_failure(struct sk_buff *skb)
{ … }
static inline void dst_set_expires(struct dst_entry *dst, int timeout)
{ … }
INDIRECT_CALLABLE_DECLARE(…);
INDIRECT_CALLABLE_DECLARE(…);
static inline int dst_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{ … }
INDIRECT_CALLABLE_DECLARE(…);
INDIRECT_CALLABLE_DECLARE(…);
static inline int dst_input(struct sk_buff *skb)
{ … }
INDIRECT_CALLABLE_DECLARE(…);
INDIRECT_CALLABLE_DECLARE(…);
static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
{ … }
enum { … };
struct flowi;
#ifndef CONFIG_XFRM
static inline struct dst_entry *xfrm_lookup(struct net *net,
struct dst_entry *dst_orig,
const struct flowi *fl,
const struct sock *sk,
int flags)
{
return dst_orig;
}
static inline struct dst_entry *
xfrm_lookup_with_ifid(struct net *net, struct dst_entry *dst_orig,
const struct flowi *fl, const struct sock *sk,
int flags, u32 if_id)
{
return dst_orig;
}
static inline struct dst_entry *xfrm_lookup_route(struct net *net,
struct dst_entry *dst_orig,
const struct flowi *fl,
const struct sock *sk,
int flags)
{
return dst_orig;
}
static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
{
return NULL;
}
#else
struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
const struct flowi *fl, const struct sock *sk,
int flags);
struct dst_entry *xfrm_lookup_with_ifid(struct net *net,
struct dst_entry *dst_orig,
const struct flowi *fl,
const struct sock *sk, int flags,
u32 if_id);
struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig,
const struct flowi *fl, const struct sock *sk,
int flags);
static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
{ … }
#endif
static inline void skb_dst_update_pmtu(struct sk_buff *skb, u32 mtu)
{ … }
static inline void skb_dst_update_pmtu_no_confirm(struct sk_buff *skb, u32 mtu)
{ … }
struct dst_entry *dst_blackhole_check(struct dst_entry *dst, u32 cookie);
void dst_blackhole_update_pmtu(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb, u32 mtu, bool confirm_neigh);
void dst_blackhole_redirect(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb);
u32 *dst_blackhole_cow_metrics(struct dst_entry *dst, unsigned long old);
struct neighbour *dst_blackhole_neigh_lookup(const struct dst_entry *dst,
struct sk_buff *skb,
const void *daddr);
unsigned int dst_blackhole_mtu(const struct dst_entry *dst);
#endif