0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef _TIPC_BCAST_H
0038 #define _TIPC_BCAST_H
0039
0040 #include "core.h"
0041
0042 struct tipc_node;
0043 struct tipc_msg;
0044 struct tipc_nl_msg;
0045 struct tipc_nlist;
0046 struct tipc_nitem;
0047 extern const char tipc_bclink_name[];
0048 extern unsigned long sysctl_tipc_bc_retruni;
0049
0050 #define TIPC_METHOD_EXPIRE msecs_to_jiffies(5000)
0051
0052 #define BCLINK_MODE_BCAST 0x1
0053 #define BCLINK_MODE_RCAST 0x2
0054 #define BCLINK_MODE_SEL 0x4
0055
0056 struct tipc_nlist {
0057 struct list_head list;
0058 u32 self;
0059 u16 remote;
0060 bool local;
0061 };
0062
0063 void tipc_nlist_init(struct tipc_nlist *nl, u32 self);
0064 void tipc_nlist_purge(struct tipc_nlist *nl);
0065 void tipc_nlist_add(struct tipc_nlist *nl, u32 node);
0066 void tipc_nlist_del(struct tipc_nlist *nl, u32 node);
0067
0068
0069
0070
0071
0072
0073
0074 struct tipc_mc_method {
0075 bool rcast;
0076 bool mandatory;
0077 struct sk_buff_head deferredq;
0078 unsigned long expires;
0079 };
0080
0081 int tipc_bcast_init(struct net *net);
0082 void tipc_bcast_stop(struct net *net);
0083 void tipc_bcast_add_peer(struct net *net, struct tipc_link *l,
0084 struct sk_buff_head *xmitq);
0085 void tipc_bcast_remove_peer(struct net *net, struct tipc_link *rcv_bcl);
0086 void tipc_bcast_inc_bearer_dst_cnt(struct net *net, int bearer_id);
0087 void tipc_bcast_dec_bearer_dst_cnt(struct net *net, int bearer_id);
0088 int tipc_bcast_get_mtu(struct net *net);
0089 void tipc_bcast_toggle_rcast(struct net *net, bool supp);
0090 int tipc_mcast_xmit(struct net *net, struct sk_buff_head *pkts,
0091 struct tipc_mc_method *method, struct tipc_nlist *dests,
0092 u16 *cong_link_cnt);
0093 int tipc_bcast_xmit(struct net *net, struct sk_buff_head *pkts,
0094 u16 *cong_link_cnt);
0095 int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb);
0096 void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l,
0097 struct tipc_msg *hdr);
0098 int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l,
0099 struct tipc_msg *hdr,
0100 struct sk_buff_head *retrq);
0101 int tipc_nl_add_bc_link(struct net *net, struct tipc_nl_msg *msg,
0102 struct tipc_link *bcl);
0103 int tipc_nl_bc_link_set(struct net *net, struct nlattr *attrs[]);
0104 int tipc_bclink_reset_stats(struct net *net, struct tipc_link *l);
0105
0106 u32 tipc_bcast_get_mode(struct net *net);
0107 u32 tipc_bcast_get_broadcast_ratio(struct net *net);
0108
0109 void tipc_mcast_filter_msg(struct net *net, struct sk_buff_head *defq,
0110 struct sk_buff_head *inputq);
0111
0112 static inline void tipc_bcast_lock(struct net *net)
0113 {
0114 spin_lock_bh(&tipc_net(net)->bclock);
0115 }
0116
0117 static inline void tipc_bcast_unlock(struct net *net)
0118 {
0119 spin_unlock_bh(&tipc_net(net)->bclock);
0120 }
0121
0122 static inline struct tipc_link *tipc_bc_sndlink(struct net *net)
0123 {
0124 return tipc_net(net)->bcl;
0125 }
0126
0127 #endif