diff options
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r-- | net/tipc/msg.h | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h index be3e38aa9dd2..dad400935405 100644 --- a/net/tipc/msg.h +++ b/net/tipc/msg.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * net/tipc/msg.h: Include file for TIPC message header routines | 2 | * net/tipc/msg.h: Include file for TIPC message header routines |
3 | * | 3 | * |
4 | * Copyright (c) 2000-2007, 2014-2015 Ericsson AB | 4 | * Copyright (c) 2000-2007, 2014-2017 Ericsson AB |
5 | * Copyright (c) 2005-2008, 2010-2011, Wind River Systems | 5 | * Copyright (c) 2005-2008, 2010-2011, Wind River Systems |
6 | * All rights reserved. | 6 | * All rights reserved. |
7 | * | 7 | * |
@@ -61,10 +61,11 @@ struct plist; | |||
61 | /* | 61 | /* |
62 | * Payload message types | 62 | * Payload message types |
63 | */ | 63 | */ |
64 | #define TIPC_CONN_MSG 0 | 64 | #define TIPC_CONN_MSG 0 |
65 | #define TIPC_MCAST_MSG 1 | 65 | #define TIPC_MCAST_MSG 1 |
66 | #define TIPC_NAMED_MSG 2 | 66 | #define TIPC_NAMED_MSG 2 |
67 | #define TIPC_DIRECT_MSG 3 | 67 | #define TIPC_DIRECT_MSG 3 |
68 | #define TIPC_GRP_BCAST_MSG 4 | ||
68 | 69 | ||
69 | /* | 70 | /* |
70 | * Internal message users | 71 | * Internal message users |
@@ -73,6 +74,7 @@ struct plist; | |||
73 | #define MSG_BUNDLER 6 | 74 | #define MSG_BUNDLER 6 |
74 | #define LINK_PROTOCOL 7 | 75 | #define LINK_PROTOCOL 7 |
75 | #define CONN_MANAGER 8 | 76 | #define CONN_MANAGER 8 |
77 | #define GROUP_PROTOCOL 9 | ||
76 | #define TUNNEL_PROTOCOL 10 | 78 | #define TUNNEL_PROTOCOL 10 |
77 | #define NAME_DISTRIBUTOR 11 | 79 | #define NAME_DISTRIBUTOR 11 |
78 | #define MSG_FRAGMENTER 12 | 80 | #define MSG_FRAGMENTER 12 |
@@ -87,6 +89,7 @@ struct plist; | |||
87 | #define BASIC_H_SIZE 32 /* Basic payload message */ | 89 | #define BASIC_H_SIZE 32 /* Basic payload message */ |
88 | #define NAMED_H_SIZE 40 /* Named payload message */ | 90 | #define NAMED_H_SIZE 40 /* Named payload message */ |
89 | #define MCAST_H_SIZE 44 /* Multicast payload message */ | 91 | #define MCAST_H_SIZE 44 /* Multicast payload message */ |
92 | #define GROUP_H_SIZE 44 /* Group payload message */ | ||
90 | #define INT_H_SIZE 40 /* Internal messages */ | 93 | #define INT_H_SIZE 40 /* Internal messages */ |
91 | #define MIN_H_SIZE 24 /* Smallest legal TIPC header size */ | 94 | #define MIN_H_SIZE 24 /* Smallest legal TIPC header size */ |
92 | #define MAX_H_SIZE 60 /* Largest possible TIPC header size */ | 95 | #define MAX_H_SIZE 60 /* Largest possible TIPC header size */ |
@@ -252,6 +255,11 @@ static inline void msg_set_type(struct tipc_msg *m, u32 n) | |||
252 | msg_set_bits(m, 1, 29, 0x7, n); | 255 | msg_set_bits(m, 1, 29, 0x7, n); |
253 | } | 256 | } |
254 | 257 | ||
258 | static inline int msg_in_group(struct tipc_msg *m) | ||
259 | { | ||
260 | return (msg_type(m) == TIPC_GRP_BCAST_MSG); | ||
261 | } | ||
262 | |||
255 | static inline u32 msg_named(struct tipc_msg *m) | 263 | static inline u32 msg_named(struct tipc_msg *m) |
256 | { | 264 | { |
257 | return msg_type(m) == TIPC_NAMED_MSG; | 265 | return msg_type(m) == TIPC_NAMED_MSG; |
@@ -259,7 +267,9 @@ static inline u32 msg_named(struct tipc_msg *m) | |||
259 | 267 | ||
260 | static inline u32 msg_mcast(struct tipc_msg *m) | 268 | static inline u32 msg_mcast(struct tipc_msg *m) |
261 | { | 269 | { |
262 | return msg_type(m) == TIPC_MCAST_MSG; | 270 | int mtyp = msg_type(m); |
271 | |||
272 | return ((mtyp == TIPC_MCAST_MSG) || (mtyp == TIPC_GRP_BCAST_MSG)); | ||
263 | } | 273 | } |
264 | 274 | ||
265 | static inline u32 msg_connected(struct tipc_msg *m) | 275 | static inline u32 msg_connected(struct tipc_msg *m) |
@@ -515,6 +525,12 @@ static inline void msg_set_nameupper(struct tipc_msg *m, u32 n) | |||
515 | #define DSC_RESP_MSG 1 | 525 | #define DSC_RESP_MSG 1 |
516 | 526 | ||
517 | /* | 527 | /* |
528 | * Group protocol message types | ||
529 | */ | ||
530 | #define GRP_JOIN_MSG 0 | ||
531 | #define GRP_LEAVE_MSG 1 | ||
532 | |||
533 | /* | ||
518 | * Word 1 | 534 | * Word 1 |
519 | */ | 535 | */ |
520 | static inline u32 msg_seq_gap(struct tipc_msg *m) | 536 | static inline u32 msg_seq_gap(struct tipc_msg *m) |
@@ -795,6 +811,28 @@ static inline void msg_set_link_tolerance(struct tipc_msg *m, u32 n) | |||
795 | msg_set_bits(m, 9, 0, 0xffff, n); | 811 | msg_set_bits(m, 9, 0, 0xffff, n); |
796 | } | 812 | } |
797 | 813 | ||
814 | static inline u16 msg_grp_bc_syncpt(struct tipc_msg *m) | ||
815 | { | ||
816 | return msg_bits(m, 9, 16, 0xffff); | ||
817 | } | ||
818 | |||
819 | static inline void msg_set_grp_bc_syncpt(struct tipc_msg *m, u16 n) | ||
820 | { | ||
821 | msg_set_bits(m, 9, 16, 0xffff, n); | ||
822 | } | ||
823 | |||
824 | /* Word 10 | ||
825 | */ | ||
826 | static inline u16 msg_grp_bc_seqno(struct tipc_msg *m) | ||
827 | { | ||
828 | return msg_bits(m, 10, 16, 0xffff); | ||
829 | } | ||
830 | |||
831 | static inline void msg_set_grp_bc_seqno(struct tipc_msg *m, u32 n) | ||
832 | { | ||
833 | msg_set_bits(m, 10, 16, 0xffff, n); | ||
834 | } | ||
835 | |||
798 | static inline bool msg_peer_link_is_up(struct tipc_msg *m) | 836 | static inline bool msg_peer_link_is_up(struct tipc_msg *m) |
799 | { | 837 | { |
800 | if (likely(msg_user(m) != LINK_PROTOCOL)) | 838 | if (likely(msg_user(m) != LINK_PROTOCOL)) |