This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / include / net / tcp.h
index b7591b7..bb4a8fe 100644 (file)
@@ -159,6 +159,7 @@ extern struct tcp_bind_bucket *tcp_bucket_create(struct tcp_bind_hashbucket *hea
 extern void tcp_bucket_destroy(struct tcp_bind_bucket *tb);
 extern void tcp_bucket_unlock(struct sock *sk);
 extern int tcp_port_rover;
+extern struct sock *tcp_v4_lookup_listener(u32 addr, unsigned short hnum, int dif);
 
 /* These are AF independent. */
 static __inline__ int tcp_bhashfn(__u16 lport)
@@ -365,8 +366,8 @@ extern void tcp_tw_deschedule(struct tcp_tw_bucket *tw);
 #define TCP_IPV6_MATCH(__sk, __saddr, __daddr, __ports, __dif)    \
        (((*((__u32 *)&(inet_sk(__sk)->dport)))== (__ports))    && \
         ((__sk)->sk_family             == AF_INET6)            && \
-        ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr))     && \
-        ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
+        !ipv6_addr_cmp(&inet6_sk(__sk)->daddr, (__saddr))      && \
+        !ipv6_addr_cmp(&inet6_sk(__sk)->rcv_saddr, (__daddr))  && \
         (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif))))
 
 /* These can have wildcards, don't try too hard. */
@@ -785,8 +786,6 @@ extern void                 tcp_shutdown (struct sock *sk, int how);
 
 extern int                     tcp_v4_rcv(struct sk_buff *skb);
 
-extern struct sock *           tcp_v4_lookup_listener(u32 daddr, unsigned short hnum, int dif);
-
 extern int                     tcp_v4_remember_stamp(struct sock *sk);
 
 extern int                     tcp_v4_tw_remember_stamp(struct tcp_tw_bucket *tw);
@@ -971,14 +970,12 @@ extern void cleanup_rbuf(struct sock *sk, int copied);
 extern void tcp_init_xmit_timers(struct sock *);
 extern void tcp_clear_xmit_timers(struct sock *);
 
-extern void tcp_delete_keepalive_timer(struct sock *);
-extern void tcp_reset_keepalive_timer(struct sock *, unsigned long);
+extern void tcp_delete_keepalive_timer (struct sock *);
+extern void tcp_reset_keepalive_timer (struct sock *, unsigned long);
 extern unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu);
 extern unsigned int tcp_current_mss(struct sock *sk, int large);
 
-#ifdef TCP_DEBUG
-extern const char tcp_timer_bug_msg[];
-#endif
+extern const char timer_bug_msg[];
 
 /* tcp_diag.c */
 extern void tcp_get_info(struct sock *, struct tcp_info *);
@@ -1011,9 +1008,7 @@ static inline void tcp_clear_xmit_timer(struct sock *sk, int what)
 #endif
                break;
        default:
-#ifdef TCP_DEBUG
-               printk(tcp_timer_bug_msg);
-#endif
+               printk(timer_bug_msg);
                return;
        };
 
@@ -1048,9 +1043,7 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
                break;
 
        default:
-#ifdef TCP_DEBUG
-               printk(tcp_timer_bug_msg);
-#endif
+               printk(timer_bug_msg);
        };
 }
 
@@ -1099,7 +1092,7 @@ static inline void tcp_fast_path_check(struct sock *sk, struct tcp_opt *tp)
  * Rcv_nxt can be after the window if our peer push more data
  * than the offered window.
  */
-static __inline__ u32 tcp_receive_window(const struct tcp_opt *tp)
+static __inline__ u32 tcp_receive_window(struct tcp_opt *tp)
 {
        s32 win = tp->rcv_wup + tp->rcv_wnd - tp->rcv_nxt;
 
@@ -1177,19 +1170,18 @@ struct tcp_skb_cb {
 /* Due to TSO, an SKB can be composed of multiple actual
  * packets.  To keep these tracked properly, we use this.
  */
-static inline int tcp_skb_pcount(const struct sk_buff *skb)
+static inline int tcp_skb_pcount(struct sk_buff *skb)
 {
        return skb_shinfo(skb)->tso_segs;
 }
 
 /* This is valid iff tcp_skb_pcount() > 1. */
-static inline int tcp_skb_mss(const struct sk_buff *skb)
+static inline int tcp_skb_mss(struct sk_buff *skb)
 {
        return skb_shinfo(skb)->tso_size;
 }
 
-static inline void tcp_inc_pcount(tcp_pcount_t *count,
-                                 const struct sk_buff *skb)
+static inline void tcp_inc_pcount(tcp_pcount_t *count, struct sk_buff *skb)
 {
        count->val += tcp_skb_pcount(skb);
 }
@@ -1204,14 +1196,13 @@ static inline void tcp_dec_pcount_explicit(tcp_pcount_t *count, int amt)
        count->val -= amt;
 }
 
-static inline void tcp_dec_pcount(tcp_pcount_t *count, 
-                                 const struct sk_buff *skb)
+static inline void tcp_dec_pcount(tcp_pcount_t *count, struct sk_buff *skb)
 {
        count->val -= tcp_skb_pcount(skb);
 }
 
 static inline void tcp_dec_pcount_approx(tcp_pcount_t *count,
-                                        const struct sk_buff *skb)
+                                        struct sk_buff *skb)
 {
        if (count->val) {
                count->val -= tcp_skb_pcount(skb);
@@ -1220,7 +1211,7 @@ static inline void tcp_dec_pcount_approx(tcp_pcount_t *count,
        }
 }
 
-static inline __u32 tcp_get_pcount(const tcp_pcount_t *count)
+static inline __u32 tcp_get_pcount(tcp_pcount_t *count)
 {
        return count->val;
 }
@@ -1230,9 +1221,8 @@ static inline void tcp_set_pcount(tcp_pcount_t *count, __u32 val)
        count->val = val;
 }
 
-static inline void tcp_packets_out_inc(struct sock *sk, 
-                                      struct tcp_opt *tp,
-                                      const struct sk_buff *skb)
+static inline void tcp_packets_out_inc(struct sock *sk, struct tcp_opt *tp,
+                                      struct sk_buff *skb)
 {
        int orig = tcp_get_pcount(&tp->packets_out);
 
@@ -1241,8 +1231,7 @@ static inline void tcp_packets_out_inc(struct sock *sk,
                tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
 }
 
-static inline void tcp_packets_out_dec(struct tcp_opt *tp, 
-                                      const struct sk_buff *skb)
+static inline void tcp_packets_out_dec(struct tcp_opt *tp, struct sk_buff *skb)
 {
        tcp_dec_pcount(&tp->packets_out, skb);
 }
@@ -1261,7 +1250,7 @@ static inline void tcp_packets_out_dec(struct tcp_opt *tp,
  *     "Packets left network, but not honestly ACKed yet" PLUS
  *     "Packets fast retransmitted"
  */
-static __inline__ unsigned int tcp_packets_in_flight(const struct tcp_opt *tp)
+static __inline__ unsigned int tcp_packets_in_flight(struct tcp_opt *tp)
 {
        return (tcp_get_pcount(&tp->packets_out) -
                tcp_get_pcount(&tp->left_out) +
@@ -1428,19 +1417,18 @@ extern __u32 tcp_init_cwnd(struct tcp_opt *tp, struct dst_entry *dst);
 /* Slow start with delack produces 3 packets of burst, so that
  * it is safe "de facto".
  */
-static __inline__ __u32 tcp_max_burst(const struct tcp_opt *tp)
+static __inline__ __u32 tcp_max_burst(struct tcp_opt *tp)
 {
        return 3;
 }
 
-static __inline__ int tcp_minshall_check(const struct tcp_opt *tp)
+static __inline__ int tcp_minshall_check(struct tcp_opt *tp)
 {
        return after(tp->snd_sml,tp->snd_una) &&
                !after(tp->snd_sml, tp->snd_nxt);
 }
 
-static __inline__ void tcp_minshall_update(struct tcp_opt *tp, int mss, 
-                                          const struct sk_buff *skb)
+static __inline__ void tcp_minshall_update(struct tcp_opt *tp, int mss, struct sk_buff *skb)
 {
        if (skb->len < mss)
                tp->snd_sml = TCP_SKB_CB(skb)->end_seq;
@@ -1456,8 +1444,7 @@ static __inline__ void tcp_minshall_update(struct tcp_opt *tp, int mss,
  */
 
 static __inline__ int
-tcp_nagle_check(const struct tcp_opt *tp, const struct sk_buff *skb, 
-               unsigned mss_now, int nonagle)
+tcp_nagle_check(struct tcp_opt *tp, struct sk_buff *skb, unsigned mss_now, int nonagle)
 {
        return (skb->len < mss_now &&
                !(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) &&
@@ -1472,8 +1459,7 @@ extern void tcp_set_skb_tso_segs(struct sk_buff *, unsigned int);
 /* This checks if the data bearing packet SKB (usually sk->sk_send_head)
  * should be put on the wire right now.
  */
-static __inline__ int tcp_snd_test(const struct tcp_opt *tp, 
-                                  struct sk_buff *skb,
+static __inline__ int tcp_snd_test(struct tcp_opt *tp, struct sk_buff *skb,
                                   unsigned cur_mss, int nonagle)
 {
        int pkts = tcp_skb_pcount(skb);
@@ -1520,8 +1506,7 @@ static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_opt *tp
                tcp_reset_xmit_timer(sk, TCP_TIME_PROBE0, tp->rto);
 }
 
-static __inline__ int tcp_skb_is_last(const struct sock *sk, 
-                                     const struct sk_buff *skb)
+static __inline__ int tcp_skb_is_last(struct sock *sk, struct sk_buff *skb)
 {
        return skb->next == (struct sk_buff *)&sk->sk_write_queue;
 }
@@ -1572,7 +1557,7 @@ static __inline__ void tcp_update_wl(struct tcp_opt *tp, u32 ack, u32 seq)
        tp->snd_wl1 = seq;
 }
 
-extern void tcp_destroy_sock(struct sock *sk);
+extern void                    tcp_destroy_sock(struct sock *sk);
 
 
 /*
@@ -1646,7 +1631,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
 #undef STATE_TRACE
 
 #ifdef STATE_TRACE
-static const char *statename[]={
+static char *statename[]={
        "Unused","Established","Syn Sent","Syn Recv",
        "Fin Wait 1","Fin Wait 2","Time Wait", "Close",
        "Close Wait","Last ACK","Listen","Closing"
@@ -2021,17 +2006,17 @@ static inline void tcp_listen_unlock(void)
                wake_up(&tcp_lhash_wait);
 }
 
-static inline int keepalive_intvl_when(const struct tcp_opt *tp)
+static inline int keepalive_intvl_when(struct tcp_opt *tp)
 {
        return tp->keepalive_intvl ? : sysctl_tcp_keepalive_intvl;
 }
 
-static inline int keepalive_time_when(const struct tcp_opt *tp)
+static inline int keepalive_time_when(struct tcp_opt *tp)
 {
        return tp->keepalive_time ? : sysctl_tcp_keepalive_time;
 }
 
-static inline int tcp_fin_time(const struct tcp_opt *tp)
+static inline int tcp_fin_time(struct tcp_opt *tp)
 {
        int fin_timeout = tp->linger2 ? : sysctl_tcp_fin_timeout;
 
@@ -2041,7 +2026,7 @@ static inline int tcp_fin_time(const struct tcp_opt *tp)
        return fin_timeout;
 }
 
-static inline int tcp_paws_check(const struct tcp_opt *tp, int rst)
+static inline int tcp_paws_check(struct tcp_opt *tp, int rst)
 {
        if ((s32)(tp->rcv_tsval - tp->ts_recent) >= 0)
                return 0;