diff options
Diffstat (limited to 'net/tipc/socket.h')
-rw-r--r-- | net/tipc/socket.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/tipc/socket.h b/net/tipc/socket.h index 3afcd2a70b31..43b75b3ceced 100644 --- a/net/tipc/socket.h +++ b/net/tipc/socket.h | |||
@@ -38,6 +38,9 @@ | |||
38 | #include "port.h" | 38 | #include "port.h" |
39 | #include <net/sock.h> | 39 | #include <net/sock.h> |
40 | 40 | ||
41 | #define TIPC_CONN_OK 0 | ||
42 | #define TIPC_CONN_PROBING 1 | ||
43 | |||
41 | /** | 44 | /** |
42 | * struct tipc_sock - TIPC socket structure | 45 | * struct tipc_sock - TIPC socket structure |
43 | * @sk: socket - interacts with 'port' and with user via the socket API | 46 | * @sk: socket - interacts with 'port' and with user via the socket API |
@@ -45,6 +48,9 @@ | |||
45 | * @peer_name: the peer of the connection, if any | 48 | * @peer_name: the peer of the connection, if any |
46 | * @conn_timeout: the time we can wait for an unresponded setup request | 49 | * @conn_timeout: the time we can wait for an unresponded setup request |
47 | * @dupl_rcvcnt: number of bytes counted twice, in both backlog and rcv queue | 50 | * @dupl_rcvcnt: number of bytes counted twice, in both backlog and rcv queue |
51 | * @link_cong: non-zero if owner must sleep because of link congestion | ||
52 | * @sent_unacked: # messages sent by socket, and not yet acked by peer | ||
53 | * @rcv_unacked: # messages read by user, but not yet acked back to peer | ||
48 | */ | 54 | */ |
49 | 55 | ||
50 | struct tipc_sock { | 56 | struct tipc_sock { |
@@ -52,6 +58,9 @@ struct tipc_sock { | |||
52 | struct tipc_port port; | 58 | struct tipc_port port; |
53 | unsigned int conn_timeout; | 59 | unsigned int conn_timeout; |
54 | atomic_t dupl_rcvcnt; | 60 | atomic_t dupl_rcvcnt; |
61 | int link_cong; | ||
62 | uint sent_unacked; | ||
63 | uint rcv_unacked; | ||
55 | }; | 64 | }; |
56 | 65 | ||
57 | static inline struct tipc_sock *tipc_sk(const struct sock *sk) | 66 | static inline struct tipc_sock *tipc_sk(const struct sock *sk) |
@@ -69,6 +78,13 @@ static inline void tipc_sock_wakeup(struct tipc_sock *tsk) | |||
69 | tsk->sk.sk_write_space(&tsk->sk); | 78 | tsk->sk.sk_write_space(&tsk->sk); |
70 | } | 79 | } |
71 | 80 | ||
81 | static inline int tipc_sk_conn_cong(struct tipc_sock *tsk) | ||
82 | { | ||
83 | return tsk->sent_unacked >= TIPC_FLOWCTRL_WIN; | ||
84 | } | ||
85 | |||
72 | int tipc_sk_rcv(struct sk_buff *buf); | 86 | int tipc_sk_rcv(struct sk_buff *buf); |
73 | 87 | ||
88 | void tipc_sk_mcast_rcv(struct sk_buff *buf); | ||
89 | |||
74 | #endif | 90 | #endif |