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)
#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. */
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);
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 *);
#endif
break;
default:
-#ifdef TCP_DEBUG
- printk(tcp_timer_bug_msg);
-#endif
+ printk(timer_bug_msg);
return;
};
break;
default:
-#ifdef TCP_DEBUG
- printk(tcp_timer_bug_msg);
-#endif
+ printk(timer_bug_msg);
};
}
* 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;
/* 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);
}
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);
}
}
-static inline __u32 tcp_get_pcount(const tcp_pcount_t *count)
+static inline __u32 tcp_get_pcount(tcp_pcount_t *count)
{
return count->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);
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);
}
* "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) +
/* 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;
*/
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) &&
/* 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);
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;
}
tp->snd_wl1 = seq;
}
-extern void tcp_destroy_sock(struct sock *sk);
+extern void tcp_destroy_sock(struct sock *sk);
/*
#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"
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;
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;