aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-05-17 18:53:14 -0400
committerTony Luck <tony.luck@intel.com>2005-05-17 18:53:14 -0400
commit325a479c4c110db278ef3361460a48c4093252cc (patch)
treebcfbf4d0647d9442045639a5c19da59d55190e81 /include/net
parentebcc80c1b6629a445f7471cc1ddb48faf8a84e70 (diff)
parent7f9eaedf894dbaa08c157832e9a6c9c03ffed1ed (diff)
Merge with temp tree to get David's gdb inferior calls patch
Diffstat (limited to 'include/net')
-rw-r--r--include/net/addrconf.h1
-rw-r--r--include/net/pkt_sched.h6
-rw-r--r--include/net/sctp/sm.h42
-rw-r--r--include/net/sctp/structs.h11
-rw-r--r--include/net/sock.h135
-rw-r--r--include/net/xfrm.h10
6 files changed, 117 insertions, 88 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 7af9a13cb9be..f1e5af4be98e 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -46,6 +46,7 @@ struct prefix_info {
46#include <linux/in6.h> 46#include <linux/in6.h>
47#include <linux/netdevice.h> 47#include <linux/netdevice.h>
48#include <net/if_inet6.h> 48#include <net/if_inet6.h>
49#include <net/ipv6.h>
49 50
50#define IN6_ADDR_HSIZE 16 51#define IN6_ADDR_HSIZE 16
51 52
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 87496e3aa330..fcb05a387dbe 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -140,7 +140,7 @@ psched_tod_diff(int delta_sec, int bound)
140 if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1) 140 if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1)
141 return bound; 141 return bound;
142 delta = delta_sec * 1000000; 142 delta = delta_sec * 1000000;
143 if (delta > bound) 143 if (delta > bound || delta < 0)
144 delta = bound; 144 delta = bound;
145 return delta; 145 return delta;
146} 146}
@@ -156,7 +156,9 @@ psched_tod_diff(int delta_sec, int bound)
156 __delta += 1000000; \ 156 __delta += 1000000; \
157 case 1: \ 157 case 1: \
158 __delta += 1000000; \ 158 __delta += 1000000; \
159 case 0: ; \ 159 case 0: \
160 if (__delta > bound || __delta < 0) \
161 __delta = bound; \
160 } \ 162 } \
161 __delta; \ 163 __delta; \
162}) 164})
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 5576db56324d..f4fcee104707 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -407,32 +407,38 @@ sctp_vtag_verify(const struct sctp_chunk *chunk,
407 return 0; 407 return 0;
408} 408}
409 409
410/* Check VTAG of the packet matches the sender's own tag OR its peer's 410/* Check VTAG of the packet matches the sender's own tag and the T bit is
411 * tag and the T bit is set in the Chunk Flags. 411 * not set, OR its peer's tag and the T bit is set in the Chunk Flags.
412 */ 412 */
413static inline int 413static inline int
414sctp_vtag_verify_either(const struct sctp_chunk *chunk, 414sctp_vtag_verify_either(const struct sctp_chunk *chunk,
415 const struct sctp_association *asoc) 415 const struct sctp_association *asoc)
416{ 416{
417 /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2 417 /* RFC 2960 Section 8.5.1, sctpimpguide Section 2.41
418 * 418 *
419 * B) The receiver of a ABORT shall accept the packet if the 419 * B) The receiver of a ABORT MUST accept the packet
420 * Verification Tag field of the packet matches its own tag OR it 420 * if the Verification Tag field of the packet matches its own tag
421 * is set to its peer's tag and the T bit is set in the Chunk 421 * and the T bit is not set
422 * Flags. Otherwise, the receiver MUST silently discard the packet 422 * OR
423 * and take no further action. 423 * it is set to its peer's tag and the T bit is set in the Chunk
424 * 424 * Flags.
425 * (C) The receiver of a SHUTDOWN COMPLETE shall accept the 425 * Otherwise, the receiver MUST silently discard the packet
426 * packet if the Verification Tag field of the packet 426 * and take no further action.
427 * matches its own tag OR it is set to its peer's tag and
428 * the T bit is set in the Chunk Flags. Otherwise, the
429 * receiver MUST silently discard the packet and take no
430 * further action....
431 * 427 *
428 * C) The receiver of a SHUTDOWN COMPLETE shall accept the packet
429 * if the Verification Tag field of the packet matches its own tag
430 * and the T bit is not set
431 * OR
432 * it is set to its peer's tag and the T bit is set in the Chunk
433 * Flags.
434 * Otherwise, the receiver MUST silently discard the packet
435 * and take no further action. An endpoint MUST ignore the
436 * SHUTDOWN COMPLETE if it is not in the SHUTDOWN-ACK-SENT state.
432 */ 437 */
433 if ((ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag) || 438 if ((!sctp_test_T_bit(chunk) &&
434 (sctp_test_T_bit(chunk) && (ntohl(chunk->sctp_hdr->vtag) 439 (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) ||
435 == asoc->c.peer_vtag))) { 440 (sctp_test_T_bit(chunk) &&
441 (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) {
436 return 1; 442 return 1;
437 } 443 }
438 444
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7e64cf6bda1e..6c24d9cd3d66 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -154,6 +154,13 @@ extern struct sctp_globals {
154 int max_retrans_path; 154 int max_retrans_path;
155 int max_retrans_init; 155 int max_retrans_init;
156 156
157 /*
158 * Policy for preforming sctp/socket accounting
159 * 0 - do socket level accounting, all assocs share sk_sndbuf
160 * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes
161 */
162 int sndbuf_policy;
163
157 /* HB.interval - 30 seconds */ 164 /* HB.interval - 30 seconds */
158 int hb_interval; 165 int hb_interval;
159 166
@@ -207,6 +214,7 @@ extern struct sctp_globals {
207#define sctp_valid_cookie_life (sctp_globals.valid_cookie_life) 214#define sctp_valid_cookie_life (sctp_globals.valid_cookie_life)
208#define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable) 215#define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable)
209#define sctp_max_retrans_association (sctp_globals.max_retrans_association) 216#define sctp_max_retrans_association (sctp_globals.max_retrans_association)
217#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy)
210#define sctp_max_retrans_path (sctp_globals.max_retrans_path) 218#define sctp_max_retrans_path (sctp_globals.max_retrans_path)
211#define sctp_max_retrans_init (sctp_globals.max_retrans_init) 219#define sctp_max_retrans_init (sctp_globals.max_retrans_init)
212#define sctp_hb_interval (sctp_globals.hb_interval) 220#define sctp_hb_interval (sctp_globals.hb_interval)
@@ -1212,7 +1220,8 @@ struct sctp_endpoint {
1212 /* Default timeouts. */ 1220 /* Default timeouts. */
1213 int timeouts[SCTP_NUM_TIMEOUT_TYPES]; 1221 int timeouts[SCTP_NUM_TIMEOUT_TYPES];
1214 1222
1215 /* Various thresholds. */ 1223 /* sendbuf acct. policy. */
1224 __u32 sndbuf_policy;
1216 1225
1217 /* Name for debugging output... */ 1226 /* Name for debugging output... */
1218 char *debug_name; 1227 char *debug_name;
diff --git a/include/net/sock.h b/include/net/sock.h
index be81cabd0da3..cc4c9190b7fd 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -90,17 +90,17 @@ do { spin_lock_init(&((__sk)->sk_lock.slock)); \
90struct sock; 90struct sock;
91 91
92/** 92/**
93 * struct sock_common - minimal network layer representation of sockets 93 * struct sock_common - minimal network layer representation of sockets
94 * @skc_family - network address family 94 * @skc_family: network address family
95 * @skc_state - Connection state 95 * @skc_state: Connection state
96 * @skc_reuse - %SO_REUSEADDR setting 96 * @skc_reuse: %SO_REUSEADDR setting
97 * @skc_bound_dev_if - bound device index if != 0 97 * @skc_bound_dev_if: bound device index if != 0
98 * @skc_node - main hash linkage for various protocol lookup tables 98 * @skc_node: main hash linkage for various protocol lookup tables
99 * @skc_bind_node - bind hash linkage for various protocol lookup tables 99 * @skc_bind_node: bind hash linkage for various protocol lookup tables
100 * @skc_refcnt - reference count 100 * @skc_refcnt: reference count
101 * 101 *
102 * This is the minimal network layer representation of sockets, the header 102 * This is the minimal network layer representation of sockets, the header
103 * for struct sock and struct tcp_tw_bucket. 103 * for struct sock and struct tcp_tw_bucket.
104 */ 104 */
105struct sock_common { 105struct sock_common {
106 unsigned short skc_family; 106 unsigned short skc_family;
@@ -114,60 +114,61 @@ struct sock_common {
114 114
115/** 115/**
116 * struct sock - network layer representation of sockets 116 * struct sock - network layer representation of sockets
117 * @__sk_common - shared layout with tcp_tw_bucket 117 * @__sk_common: shared layout with tcp_tw_bucket
118 * @sk_shutdown - mask of %SEND_SHUTDOWN and/or %RCV_SHUTDOWN 118 * @sk_shutdown: mask of %SEND_SHUTDOWN and/or %RCV_SHUTDOWN
119 * @sk_userlocks - %SO_SNDBUF and %SO_RCVBUF settings 119 * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings
120 * @sk_lock - synchronizer 120 * @sk_lock: synchronizer
121 * @sk_rcvbuf - size of receive buffer in bytes 121 * @sk_rcvbuf: size of receive buffer in bytes
122 * @sk_sleep - sock wait queue 122 * @sk_sleep: sock wait queue
123 * @sk_dst_cache - destination cache 123 * @sk_dst_cache: destination cache
124 * @sk_dst_lock - destination cache lock 124 * @sk_dst_lock: destination cache lock
125 * @sk_policy - flow policy 125 * @sk_policy: flow policy
126 * @sk_rmem_alloc - receive queue bytes committed 126 * @sk_rmem_alloc: receive queue bytes committed
127 * @sk_receive_queue - incoming packets 127 * @sk_receive_queue: incoming packets
128 * @sk_wmem_alloc - transmit queue bytes committed 128 * @sk_wmem_alloc: transmit queue bytes committed
129 * @sk_write_queue - Packet sending queue 129 * @sk_write_queue: Packet sending queue
130 * @sk_omem_alloc - "o" is "option" or "other" 130 * @sk_omem_alloc: "o" is "option" or "other"
131 * @sk_wmem_queued - persistent queue size 131 * @sk_wmem_queued: persistent queue size
132 * @sk_forward_alloc - space allocated forward 132 * @sk_forward_alloc: space allocated forward
133 * @sk_allocation - allocation mode 133 * @sk_allocation: allocation mode
134 * @sk_sndbuf - size of send buffer in bytes 134 * @sk_sndbuf: size of send buffer in bytes
135 * @sk_flags - %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings 135 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, %SO_OOBINLINE settings
136 * @sk_no_check - %SO_NO_CHECK setting, wether or not checkup packets 136 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets
137 * @sk_route_caps - route capabilities (e.g. %NETIF_F_TSO) 137 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
138 * @sk_lingertime - %SO_LINGER l_linger setting 138 * @sk_lingertime: %SO_LINGER l_linger setting
139 * @sk_hashent - hash entry in several tables (e.g. tcp_ehash) 139 * @sk_hashent: hash entry in several tables (e.g. tcp_ehash)
140 * @sk_backlog - always used with the per-socket spinlock held 140 * @sk_backlog: always used with the per-socket spinlock held
141 * @sk_callback_lock - used with the callbacks in the end of this struct 141 * @sk_callback_lock: used with the callbacks in the end of this struct
142 * @sk_error_queue - rarely used 142 * @sk_error_queue: rarely used
143 * @sk_prot - protocol handlers inside a network family 143 * @sk_prot: protocol handlers inside a network family
144 * @sk_err - last error 144 * @sk_err: last error
145 * @sk_err_soft - errors that don't cause failure but are the cause of a persistent failure not just 'timed out' 145 * @sk_err_soft: errors that don't cause failure but are the cause of a persistent failure not just 'timed out'
146 * @sk_ack_backlog - current listen backlog 146 * @sk_ack_backlog: current listen backlog
147 * @sk_max_ack_backlog - listen backlog set in listen() 147 * @sk_max_ack_backlog: listen backlog set in listen()
148 * @sk_priority - %SO_PRIORITY setting 148 * @sk_priority: %SO_PRIORITY setting
149 * @sk_type - socket type (%SOCK_STREAM, etc) 149 * @sk_type: socket type (%SOCK_STREAM, etc)
150 * @sk_protocol - which protocol this socket belongs in this network family 150 * @sk_protocol: which protocol this socket belongs in this network family
151 * @sk_peercred - %SO_PEERCRED setting 151 * @sk_peercred: %SO_PEERCRED setting
152 * @sk_rcvlowat - %SO_RCVLOWAT setting 152 * @sk_rcvlowat: %SO_RCVLOWAT setting
153 * @sk_rcvtimeo - %SO_RCVTIMEO setting 153 * @sk_rcvtimeo: %SO_RCVTIMEO setting
154 * @sk_sndtimeo - %SO_SNDTIMEO setting 154 * @sk_sndtimeo: %SO_SNDTIMEO setting
155 * @sk_filter - socket filtering instructions 155 * @sk_filter: socket filtering instructions
156 * @sk_protinfo - private area, net family specific, when not using slab 156 * @sk_protinfo: private area, net family specific, when not using slab
157 * @sk_timer - sock cleanup timer 157 * @sk_timer: sock cleanup timer
158 * @sk_stamp - time stamp of last packet received 158 * @sk_stamp: time stamp of last packet received
159 * @sk_socket - Identd and reporting IO signals 159 * @sk_socket: Identd and reporting IO signals
160 * @sk_user_data - RPC layer private data 160 * @sk_user_data: RPC layer private data
161 * @sk_sndmsg_page - cached page for sendmsg 161 * @sk_sndmsg_page: cached page for sendmsg
162 * @sk_sndmsg_off - cached offset for sendmsg 162 * @sk_sndmsg_off: cached offset for sendmsg
163 * @sk_send_head - front of stuff to transmit 163 * @sk_send_head: front of stuff to transmit
164 * @sk_write_pending - a write to stream socket waits to start 164 * @sk_security: used by security modules
165 * @sk_state_change - callback to indicate change in the state of the sock 165 * @sk_write_pending: a write to stream socket waits to start
166 * @sk_data_ready - callback to indicate there is data to be processed 166 * @sk_state_change: callback to indicate change in the state of the sock
167 * @sk_write_space - callback to indicate there is bf sending space available 167 * @sk_data_ready: callback to indicate there is data to be processed
168 * @sk_error_report - callback to indicate errors (e.g. %MSG_ERRQUEUE) 168 * @sk_write_space: callback to indicate there is bf sending space available
169 * @sk_backlog_rcv - callback to process the backlog 169 * @sk_error_report: callback to indicate errors (e.g. %MSG_ERRQUEUE)
170 * @sk_destruct - called at sock freeing time, i.e. when all refcnt == 0 170 * @sk_backlog_rcv: callback to process the backlog
171 * @sk_destruct: called at sock freeing time, i.e. when all refcnt == 0
171 */ 172 */
172struct sock { 173struct sock {
173 /* 174 /*
@@ -1223,8 +1224,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
1223 1224
1224/** 1225/**
1225 * sk_eat_skb - Release a skb if it is no longer needed 1226 * sk_eat_skb - Release a skb if it is no longer needed
1226 * @sk - socket to eat this skb from 1227 * @sk: socket to eat this skb from
1227 * @skb - socket buffer to eat 1228 * @skb: socket buffer to eat
1228 * 1229 *
1229 * This routine must be called with interrupts disabled or with the socket 1230 * This routine must be called with interrupts disabled or with the socket
1230 * locked so that the sk_buff queue operation is ok. 1231 * locked so that the sk_buff queue operation is ok.
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 73e9a8ca3d3b..e142a256d5dc 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1,6 +1,7 @@
1#ifndef _NET_XFRM_H 1#ifndef _NET_XFRM_H
2#define _NET_XFRM_H 2#define _NET_XFRM_H
3 3
4#include <linux/compiler.h>
4#include <linux/xfrm.h> 5#include <linux/xfrm.h>
5#include <linux/spinlock.h> 6#include <linux/spinlock.h>
6#include <linux/list.h> 7#include <linux/list.h>
@@ -516,6 +517,15 @@ struct xfrm_dst
516 u32 child_mtu_cached; 517 u32 child_mtu_cached;
517}; 518};
518 519
520static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
521{
522 dst_release(xdst->route);
523 if (likely(xdst->u.dst.xfrm))
524 xfrm_state_put(xdst->u.dst.xfrm);
525}
526
527extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
528
519/* Decapsulation state, used by the input to store data during 529/* Decapsulation state, used by the input to store data during
520 * decapsulation procedure, to be used later (during the policy 530 * decapsulation procedure, to be used later (during the policy
521 * check 531 * check