1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37#ifndef _TIPC_LINK_H
38#define _TIPC_LINK_H
39
40#include <net/genetlink.h>
41#include "msg.h"
42#include "node.h"
43
44
45
46#define ELINKCONG EAGAIN
47
48
49
50enum {
51 LINK_ESTABLISH_EVT = 0xec1ab1e,
52 LINK_PEER_RESET_EVT = 0x9eed0e,
53 LINK_FAILURE_EVT = 0xfa110e,
54 LINK_RESET_EVT = 0x10ca1d0e,
55 LINK_FAILOVER_BEGIN_EVT = 0xfa110bee,
56 LINK_FAILOVER_END_EVT = 0xfa110ede,
57 LINK_SYNCH_BEGIN_EVT = 0xc1ccbee,
58 LINK_SYNCH_END_EVT = 0xc1ccede
59};
60
61
62
63enum {
64 TIPC_LINK_UP_EVT = 1,
65 TIPC_LINK_DOWN_EVT = (1 << 1),
66 TIPC_LINK_SND_STATE = (1 << 2)
67};
68
69
70
71
72#define MAX_PKT_DEFAULT 1500
73
74bool tipc_link_create(struct net *net, char *if_name, int bearer_id,
75 int tolerance, char net_plane, u32 mtu, int priority,
76 u32 min_win, u32 max_win, u32 session, u32 ownnode,
77 u32 peer, u8 *peer_id, u16 peer_caps,
78 struct tipc_link *bc_sndlink,
79 struct tipc_link *bc_rcvlink,
80 struct sk_buff_head *inputq,
81 struct sk_buff_head *namedq,
82 struct tipc_link **link);
83bool tipc_link_bc_create(struct net *net, u32 ownnode, u32 peer, u8 *peer_id,
84 int mtu, u32 min_win, u32 max_win, u16 peer_caps,
85 struct sk_buff_head *inputq,
86 struct sk_buff_head *namedq,
87 struct tipc_link *bc_sndlink,
88 struct tipc_link **link);
89void tipc_link_tnl_prepare(struct tipc_link *l, struct tipc_link *tnl,
90 int mtyp, struct sk_buff_head *xmitq);
91void tipc_link_create_dummy_tnl_msg(struct tipc_link *tnl,
92 struct sk_buff_head *xmitq);
93void tipc_link_failover_prepare(struct tipc_link *l, struct tipc_link *tnl,
94 struct sk_buff_head *xmitq);
95void tipc_link_build_reset_msg(struct tipc_link *l, struct sk_buff_head *xmitq);
96int tipc_link_fsm_evt(struct tipc_link *l, int evt);
97bool tipc_link_is_up(struct tipc_link *l);
98bool tipc_link_peer_is_down(struct tipc_link *l);
99bool tipc_link_is_reset(struct tipc_link *l);
100bool tipc_link_is_establishing(struct tipc_link *l);
101bool tipc_link_is_synching(struct tipc_link *l);
102bool tipc_link_is_failingover(struct tipc_link *l);
103bool tipc_link_is_blocked(struct tipc_link *l);
104void tipc_link_set_active(struct tipc_link *l, bool active);
105void tipc_link_reset(struct tipc_link *l);
106void tipc_link_reset_stats(struct tipc_link *l);
107int tipc_link_xmit(struct tipc_link *link, struct sk_buff_head *list,
108 struct sk_buff_head *xmitq);
109struct sk_buff_head *tipc_link_inputq(struct tipc_link *l);
110u16 tipc_link_rcv_nxt(struct tipc_link *l);
111u16 tipc_link_acked(struct tipc_link *l);
112u32 tipc_link_id(struct tipc_link *l);
113char *tipc_link_name(struct tipc_link *l);
114u32 tipc_link_state(struct tipc_link *l);
115char tipc_link_plane(struct tipc_link *l);
116int tipc_link_prio(struct tipc_link *l);
117int tipc_link_min_win(struct tipc_link *l);
118int tipc_link_max_win(struct tipc_link *l);
119void tipc_link_update_caps(struct tipc_link *l, u16 capabilities);
120bool tipc_link_validate_msg(struct tipc_link *l, struct tipc_msg *hdr);
121unsigned long tipc_link_tolerance(struct tipc_link *l);
122void tipc_link_set_tolerance(struct tipc_link *l, u32 tol,
123 struct sk_buff_head *xmitq);
124void tipc_link_set_prio(struct tipc_link *l, u32 prio,
125 struct sk_buff_head *xmitq);
126void tipc_link_set_abort_limit(struct tipc_link *l, u32 limit);
127void tipc_link_set_queue_limits(struct tipc_link *l, u32 min_win, u32 max_win);
128int __tipc_nl_add_link(struct net *net, struct tipc_nl_msg *msg,
129 struct tipc_link *link, int nlflags);
130int tipc_nl_parse_link_prop(struct nlattr *prop, struct nlattr *props[]);
131int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq);
132int tipc_link_rcv(struct tipc_link *l, struct sk_buff *skb,
133 struct sk_buff_head *xmitq);
134int tipc_link_build_state_msg(struct tipc_link *l, struct sk_buff_head *xmitq);
135void tipc_link_add_bc_peer(struct tipc_link *snd_l,
136 struct tipc_link *uc_l,
137 struct sk_buff_head *xmitq);
138void tipc_link_remove_bc_peer(struct tipc_link *snd_l,
139 struct tipc_link *rcv_l,
140 struct sk_buff_head *xmitq);
141int tipc_link_bc_peers(struct tipc_link *l);
142void tipc_link_set_mtu(struct tipc_link *l, int mtu);
143int tipc_link_mtu(struct tipc_link *l);
144int tipc_link_mss(struct tipc_link *l);
145u16 tipc_get_gap_ack_blks(struct tipc_gap_ack_blks **ga, struct tipc_link *l,
146 struct tipc_msg *hdr, bool uc);
147int tipc_link_bc_ack_rcv(struct tipc_link *l, u16 acked, u16 gap,
148 struct tipc_gap_ack_blks *ga,
149 struct sk_buff_head *xmitq,
150 struct sk_buff_head *retrq);
151void tipc_link_build_bc_sync_msg(struct tipc_link *l,
152 struct sk_buff_head *xmitq);
153void tipc_link_bc_init_rcv(struct tipc_link *l, struct tipc_msg *hdr);
154int tipc_link_bc_sync_rcv(struct tipc_link *l, struct tipc_msg *hdr,
155 struct sk_buff_head *xmitq);
156int tipc_link_bc_nack_rcv(struct tipc_link *l, struct sk_buff *skb,
157 struct sk_buff_head *xmitq);
158bool tipc_link_too_silent(struct tipc_link *l);
159struct net *tipc_link_net(struct tipc_link *l);
160#endif
161