diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-26 21:33:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-26 21:33:26 -0400 |
commit | 5c1f4cac6ff75a4a602bae960a054ed3df7e9765 (patch) | |
tree | 31b0b05a41345e9dbf802a309ddf21eb506e8550 /include | |
parent | c6a519d2aac024d8ca5658bddd78af474b274e4b (diff) | |
parent | 56e9b263242ca80a70abd8831343b268315c27dc (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/connector.h | 21 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_nat_core.h | 12 | ||||
-rw-r--r-- | include/linux/sysctl.h | 26 | ||||
-rw-r--r-- | include/net/llc.h | 30 | ||||
-rw-r--r-- | include/net/llc_conn.h | 15 | ||||
-rw-r--r-- | include/net/llc_sap.h | 8 |
6 files changed, 89 insertions, 23 deletions
diff --git a/include/linux/connector.h b/include/linux/connector.h index 96de26301f84..86d4b0a81713 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -104,12 +104,19 @@ struct cn_queue_dev { | |||
104 | struct sock *nls; | 104 | struct sock *nls; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | struct cn_callback { | 107 | struct cn_callback_id { |
108 | unsigned char name[CN_CBQ_NAMELEN]; | 108 | unsigned char name[CN_CBQ_NAMELEN]; |
109 | |||
110 | struct cb_id id; | 109 | struct cb_id id; |
110 | }; | ||
111 | |||
112 | struct cn_callback_data { | ||
113 | void (*destruct_data) (void *); | ||
114 | void *ddata; | ||
115 | |||
116 | void *callback_priv; | ||
111 | void (*callback) (void *); | 117 | void (*callback) (void *); |
112 | void *priv; | 118 | |
119 | void *free; | ||
113 | }; | 120 | }; |
114 | 121 | ||
115 | struct cn_callback_entry { | 122 | struct cn_callback_entry { |
@@ -118,8 +125,8 @@ struct cn_callback_entry { | |||
118 | struct work_struct work; | 125 | struct work_struct work; |
119 | struct cn_queue_dev *pdev; | 126 | struct cn_queue_dev *pdev; |
120 | 127 | ||
121 | void (*destruct_data) (void *); | 128 | struct cn_callback_id id; |
122 | void *ddata; | 129 | struct cn_callback_data data; |
123 | 130 | ||
124 | int seq, group; | 131 | int seq, group; |
125 | struct sock *nls; | 132 | struct sock *nls; |
@@ -144,7 +151,7 @@ int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); | |||
144 | void cn_del_callback(struct cb_id *); | 151 | void cn_del_callback(struct cb_id *); |
145 | int cn_netlink_send(struct cn_msg *, u32, int); | 152 | int cn_netlink_send(struct cn_msg *, u32, int); |
146 | 153 | ||
147 | int cn_queue_add_callback(struct cn_queue_dev *dev, struct cn_callback *cb); | 154 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); |
148 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 155 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
149 | 156 | ||
150 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); | 157 | struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); |
@@ -152,6 +159,8 @@ void cn_queue_free_dev(struct cn_queue_dev *dev); | |||
152 | 159 | ||
153 | int cn_cb_equal(struct cb_id *, struct cb_id *); | 160 | int cn_cb_equal(struct cb_id *, struct cb_id *); |
154 | 161 | ||
162 | void cn_queue_wrapper(void *data); | ||
163 | |||
155 | extern int cn_already_initialized; | 164 | extern int cn_already_initialized; |
156 | 165 | ||
157 | #endif /* __KERNEL__ */ | 166 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h index 3b50eb91f007..30db23f06b03 100644 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ b/include/linux/netfilter_ipv4/ip_nat_core.h | |||
@@ -5,16 +5,14 @@ | |||
5 | 5 | ||
6 | /* This header used to share core functionality between the standalone | 6 | /* This header used to share core functionality between the standalone |
7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ | 7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ |
8 | extern int ip_nat_init(void); | ||
9 | extern void ip_nat_cleanup(void); | ||
10 | 8 | ||
11 | extern unsigned int nat_packet(struct ip_conntrack *ct, | 9 | extern unsigned int ip_nat_packet(struct ip_conntrack *ct, |
12 | enum ip_conntrack_info conntrackinfo, | 10 | enum ip_conntrack_info conntrackinfo, |
13 | unsigned int hooknum, | 11 | unsigned int hooknum, |
14 | struct sk_buff **pskb); | 12 | struct sk_buff **pskb); |
15 | 13 | ||
16 | extern int icmp_reply_translation(struct sk_buff **pskb, | 14 | extern int ip_nat_icmp_reply_translation(struct sk_buff **pskb, |
17 | struct ip_conntrack *ct, | 15 | struct ip_conntrack *ct, |
18 | enum ip_nat_manip_type manip, | 16 | enum ip_nat_manip_type manip, |
19 | enum ip_conntrack_dir dir); | 17 | enum ip_conntrack_dir dir); |
20 | #endif /* _IP_NAT_CORE_H */ | 18 | #endif /* _IP_NAT_CORE_H */ |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3a29a9f9b451..fc8e367f671e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -202,7 +202,8 @@ enum | |||
202 | NET_TR=14, | 202 | NET_TR=14, |
203 | NET_DECNET=15, | 203 | NET_DECNET=15, |
204 | NET_ECONET=16, | 204 | NET_ECONET=16, |
205 | NET_SCTP=17, | 205 | NET_SCTP=17, |
206 | NET_LLC=18, | ||
206 | }; | 207 | }; |
207 | 208 | ||
208 | /* /proc/sys/kernel/random */ | 209 | /* /proc/sys/kernel/random */ |
@@ -522,6 +523,29 @@ enum { | |||
522 | NET_IPX_FORWARDING=2 | 523 | NET_IPX_FORWARDING=2 |
523 | }; | 524 | }; |
524 | 525 | ||
526 | /* /proc/sys/net/llc */ | ||
527 | enum { | ||
528 | NET_LLC2=1, | ||
529 | NET_LLC_STATION=2, | ||
530 | }; | ||
531 | |||
532 | /* /proc/sys/net/llc/llc2 */ | ||
533 | enum { | ||
534 | NET_LLC2_TIMEOUT=1, | ||
535 | }; | ||
536 | |||
537 | /* /proc/sys/net/llc/station */ | ||
538 | enum { | ||
539 | NET_LLC_STATION_ACK_TIMEOUT=1, | ||
540 | }; | ||
541 | |||
542 | /* /proc/sys/net/llc/llc2/timeout */ | ||
543 | enum { | ||
544 | NET_LLC2_ACK_TIMEOUT=1, | ||
545 | NET_LLC2_P_TIMEOUT=2, | ||
546 | NET_LLC2_REJ_TIMEOUT=3, | ||
547 | NET_LLC2_BUSY_TIMEOUT=4, | ||
548 | }; | ||
525 | 549 | ||
526 | /* /proc/sys/net/appletalk */ | 550 | /* /proc/sys/net/appletalk */ |
527 | enum { | 551 | enum { |
diff --git a/include/net/llc.h b/include/net/llc.h index 71769a5aeef3..1adb2ef3f6f7 100644 --- a/include/net/llc.h +++ b/include/net/llc.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
19 | 19 | ||
20 | #include <asm/atomic.h> | ||
21 | |||
20 | struct net_device; | 22 | struct net_device; |
21 | struct packet_type; | 23 | struct packet_type; |
22 | struct sk_buff; | 24 | struct sk_buff; |
@@ -44,6 +46,7 @@ struct llc_sap { | |||
44 | unsigned char state; | 46 | unsigned char state; |
45 | unsigned char p_bit; | 47 | unsigned char p_bit; |
46 | unsigned char f_bit; | 48 | unsigned char f_bit; |
49 | atomic_t refcnt; | ||
47 | int (*rcv_func)(struct sk_buff *skb, | 50 | int (*rcv_func)(struct sk_buff *skb, |
48 | struct net_device *dev, | 51 | struct net_device *dev, |
49 | struct packet_type *pt, | 52 | struct packet_type *pt, |
@@ -81,13 +84,27 @@ extern struct llc_sap *llc_sap_open(unsigned char lsap, | |||
81 | struct net_device *dev, | 84 | struct net_device *dev, |
82 | struct packet_type *pt, | 85 | struct packet_type *pt, |
83 | struct net_device *orig_dev)); | 86 | struct net_device *orig_dev)); |
87 | static inline void llc_sap_hold(struct llc_sap *sap) | ||
88 | { | ||
89 | atomic_inc(&sap->refcnt); | ||
90 | } | ||
91 | |||
84 | extern void llc_sap_close(struct llc_sap *sap); | 92 | extern void llc_sap_close(struct llc_sap *sap); |
85 | 93 | ||
94 | static inline void llc_sap_put(struct llc_sap *sap) | ||
95 | { | ||
96 | if (atomic_dec_and_test(&sap->refcnt)) | ||
97 | llc_sap_close(sap); | ||
98 | } | ||
99 | |||
86 | extern struct llc_sap *llc_sap_find(unsigned char sap_value); | 100 | extern struct llc_sap *llc_sap_find(unsigned char sap_value); |
87 | 101 | ||
88 | extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, | 102 | extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb, |
89 | unsigned char *dmac, unsigned char dsap); | 103 | unsigned char *dmac, unsigned char dsap); |
90 | 104 | ||
105 | extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb); | ||
106 | extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb); | ||
107 | |||
91 | extern int llc_station_init(void); | 108 | extern int llc_station_init(void); |
92 | extern void llc_station_exit(void); | 109 | extern void llc_station_exit(void); |
93 | 110 | ||
@@ -98,4 +115,17 @@ extern void llc_proc_exit(void); | |||
98 | #define llc_proc_init() (0) | 115 | #define llc_proc_init() (0) |
99 | #define llc_proc_exit() do { } while(0) | 116 | #define llc_proc_exit() do { } while(0) |
100 | #endif /* CONFIG_PROC_FS */ | 117 | #endif /* CONFIG_PROC_FS */ |
118 | #ifdef CONFIG_SYSCTL | ||
119 | extern int llc_sysctl_init(void); | ||
120 | extern void llc_sysctl_exit(void); | ||
121 | |||
122 | extern int sysctl_llc2_ack_timeout; | ||
123 | extern int sysctl_llc2_busy_timeout; | ||
124 | extern int sysctl_llc2_p_timeout; | ||
125 | extern int sysctl_llc2_rej_timeout; | ||
126 | extern int sysctl_llc_station_ack_timeout; | ||
127 | #else | ||
128 | #define llc_sysctl_init() (0) | ||
129 | #define llc_sysctl_exit() do { } while(0) | ||
130 | #endif /* CONFIG_SYSCTL */ | ||
101 | #endif /* LLC_H */ | 131 | #endif /* LLC_H */ |
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h index 8ad3bc2c23d7..54852ff6033b 100644 --- a/include/net/llc_conn.h +++ b/include/net/llc_conn.h | |||
@@ -19,14 +19,14 @@ | |||
19 | #define LLC_EVENT 1 | 19 | #define LLC_EVENT 1 |
20 | #define LLC_PACKET 2 | 20 | #define LLC_PACKET 2 |
21 | 21 | ||
22 | #define LLC_P_TIME 2 | 22 | #define LLC2_P_TIME 2 |
23 | #define LLC_ACK_TIME 1 | 23 | #define LLC2_ACK_TIME 1 |
24 | #define LLC_REJ_TIME 3 | 24 | #define LLC2_REJ_TIME 3 |
25 | #define LLC_BUSY_TIME 3 | 25 | #define LLC2_BUSY_TIME 3 |
26 | 26 | ||
27 | struct llc_timer { | 27 | struct llc_timer { |
28 | struct timer_list timer; | 28 | struct timer_list timer; |
29 | u16 expire; /* timer expire time */ | 29 | unsigned long expire; /* timer expire time */ |
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct llc_sock { | 32 | struct llc_sock { |
@@ -38,6 +38,7 @@ struct llc_sock { | |||
38 | struct llc_addr laddr; /* lsap/mac pair */ | 38 | struct llc_addr laddr; /* lsap/mac pair */ |
39 | struct llc_addr daddr; /* dsap/mac pair */ | 39 | struct llc_addr daddr; /* dsap/mac pair */ |
40 | struct net_device *dev; /* device to send to remote */ | 40 | struct net_device *dev; /* device to send to remote */ |
41 | u32 copied_seq; /* head of yet unread data */ | ||
41 | u8 retry_count; /* number of retries */ | 42 | u8 retry_count; /* number of retries */ |
42 | u8 ack_must_be_send; | 43 | u8 ack_must_be_send; |
43 | u8 first_pdu_Ns; | 44 | u8 first_pdu_Ns; |
@@ -92,7 +93,8 @@ static __inline__ char llc_backlog_type(struct sk_buff *skb) | |||
92 | return skb->cb[sizeof(skb->cb) - 1]; | 93 | return skb->cb[sizeof(skb->cb) - 1]; |
93 | } | 94 | } |
94 | 95 | ||
95 | extern struct sock *llc_sk_alloc(int family, int priority, struct proto *prot); | 96 | extern struct sock *llc_sk_alloc(int family, unsigned int __nocast priority, |
97 | struct proto *prot); | ||
96 | extern void llc_sk_free(struct sock *sk); | 98 | extern void llc_sk_free(struct sock *sk); |
97 | 99 | ||
98 | extern void llc_sk_reset(struct sock *sk); | 100 | extern void llc_sk_reset(struct sock *sk); |
@@ -115,5 +117,4 @@ extern void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk); | |||
115 | 117 | ||
116 | extern u8 llc_data_accept_state(u8 state); | 118 | extern u8 llc_data_accept_state(u8 state); |
117 | extern void llc_build_offset_table(void); | 119 | extern void llc_build_offset_table(void); |
118 | extern int llc_release_sockets(struct llc_sap *sap); | ||
119 | #endif /* LLC_CONN_H */ | 120 | #endif /* LLC_CONN_H */ |
diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h index 353baaa627f3..2c56dbece729 100644 --- a/include/net/llc_sap.h +++ b/include/net/llc_sap.h | |||
@@ -12,11 +12,15 @@ | |||
12 | * See the GNU General Public License for more details. | 12 | * See the GNU General Public License for more details. |
13 | */ | 13 | */ |
14 | struct llc_sap; | 14 | struct llc_sap; |
15 | struct net_device; | ||
15 | struct sk_buff; | 16 | struct sk_buff; |
17 | struct sock; | ||
16 | 18 | ||
17 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); | 19 | extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb); |
18 | extern void llc_save_primitive(struct sk_buff* skb, unsigned char prim); | 20 | extern void llc_save_primitive(struct sock *sk, struct sk_buff* skb, |
19 | extern struct sk_buff *llc_alloc_frame(void); | 21 | unsigned char prim); |
22 | extern struct sk_buff *llc_alloc_frame(struct sock *sk, | ||
23 | struct net_device *dev); | ||
20 | 24 | ||
21 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, | 25 | extern void llc_build_and_send_test_pkt(struct llc_sap *sap, |
22 | struct sk_buff *skb, | 26 | struct sk_buff *skb, |