diff options
Diffstat (limited to 'include/net')
131 files changed, 26615 insertions, 0 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h new file mode 100644 index 000000000000..ed00a995f576 --- /dev/null +++ b/include/net/act_api.h @@ -0,0 +1,116 @@ +#ifndef __NET_ACT_API_H +#define __NET_ACT_API_H + +/* + * Public police action API for classifiers/qdiscs + */ + +#include <net/sch_generic.h> +#include <net/pkt_sched.h> + +#define tca_gen(name) \ +struct tcf_##name *next; \ + u32 index; \ + int refcnt; \ + int bindcnt; \ + u32 capab; \ + int action; \ + struct tcf_t tm; \ + struct gnet_stats_basic bstats; \ + struct gnet_stats_queue qstats; \ + struct gnet_stats_rate_est rate_est; \ + spinlock_t *stats_lock; \ + spinlock_t lock + +struct tcf_police +{ + tca_gen(police); + int result; + u32 ewma_rate; + u32 burst; + u32 mtu; + u32 toks; + u32 ptoks; + psched_time_t t_c; + struct qdisc_rate_table *R_tab; + struct qdisc_rate_table *P_tab; +}; + +#ifdef CONFIG_NET_CLS_ACT + +#define ACT_P_CREATED 1 +#define ACT_P_DELETED 1 + +struct tcf_act_hdr +{ + tca_gen(act_hdr); +}; + +struct tc_action +{ + void *priv; + struct tc_action_ops *ops; + __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ + __u32 order; + struct tc_action *next; +}; + +#define TCA_CAP_NONE 0 +struct tc_action_ops +{ + struct tc_action_ops *next; + char kind[IFNAMSIZ]; + __u32 type; /* TBD to match kind */ + __u32 capab; /* capabilities includes 4 bit version */ + struct module *owner; + int (*act)(struct sk_buff **, struct tc_action *); + int (*get_stats)(struct sk_buff *, struct tc_action *); + int (*dump)(struct sk_buff *, struct tc_action *,int , int); + int (*cleanup)(struct tc_action *, int bind); + int (*lookup)(struct tc_action *, u32 ); + int (*init)(struct rtattr *,struct rtattr *,struct tc_action *, int , int ); + int (*walk)(struct sk_buff *, struct netlink_callback *, int , struct tc_action *); +}; + +extern int tcf_register_action(struct tc_action_ops *a); +extern int tcf_unregister_action(struct tc_action_ops *a); +extern void tcf_action_destroy(struct tc_action *a, int bind); +extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res); +extern struct tc_action *tcf_action_init(struct rtattr *rta, struct rtattr *est, char *n, int ovr, int bind, int *err); +extern struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, char *n, int ovr, int bind, int *err); +extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); +extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); +extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); +extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); +#endif /* CONFIG_NET_CLS_ACT */ + +extern int tcf_police(struct sk_buff *skb, struct tcf_police *p); +extern void tcf_police_destroy(struct tcf_police *p); +extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est); +extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p); +extern int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *p); + +static inline int +tcf_police_release(struct tcf_police *p, int bind) +{ + int ret = 0; +#ifdef CONFIG_NET_CLS_ACT + if (p) { + if (bind) { + p->bindcnt--; + } + p->refcnt--; + if (p->refcnt <= 0 && !p->bindcnt) { + tcf_police_destroy(p); + ret = 1; + } + } +#else + if (p && --p->refcnt == 0) + tcf_police_destroy(p); + +#endif /* CONFIG_NET_CLS_ACT */ + return ret; +} + +#endif diff --git a/include/net/addrconf.h b/include/net/addrconf.h new file mode 100644 index 000000000000..7af9a13cb9be --- /dev/null +++ b/include/net/addrconf.h @@ -0,0 +1,240 @@ +#ifndef _ADDRCONF_H +#define _ADDRCONF_H + +#define RETRANS_TIMER HZ + +#define MAX_RTR_SOLICITATIONS 3 +#define RTR_SOLICITATION_INTERVAL (4*HZ) + +#define MIN_VALID_LIFETIME (2*3600) /* 2 hours */ + +#define TEMP_VALID_LIFETIME (7*86400) +#define TEMP_PREFERRED_LIFETIME (86400) +#define REGEN_MAX_RETRY (5) +#define MAX_DESYNC_FACTOR (600) + +#define ADDR_CHECK_FREQUENCY (120*HZ) + +#define IPV6_MAX_ADDRESSES 16 + +struct prefix_info { + __u8 type; + __u8 length; + __u8 prefix_len; + +#if defined(__BIG_ENDIAN_BITFIELD) + __u8 onlink : 1, + autoconf : 1, + reserved : 6; +#elif defined(__LITTLE_ENDIAN_BITFIELD) + __u8 reserved : 6, + autoconf : 1, + onlink : 1; +#else +#error "Please fix <asm/byteorder.h>" +#endif + __u32 valid; + __u32 prefered; + __u32 reserved2; + + struct in6_addr prefix; +}; + + +#ifdef __KERNEL__ + +#include <linux/in6.h> +#include <linux/netdevice.h> +#include <net/if_inet6.h> + +#define IN6_ADDR_HSIZE 16 + +extern int addrconf_init(void); +extern void addrconf_cleanup(void); + +extern int addrconf_add_ifaddr(void __user *arg); +extern int addrconf_del_ifaddr(void __user *arg); +extern int addrconf_set_dstaddr(void __user *arg); + +extern int ipv6_chk_addr(struct in6_addr *addr, + struct net_device *dev, + int strict); +extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr, + struct net_device *dev, + int strict); +extern int ipv6_get_saddr(struct dst_entry *dst, + struct in6_addr *daddr, + struct in6_addr *saddr); +extern int ipv6_dev_get_saddr(struct net_device *dev, + struct in6_addr *daddr, + struct in6_addr *saddr); +extern int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *); +extern int ipv6_rcv_saddr_equal(const struct sock *sk, + const struct sock *sk2); +extern void addrconf_join_solict(struct net_device *dev, |
