patch-2.4.0-test7 linux/include/net/sock.h

Next file: linux/include/net/tcp.h
Previous file: linux/include/net/snmp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test6/linux/include/net/sock.h linux/include/net/sock.h
@@ -268,10 +268,10 @@
 		__u8	pingpong;	/* The session is interactive		*/
 		__u8	blocked;	/* Delayed ACK was blocked by socket lock*/
 		__u32	ato;		/* Predicted tick of soft clock		*/
+		unsigned long timeout;	/* Currently scheduled timeout		*/
 		__u32	lrcvtime;	/* timestamp of last received data packet*/
-		__u16	last_seg_size;	/* Size of last incoming segment */
-		__u16	rcv_mss;	/* MSS used for delayed ACK decisions */ 
-		__u32	rcv_segs;	/* Number of received segments since last ack */
+		__u16	last_seg_size;	/* Size of last incoming segment	*/
+		__u16	rcv_mss;	/* MSS used for delayed ACK decisions	*/ 
 	} ack;
 
 	/* Data for direct copy to user */
@@ -284,19 +284,18 @@
 	} ucopy;
 
 	__u32	snd_wl1;	/* Sequence for window update		*/
-	__u32	snd_wl2;	/* Ack sequence for update		*/
 	__u32	snd_wnd;	/* The window we expect to receive	*/
 	__u32	max_window;	/* Maximal window ever seen from peer	*/
 	__u32	pmtu_cookie;	/* Last pmtu seen by socket		*/
 	__u16	mss_cache;	/* Cached effective mss, not including SACKS */
 	__u16	mss_clamp;	/* Maximal mss, negotiated at connection setup */
 	__u16	ext_header_len;	/* Network protocol overhead (IP/IPv6 options) */
-	__u8	dup_acks;	/* Consecutive duplicate acks seen from other end */
-	__u8	retransmits;
+	__u8	ca_state;	/* State of fast-retransmit machine 	*/
+	__u8	retransmits;	/* Number of unrecovered RTO timeouts.	*/
 
-	__u8	__empty1;
-	__u8	sorry;
-	__u8	defer_accept;
+	__u8	reordering;	/* Packet reordering metric.		*/
+	__u8	queue_shrunk;	/* Write queue has been shrunk recently.*/
+	__u8	defer_accept;	/* User waits for some data after accept() */
 
 /* RTT measurement */
 	__u8	backoff;	/* backoff				*/
@@ -305,9 +304,9 @@
 	__u32	rto;		/* retransmit timeout			*/
 
 	__u32	packets_out;	/* Packets which are "in flight"	*/
-	__u32	fackets_out;	/* Non-retrans SACK'd packets		*/
-	__u32	retrans_out;	/* Fast-retransmitted packets out	*/
-	__u32	high_seq;	/* snd_nxt at onset of congestion	*/
+	__u32	left_out;	/* Packets which leaved network		*/
+	__u32	retrans_out;	/* Retransmitted packets out		*/
+
 
 /*
  *	Slow start and congestion control (see also Nagle, and Karn & Partridge)
@@ -316,12 +315,11 @@
  	__u32	snd_cwnd;	/* Sending congestion window		*/
  	__u16	snd_cwnd_cnt;	/* Linear increase counter		*/
 	__u16	snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
-
-	__u8	nonagle;	/* Disable Nagle algorithm?             */
-	__u8	syn_retries;	/* num of allowed syn retries */
-	__u16	user_mss;  	/* mss requested by user in ioctl */
+	__u32	snd_cwnd_used;
+	__u32	snd_cwnd_stamp;
 
 	/* Two commonly used timers in both sender and receiver paths. */
+	unsigned long		timeout;
  	struct timer_list	retransmit_timer;	/* Resend (no ack)	*/
  	struct timer_list	delack_timer;		/* Ack delay 		*/
 
@@ -329,16 +327,12 @@
 
 	struct tcp_func		*af_specific;	/* Operations which are AF_INET{4,6} specific	*/
 	struct sk_buff		*send_head;	/* Front of stuff to transmit			*/
-	struct sk_buff		*retrans_head;	/* retrans head can be 
-						 * different to the head of
-						 * write queue if we are doing
-						 * fast retransmit
-						 */
 
  	__u32	rcv_wnd;	/* Current receiver window		*/
 	__u32	rcv_wup;	/* rcv_nxt on last window update sent	*/
-	__u32	write_seq;
-	__u32	copied_seq;
+	__u32	write_seq;	/* Tail(+1) of data held in tcp send buffer */
+	__u32	pushed_seq;	/* Last pushed seq, required to talk to windows */
+	__u32	copied_seq;	/* Head of yet unread data		*/
 /*
  *      Options received (usually on last packet, some only on SYN packets).
  */
@@ -348,7 +342,7 @@
 	char	saw_tstamp;	/* Saw TIMESTAMP on last packet		*/
         __u8	snd_wscale;	/* Window scaling received from sender	*/
         __u8	rcv_wscale;	/* Window scaling to send to receiver	*/
-	__u8	rexmt_done;	/* Retransmitted up to send head?	*/
+	__u8	nonagle;	/* Disable Nagle algorithm?             */
 	__u8	keepalive_probes; /* num of allowed keep alive probes	*/
 
 /*	PAWS/RTTM data	*/
@@ -358,19 +352,37 @@
         long	ts_recent_stamp;/* Time we stored ts_recent (for aging) */
 
 /*	SACKs data	*/
+	__u16	user_mss;  	/* mss requested by user in ioctl */
+	__u8	dsack;		/* D-SACK is scheduled			*/
+	__u8	eff_sacks;	/* Size of SACK array to send with next packet */
+	struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
 	struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
 
- 	struct timer_list	probe_timer;		/* Probes	*/
 	__u32	window_clamp;	/* Maximal window to advertise		*/
+	__u32	rcv_ssthresh;	/* Current window clamp			*/
 	__u8	probes_out;	/* unanswered 0 window probes		*/
 	__u8	num_sacks;	/* Number of SACK blocks		*/
 	__u16	advmss;		/* Advertised MSS			*/
 
-	__u32	syn_stamp;
-	__u32	syn_seq;
-	__u32	fin_seq;
-	__u32	urg_seq;
-	__u32	urg_data;
+	__u8	syn_retries;	/* num of allowed syn retries */
+	__u8	ecn_flags;	/* ECN status bits.			*/
+	__u16	prior_ssthresh; /* ssthresh saved at recovery start	*/
+	__u32	lost_out;	/* Lost packets				*/
+	__u32	sacked_out;	/* SACK'd packets			*/
+	__u32	fackets_out;	/* FACK'd packets			*/
+	__u32	high_seq;	/* snd_nxt at onset of congestion	*/
+
+	__u32	retrans_stamp;	/* Timestamp of the last retransmit,
+				 * also used in SYN-SENT to remember stamp of
+				 * the first SYN. */
+	__u32	undo_marker;	/* tracking retrans started here. */
+	int	undo_retrans;	/* number of undoable retransmissions. */
+	__u32	syn_seq;	/* Seq of received SYN. */
+	__u32	fin_seq;	/* Seq of received FIN. */
+	__u32	urg_seq;	/* Seq of received urgent pointer */
+	__u16	urg_data;	/* Saved octet of OOB data and control flags */
+	__u8	pending;	/* Scheduled timer event	*/
+	__u8	__empty;
 
 	/* The syn_wait_lock is necessary only to avoid tcp_get_info having
 	 * to grab the main lock sock while browsing the listening hash
@@ -482,8 +494,8 @@
 	__u16			sport;		/* Source port				*/
 
 	unsigned short		family;		/* Address family			*/
-	unsigned char		reuse,		/* SO_REUSEADDR setting			*/
-				__unused;
+	unsigned char		reuse;		/* SO_REUSEADDR setting			*/
+	unsigned char		shutdown;
 	atomic_t		refcnt;		/* Reference count			*/
 
 	socket_lock_t		lock;		/* Synchronizer...			*/
@@ -497,6 +509,8 @@
 	atomic_t		wmem_alloc;	/* Transmit queue bytes committed	*/
 	struct sk_buff_head	write_queue;	/* Packet sending queue			*/
 	atomic_t		omem_alloc;	/* "o" is "option" or "other" */
+	int			wmem_queued;	/* Persistent queue size */
+	int			forward_alloc;	/* Space allocated forward. */
 	__u32			saddr;		/* Sending source			*/
 	unsigned int		allocation;	/* Allocation mode			*/
 	int			sndbuf;		/* Size of send buffer in bytes		*/
@@ -539,8 +553,6 @@
 
 	struct proto		*prot;
 
-	unsigned short		shutdown;
-
 #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
 	union {
 		struct ipv6_pinfo	af_inet6;
@@ -734,6 +746,11 @@
 #define RCV_SHUTDOWN	1
 #define SEND_SHUTDOWN	2
 
+#define SOCK_SNDBUF_LOCK	1
+#define SOCK_RCVBUF_LOCK	2
+#define SOCK_BINDADDR_LOCK	4
+
+
 /* Used by processes to "lock" a socket state, so that
  * interrupts and bottom half handlers won't change it
  * from under us. It essentially blocks any incoming
@@ -801,8 +818,6 @@
 					      int priority);
 extern void			sock_wfree(struct sk_buff *skb);
 extern void			sock_rfree(struct sk_buff *skb);
-extern void			sock_cfree(struct sk_buff *skb);
-extern unsigned long		sock_rspace(struct sock *sk);
 extern unsigned long		sock_wspace(struct sock *sk);
 
 extern int			sock_setsockopt(struct socket *sock, int level,
@@ -982,8 +997,6 @@
  * we do not release it in this function, because protocol
  * probably wants some additional cleanups or even continuing
  * to work with this socket (TCP).
- *
- * NOTE: When softnet goes in replace _irq with _bh!
  */
 extern __inline__ void sock_orphan(struct sock *sk)
 {
@@ -1003,6 +1016,25 @@
 	write_unlock_bh(&sk->callback_lock);
 }
 
+static inline int sock_i_uid(struct sock *sk)
+{
+	int uid;
+
+	read_lock(&sk->callback_lock);
+	uid = sk->socket ? sk->socket->inode->i_uid : 0;
+	read_unlock(&sk->callback_lock);
+	return uid;
+}
+
+static inline unsigned long sock_i_ino(struct sock *sk)
+{
+	unsigned long ino;
+
+	read_lock(&sk->callback_lock);
+	ino = sk->socket ? sk->socket->inode->i_ino : 0;
+	read_unlock(&sk->callback_lock);
+	return ino;
+}
 
 extern __inline__ struct dst_entry *
 __sk_dst_get(struct sock *sk)
@@ -1110,14 +1142,6 @@
 	atomic_add(skb->truesize, &sk->rmem_alloc);
 }
 
-extern __inline__ void skb_set_owner_c(struct sk_buff *skb, struct sock *sk)
-{
-	sock_hold(sk);
-	skb->sk = sk;
-	skb->destructor = sock_cfree;
-}
-
-
 extern __inline__ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
 {
 	/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
@@ -1194,7 +1218,7 @@
 }
 
 #define SOCK_MIN_SNDBUF 2048
-#define SOCK_MIN_RCVBUF 128
+#define SOCK_MIN_RCVBUF 256
 /* Must be less or equal SOCK_MIN_SNDBUF */
 #define SOCK_MIN_WRITE_SPACE	SOCK_MIN_SNDBUF
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)