SOURCES (LINUX_2_6): linux-net-2.6.19.patch - added missing includes.
cieciwa
cieciwa at pld-linux.org
Fri Sep 22 13:18:09 CEST 2006
Author: cieciwa Date: Fri Sep 22 11:18:09 2006 GMT
Module: SOURCES Tag: LINUX_2_6
---- Log message:
- added missing includes.
---- Files affected:
SOURCES:
linux-net-2.6.19.patch (1.1.2.3 -> 1.1.2.4)
---- Diffs:
================================================================
Index: SOURCES/linux-net-2.6.19.patch
diff -u SOURCES/linux-net-2.6.19.patch:1.1.2.3 SOURCES/linux-net-2.6.19.patch:1.1.2.4
--- SOURCES/linux-net-2.6.19.patch:1.1.2.3 Fri Sep 22 12:58:07 2006
+++ SOURCES/linux-net-2.6.19.patch Fri Sep 22 13:18:04 2006
@@ -41730,3 +41730,3377 @@
__XFRMNLGRP_MAX
};
#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
+diff -Nur linux-2.6.18-rc5/include/net/act_api.h linux-2.6.19/include/net/act_api.h
+--- linux-2.6.18-rc5/include/net/act_api.h 2006-08-28 05:41:48.000000000 +0200
++++ linux-2.6.19/include/net/act_api.h 2006-09-22 10:04:57.000000000 +0200
+@@ -8,70 +8,110 @@
+ #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_common {
++ struct tcf_common *tcfc_next;
++ u32 tcfc_index;
++ int tcfc_refcnt;
++ int tcfc_bindcnt;
++ u32 tcfc_capab;
++ int tcfc_action;
++ struct tcf_t tcfc_tm;
++ struct gnet_stats_basic tcfc_bstats;
++ struct gnet_stats_queue tcfc_qstats;
++ struct gnet_stats_rate_est tcfc_rate_est;
++ spinlock_t *tcfc_stats_lock;
++ spinlock_t tcfc_lock;
++};
++#define tcf_next common.tcfc_next
++#define tcf_index common.tcfc_index
++#define tcf_refcnt common.tcfc_refcnt
++#define tcf_bindcnt common.tcfc_bindcnt
++#define tcf_capab common.tcfc_capab
++#define tcf_action common.tcfc_action
++#define tcf_tm common.tcfc_tm
++#define tcf_bstats common.tcfc_bstats
++#define tcf_qstats common.tcfc_qstats
++#define tcf_rate_est common.tcfc_rate_est
++#define tcf_stats_lock common.tcfc_stats_lock
++#define tcf_lock common.tcfc_lock
++
++struct tcf_police {
++ struct tcf_common common;
++ int tcfp_result;
++ u32 tcfp_ewma_rate;
++ u32 tcfp_burst;
++ u32 tcfp_mtu;
++ u32 tcfp_toks;
++ u32 tcfp_ptoks;
++ psched_time_t tcfp_t_c;
++ struct qdisc_rate_table *tcfp_R_tab;
++ struct qdisc_rate_table *tcfp_P_tab;
++};
++#define to_police(pc) \
++ container_of(pc, struct tcf_police, common)
+
+-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;
++struct tcf_hashinfo {
++ struct tcf_common **htab;
++ unsigned int hmask;
++ rwlock_t *lock;
+ };
+
++static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
++{
++ return index & hmask;
++}
++
+ #ifdef CONFIG_NET_CLS_ACT
+
+ #define ACT_P_CREATED 1
+ #define ACT_P_DELETED 1
+
+-struct tcf_act_hdr
+-{
+- tca_gen(act_hdr);
++struct tcf_act_hdr {
++ struct tcf_common common;
+ };
+
+-struct tc_action
+-{
+- void *priv;
+- struct tc_action_ops *ops;
+- __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
+- __u32 order;
+- struct tc_action *next;
++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 {
+ struct tc_action_ops *next;
++ struct tcf_hashinfo *hinfo;
+ 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 *, struct tcf_result *);
+ int (*get_stats)(struct sk_buff *, struct tc_action *);
+- int (*dump)(struct sk_buff *, struct tc_action *,int , int);
++ 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 *);
++ 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 struct tcf_common *tcf_hash_lookup(u32 index,
++ struct tcf_hashinfo *hinfo);
++extern void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
++extern int tcf_hash_release(struct tcf_common *p, int bind,
++ struct tcf_hashinfo *hinfo);
++extern int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
++ int type, struct tc_action *a);
++extern u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
++extern int tcf_hash_search(struct tc_action *a, u32 index);
++extern struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
++ int bind, struct tcf_hashinfo *hinfo);
++extern struct tcf_common *tcf_hash_create(u32 index, struct rtattr *est,
++ struct tc_action *a, int size,
++ int bind, u32 *idx_gen,
++ struct tcf_hashinfo *hinfo);
++extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
++
+ 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);
+@@ -96,17 +136,17 @@
+ int ret = 0;
+ #ifdef CONFIG_NET_CLS_ACT
+ if (p) {
+- if (bind) {
+- p->bindcnt--;
+- }
+- p->refcnt--;
+- if (p->refcnt <= 0 && !p->bindcnt) {
++ if (bind)
++ p->tcf_bindcnt--;
++
++ p->tcf_refcnt--;
++ if (p->tcf_refcnt <= 0 && !p->tcf_bindcnt) {
+ tcf_police_destroy(p);
+ ret = 1;
+ }
+ }
+ #else
+- if (p && --p->refcnt == 0)
++ if (p && --p->tcf_refcnt == 0)
+ tcf_police_destroy(p);
+
+ #endif /* CONFIG_NET_CLS_ACT */
+diff -Nur linux-2.6.18-rc5/include/net/act_generic.h linux-2.6.19/include/net/act_generic.h
+--- linux-2.6.18-rc5/include/net/act_generic.h 2006-08-28 05:41:48.000000000 +0200
++++ linux-2.6.19/include/net/act_generic.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,142 +0,0 @@
+-/*
+- * include/net/act_generic.h
+- *
+-*/
+-#ifndef _NET_ACT_GENERIC_H
+-#define _NET_ACT_GENERIC_H
+-static inline int tcf_defact_release(struct tcf_defact *p, int bind)
+-{
+- int ret = 0;
+- if (p) {
+- if (bind) {
+- p->bindcnt--;
+- }
+- p->refcnt--;
+- if (p->bindcnt <= 0 && p->refcnt <= 0) {
+- kfree(p->defdata);
+- tcf_hash_destroy(p);
+- ret = 1;
+- }
+- }
+- return ret;
+-}
+-
+-static inline int
+-alloc_defdata(struct tcf_defact *p, u32 datalen, void *defdata)
+-{
+- p->defdata = kmalloc(datalen, GFP_KERNEL);
+- if (p->defdata == NULL)
+- return -ENOMEM;
+- p->datalen = datalen;
+- memcpy(p->defdata, defdata, datalen);
+- return 0;
+-}
+-
+-static inline int
+-realloc_defdata(struct tcf_defact *p, u32 datalen, void *defdata)
+-{
+- /* safer to be just brute force for now */
+- kfree(p->defdata);
+- return alloc_defdata(p, datalen, defdata);
+-}
+-
+-static inline int
+-tcf_defact_init(struct rtattr *rta, struct rtattr *est,
+- struct tc_action *a, int ovr, int bind)
+-{
+- struct rtattr *tb[TCA_DEF_MAX];
+- struct tc_defact *parm;
+- struct tcf_defact *p;
+- void *defdata;
+- u32 datalen = 0;
+- int ret = 0;
+-
+- if (rta == NULL || rtattr_parse_nested(tb, TCA_DEF_MAX, rta) < 0)
+- return -EINVAL;
+-
+- if (tb[TCA_DEF_PARMS - 1] == NULL ||
+- RTA_PAYLOAD(tb[TCA_DEF_PARMS - 1]) < sizeof(*parm))
+- return -EINVAL;
+-
+- parm = RTA_DATA(tb[TCA_DEF_PARMS - 1]);
+- defdata = RTA_DATA(tb[TCA_DEF_DATA - 1]);
+- if (defdata == NULL)
+- return -EINVAL;
+-
+- datalen = RTA_PAYLOAD(tb[TCA_DEF_DATA - 1]);
+- if (datalen <= 0)
+- return -EINVAL;
+-
+- p = tcf_hash_check(parm->index, a, ovr, bind);
+- if (p == NULL) {
+- p = tcf_hash_create(parm->index, est, a, sizeof(*p), ovr, bind);
+- if (p == NULL)
+- return -ENOMEM;
+-
+- ret = alloc_defdata(p, datalen, defdata);
+- if (ret < 0) {
+- kfree(p);
+- return ret;
+- }
+- ret = ACT_P_CREATED;
+- } else {
+- if (!ovr) {
+- tcf_defact_release(p, bind);
+- return -EEXIST;
+- }
+- realloc_defdata(p, datalen, defdata);
+- }
+-
+- spin_lock_bh(&p->lock);
+- p->action = parm->action;
+- spin_unlock_bh(&p->lock);
+- if (ret == ACT_P_CREATED)
+- tcf_hash_insert(p);
+- return ret;
+-}
+-
+-static inline int tcf_defact_cleanup(struct tc_action *a, int bind)
+-{
+- struct tcf_defact *p = PRIV(a, defact);
+-
+- if (p != NULL)
+- return tcf_defact_release(p, bind);
+- return 0;
+-}
+-
+-static inline int
+-tcf_defact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
+-{
+- unsigned char *b = skb->tail;
+- struct tc_defact opt;
+- struct tcf_defact *p = PRIV(a, defact);
+- struct tcf_t t;
+-
+- opt.index = p->index;
+- opt.refcnt = p->refcnt - ref;
+- opt.bindcnt = p->bindcnt - bind;
+- opt.action = p->action;
+- RTA_PUT(skb, TCA_DEF_PARMS, sizeof(opt), &opt);
+- RTA_PUT(skb, TCA_DEF_DATA, p->datalen, p->defdata);
+- t.install = jiffies_to_clock_t(jiffies - p->tm.install);
+- t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse);
+- t.expires = jiffies_to_clock_t(p->tm.expires);
+- RTA_PUT(skb, TCA_DEF_TM, sizeof(t), &t);
+- return skb->len;
+-
+-rtattr_failure:
+- skb_trim(skb, b - skb->data);
+- return -1;
+-}
+-
+-#define tca_use_default_ops \
+- .dump = tcf_defact_dump, \
+- .cleanup = tcf_defact_cleanup, \
+- .init = tcf_defact_init, \
+- .walk = tcf_generic_walker, \
+-
+-#define tca_use_default_defines(name) \
+- static u32 idx_gen; \
+- static struct tcf_defact *tcf_##name_ht[MY_TAB_SIZE]; \
+- static DEFINE_RWLOCK(##name_lock);
+-#endif /* _NET_ACT_GENERIC_H */
+diff -Nur linux-2.6.18-rc5/include/net/addrconf.h linux-2.6.19/include/net/addrconf.h
+--- linux-2.6.18-rc5/include/net/addrconf.h 2006-08-28 05:41:48.000000000 +0200
++++ linux-2.6.19/include/net/addrconf.h 2006-09-22 10:04:57.000000000 +0200
+@@ -61,6 +61,13 @@
+ extern int ipv6_chk_addr(struct in6_addr *addr,
+ struct net_device *dev,
+ int strict);
++/* XXX: this is a placeholder till addrconf supports */
++#ifdef CONFIG_IPV6_MIP6
++static inline int ipv6_chk_home_addr(struct in6_addr *addr)
++{
++ return 0;
++}
++#endif
+ extern struct inet6_ifaddr * ipv6_get_ifaddr(struct in6_addr *addr,
+ struct net_device *dev,
+ int strict);
+diff -Nur linux-2.6.18-rc5/include/net/cipso_ipv4.h linux-2.6.19/include/net/cipso_ipv4.h
+--- linux-2.6.18-rc5/include/net/cipso_ipv4.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.19/include/net/cipso_ipv4.h 2006-09-22 10:04:57.000000000 +0200
+@@ -0,0 +1,246 @@
++/*
++ * CIPSO - Commercial IP Security Option
++ *
++ * This is an implementation of the CIPSO 2.2 protocol as specified in
++ * draft-ietf-cipso-ipsecurity-01.txt with additional tag types as found in
++ * FIPS-188, copies of both documents can be found in the Documentation
++ * directory. While CIPSO never became a full IETF RFC standard many vendors
++ * have chosen to adopt the protocol and over the years it has become a
++ * de-facto standard for labeled networking.
++ *
++ * Author: Paul Moore <paul.moore at hp.com>
++ *
++ */
++
++/*
++ * (c) Copyright Hewlett-Packard Development Company, L.P., 2006
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
++ * the GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ *
++ */
++
++#ifndef _CIPSO_IPV4_H
++#define _CIPSO_IPV4_H
++
++#include <linux/types.h>
++#include <linux/rcupdate.h>
++#include <linux/list.h>
++#include <linux/net.h>
++#include <linux/skbuff.h>
++#include <net/netlabel.h>
++
++/* known doi values */
++#define CIPSO_V4_DOI_UNKNOWN 0x00000000
++
++/* tag types */
++#define CIPSO_V4_TAG_INVALID 0
++#define CIPSO_V4_TAG_RBITMAP 1
++#define CIPSO_V4_TAG_ENUM 2
++#define CIPSO_V4_TAG_RANGE 5
++#define CIPSO_V4_TAG_PBITMAP 6
++#define CIPSO_V4_TAG_FREEFORM 7
++
++/* doi mapping types */
++#define CIPSO_V4_MAP_UNKNOWN 0
++#define CIPSO_V4_MAP_STD 1
++#define CIPSO_V4_MAP_PASS 2
++
++/* limits */
++#define CIPSO_V4_MAX_REM_LVLS 256
++#define CIPSO_V4_INV_LVL 0x80000000
++#define CIPSO_V4_MAX_LOC_LVLS (CIPSO_V4_INV_LVL - 1)
++#define CIPSO_V4_MAX_REM_CATS 65536
++#define CIPSO_V4_INV_CAT 0x80000000
++#define CIPSO_V4_MAX_LOC_CATS (CIPSO_V4_INV_CAT - 1)
++
++/*
++ * CIPSO DOI definitions
++ */
++
++/* DOI definition struct */
++#define CIPSO_V4_TAG_MAXCNT 5
++struct cipso_v4_doi {
++ u32 doi;
++ u32 type;
++ union {
++ struct cipso_v4_std_map_tbl *std;
++ } map;
++ u8 tags[CIPSO_V4_TAG_MAXCNT];
++
++ u32 valid;
++ struct list_head list;
++ struct rcu_head rcu;
++ struct list_head dom_list;
++};
++
++/* Standard CIPSO mapping table */
++/* NOTE: the highest order bit (i.e. 0x80000000) is an 'invalid' flag, if the
++ * bit is set then consider that value as unspecified, meaning the
++ * mapping for that particular level/category is invalid */
++struct cipso_v4_std_map_tbl {
++ struct {
++ u32 *cipso;
++ u32 *local;
++ u32 cipso_size;
++ u32 local_size;
++ } lvl;
++ struct {
++ u32 *cipso;
++ u32 *local;
++ u32 cipso_size;
++ u32 local_size;
++ } cat;
++};
++
++/*
++ * Sysctl Variables
++ */
++
++#ifdef CONFIG_NETLABEL
++extern int cipso_v4_cache_enabled;
++extern int cipso_v4_cache_bucketsize;
++extern int cipso_v4_rbm_optfmt;
++extern int cipso_v4_rbm_strictvalid;
++#endif
++
++/*
++ * Helper Functions
++ */
++
++#define CIPSO_V4_OPTEXIST(x) (IPCB(x)->opt.cipso != 0)
++#define CIPSO_V4_OPTPTR(x) ((x)->nh.raw + IPCB(x)->opt.cipso)
++
++/*
++ * DOI List Functions
++ */
++
++#ifdef CONFIG_NETLABEL
++int cipso_v4_doi_add(struct cipso_v4_doi *doi_def);
++int cipso_v4_doi_remove(u32 doi, void (*callback) (struct rcu_head * head));
++struct cipso_v4_doi *cipso_v4_doi_getdef(u32 doi);
++struct sk_buff *cipso_v4_doi_dump_all(size_t headroom);
++struct sk_buff *cipso_v4_doi_dump(u32 doi, size_t headroom);
++int cipso_v4_doi_domhsh_add(struct cipso_v4_doi *doi_def, const char *domain);
++int cipso_v4_doi_domhsh_remove(struct cipso_v4_doi *doi_def,
++ const char *domain);
++#else
++static inline int cipso_v4_doi_add(struct cipso_v4_doi *doi_def)
++{
++ return -ENOSYS;
++}
++
++static inline int cipso_v4_doi_remove(u32 doi,
++ void (*callback) (struct rcu_head * head))
++{
++ return 0;
++}
++
++static inline struct cipso_v4_doi *cipso_v4_doi_getdef(u32 doi)
++{
++ return NULL;
++}
++
++static inline struct sk_buff *cipso_v4_doi_dump_all(size_t headroom)
++{
++ return NULL;
++}
++
++static inline struct sk_buff *cipso_v4_doi_dump(u32 doi, size_t headroom)
++{
++ return NULL;
++}
++
++static inline int cipso_v4_doi_domhsh_add(struct cipso_v4_doi *doi_def,
++ const char *domain)
++{
++ return -ENOSYS;
++}
++
++static inline int cipso_v4_doi_domhsh_remove(struct cipso_v4_doi *doi_def,
++ const char *domain)
++{
++ return 0;
++}
++#endif /* CONFIG_NETLABEL */
++
++/*
++ * Label Mapping Cache Functions
++ */
++
++#ifdef CONFIG_NETLABEL
++void cipso_v4_cache_invalidate(void);
++int cipso_v4_cache_add(const struct sk_buff *skb,
++ const struct netlbl_lsm_secattr *secattr);
++#else
++static inline void cipso_v4_cache_invalidate(void)
++{
++ return;
++}
++
++static inline int cipso_v4_cache_add(const struct sk_buff *skb,
++ const struct netlbl_lsm_secattr *secattr)
++{
++ return 0;
++}
++#endif /* CONFIG_NETLABEL */
++
++/*
++ * Protocol Handling Functions
++ */
++
++#ifdef CONFIG_NETLABEL
++void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway);
++int cipso_v4_socket_setattr(const struct socket *sock,
++ const struct cipso_v4_doi *doi_def,
++ const struct netlbl_lsm_secattr *secattr);
++int cipso_v4_socket_getattr(const struct socket *sock,
++ struct netlbl_lsm_secattr *secattr);
++int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
++ struct netlbl_lsm_secattr *secattr);
++int cipso_v4_validate(unsigned char **option);
++#else
++static inline void cipso_v4_error(struct sk_buff *skb,
++ int error,
++ u32 gateway)
++{
++ return;
++}
++
++static inline int cipso_v4_socket_setattr(const struct socket *sock,
++ const struct cipso_v4_doi *doi_def,
++ const struct netlbl_lsm_secattr *secattr)
++{
++ return -ENOSYS;
++}
++
++static inline int cipso_v4_socket_getattr(const struct socket *sock,
++ struct netlbl_lsm_secattr *secattr)
++{
++ return -ENOSYS;
++}
++
++static inline int cipso_v4_skbuff_getattr(const struct sk_buff *skb,
++ struct netlbl_lsm_secattr *secattr)
++{
++ return -ENOSYS;
++}
++
++static inline int cipso_v4_validate(unsigned char **option)
++{
++ return -ENOSYS;
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/linux-net-2.6.19.patch?r1=1.1.2.3&r2=1.1.2.4&f=u
More information about the pld-cvs-commit
mailing list