packet-corosync-totemknet.c 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494
  1. /* packet-corosync-totemknet.c
  2. * Dissectors for totem single ring protocol implemented in corosync cluster engine v3
  3. * Copyright 2007 2009 2010 2014 Masatake YAMATO <yamato@redhat.com>
  4. * Updated for corosync 3 by Christine Caulfield <ccaulfie@redhat.com>
  5. * Copyright (c) 2010-2026 Red Hat, Inc.
  6. *
  7. * Wireshark - Network traffic analyzer
  8. * By Gerald Combs <gerald@wireshark.org>
  9. * Copyright 1998 Gerald Combs
  10. *
  11. * SPDX-License-Identifier: GPL-2.0-or-later
  12. */
  13. /* Fields description are taken from
  14. Y.AMIR, L.E.MOSER, P.M.MELLIAR-SMITH, D.A.AGARWAL, P.CIARFELLA.
  15. "The Totem Single-Ring Ordering and Membership Protocol"*/
  16. #include <epan/packet.h>
  17. #include <epan/aftypes.h>
  18. #include <wsutil/plugins.h>
  19. #include "packet-corosync-totemknet.h"
  20. WS_DLL_PUBLIC_DEF const char plugin_version[] = "1.0";
  21. WS_DLL_PUBLIC_DEF const int plugin_want_major = WIRESHARK_VERSION_MAJOR;
  22. WS_DLL_PUBLIC_DEF const int plugin_want_minor = WIRESHARK_VERSION_MINOR;
  23. /*
  24. * Utilities for subdissectors of corosync_totemknet.
  25. */
  26. struct corosync_totemknet_info {
  27. unsigned encoding;
  28. unsigned nodeid;
  29. };
  30. /* Initialize the protocol and registered fields */
  31. static int proto_corosync_totemknet;
  32. static dissector_handle_t totemknet_handle;
  33. static heur_dissector_list_t heur_subdissector_list;
  34. /* fields for struct message_header */
  35. static int hf_corosync_message_header_magic;
  36. static int hf_corosync_message_header_version;
  37. static int hf_corosync_message_header_type;
  38. static int hf_corosync_message_header_encapsulated;
  39. static int hf_corosync_message_header_nodeid;
  40. static int hf_corosync_message_header_target_nodeid;
  41. static int hf_corosync_totemknet_srp_addr;
  42. /* fields for struct orf_token */
  43. static int hf_corosync_totemknet_orf_token;
  44. static int hf_corosync_totemknet_orf_token_seq;
  45. static int hf_corosync_totemknet_orf_token_token_seq;
  46. static int hf_corosync_totemknet_orf_token_aru;
  47. static int hf_corosync_totemknet_orf_token_aru_addr;
  48. static int hf_corosync_totemknet_orf_token_backlog;
  49. static int hf_corosync_totemknet_orf_token_fcc;
  50. static int hf_corosync_totemknet_orf_token_retrans_flg;
  51. static int hf_corosync_totemknet_orf_token_rtr_list_entries;
  52. /* field for struct memb_ring_id */
  53. static int hf_corosync_totemknet_memb_ring_id;
  54. static int hf_corosync_totemknet_memb_ring_id_rep;
  55. static int hf_corosync_totemknet_memb_ring_id_seq;
  56. /* field of struct mcast */
  57. static int hf_corosync_totemknet_mcast;
  58. static int hf_corosync_totemknet_mcast_seq;
  59. static int hf_corosync_totemknet_mcast_this_seqno;
  60. static int hf_corosync_totemknet_mcast_node_id;
  61. static int hf_corosync_totemknet_mcast_system_from;
  62. static int hf_corosync_totemknet_mcast_guarantee;
  63. /* field of struct memb_merge_detect */
  64. static int hf_corosync_totemknet_memb_merge_detect;
  65. static int hf_corosync_totemknet_memb_merge_detect_system_from;
  66. /* field of struct rtr_item */
  67. static int hf_corosync_totemknet_rtr_item;
  68. static int hf_corosync_totemknet_rtr_item_seq;
  69. /* field of struct memb_join */
  70. static int hf_corosync_totemknet_memb_join;
  71. static int hf_corosync_totemknet_memb_join_system_from;
  72. static int hf_corosync_totemknet_memb_join_proc_list_entries;
  73. static int hf_corosync_totemknet_memb_join_proc_list_entry;
  74. static int hf_corosync_totemknet_memb_join_failed_list_entries;
  75. static int hf_corosync_totemknet_memb_join_failed_list_entry;
  76. static int hf_corosync_totemknet_memb_join_ring_seq;
  77. /* field of struct memb_commit_token */
  78. static int hf_corosync_totemknet_memb_commit_token;
  79. static int hf_corosync_totemknet_memb_commit_token_token_seq;
  80. static int hf_corosync_totemknet_memb_commit_token_retrans_flg;
  81. static int hf_corosync_totemknet_memb_commit_token_memb_index;
  82. static int hf_corosync_totemknet_memb_commit_token_addr_entries;
  83. static int hf_corosync_totemknet_memb_commit_token_addr;
  84. /* field of struct memb_commit_token_memb_entry */
  85. static int hf_corosync_totemknet_memb_commit_token_memb_entry;
  86. static int hf_corosync_totemknet_memb_commit_token_memb_entry_aru;
  87. static int hf_corosync_totemknet_memb_commit_token_memb_entry_high_delivered;
  88. static int hf_corosync_totemknet_memb_commit_token_memb_entry_received_flg;
  89. /* field of struct token_hold_cancel */
  90. static int hf_corosync_totemknet_token_hold_cancel;
  91. /* totemPG fields */
  92. static int hf_corosync_totemknet_totempg;
  93. static int hf_corosync_totemknet_totempg_mcast_header_version;
  94. static int hf_corosync_totemknet_totempg_mcast_header_type;
  95. static int hf_corosync_totemknet_totempg_mcast_fragmented;
  96. static int hf_corosync_totemknet_totempg_mcast_continuation;
  97. static int hf_corosync_totemknet_totempg_mcast_msg_count;
  98. static int hf_corosync_totemknet_totempg_mcast_msg_len;
  99. static int hf_corosync_totemknet_totempg_mcast_group_cnt;
  100. static int hf_corosync_totemknet_totempg_mcast_group_len;
  101. static int hf_corosync_totemknet_totempg_mcast_message;
  102. /* CPG fields */
  103. static int hf_corosync_totemknet_cpg;
  104. static int hf_corosync_totemknet_cpg_ipc_header_id_service;
  105. static int hf_corosync_totemknet_cpg_ipc_header_id_message;
  106. static int hf_corosync_totemknet_cpg_ipc_header_size;
  107. static int hf_corosync_totemknet_cpg_ipc_header_error;
  108. static int hf_corosync_totemknet_cpg_name_name;
  109. static int hf_corosync_totemknet_cpg_name_len;
  110. static int hf_corosync_totemknet_cpg_name;
  111. static int hf_corosync_totemknet_cpg_procjoin_pid;
  112. static int hf_corosync_totemknet_cpg_procjoin_reason;
  113. static int hf_corosync_totemknet_cpg_mcast_msglen;
  114. static int hf_corosync_totemknet_cpg_mcast_pid;
  115. static int hf_corosync_totemknet_cpg_mcast_source_nodeid;
  116. static int hf_corosync_totemknet_cpg_mcast_source_conn;
  117. static int hf_corosync_totemknet_cpg_mcast_message;
  118. static int hf_corosync_totemknet_cpg_dlistold_left;
  119. static int hf_corosync_totemknet_cpg_dlistold_node;
  120. static int hf_corosync_totemknet_cpg_dlist_old;
  121. static int hf_corosync_totemknet_cpg_dlist_left;
  122. static int hf_corosync_totemknet_cpg_dlist_node;
  123. static int hf_corosync_totemknet_cpg_pmcast_msglen;
  124. static int hf_corosync_totemknet_cpg_pmcast_fraglen;
  125. static int hf_corosync_totemknet_cpg_pmcast_pid;
  126. static int hf_corosync_totemknet_cpg_pmcast_type;
  127. static int hf_corosync_totemknet_cpg_pmcast_message;
  128. /* Initialize the subtree pointers */
  129. static int ett_corosync_totemknet;
  130. static int ett_corosync_totemknet_orf_token;
  131. static int ett_corosync_totemknet_memb_ring_id;
  132. static int ett_corosync_totemknet_ip_address;
  133. static int ett_corosync_totemknet_mcast;
  134. static int ett_corosync_totemknet_memb_merge_detect;
  135. static int ett_corosync_totemknet_rtr_item;
  136. static int ett_corosync_totemknet_memb_join;
  137. static int ett_corosync_totemknet_memb_commit_token;
  138. static int ett_corosync_totemknet_memb_commit_token_memb_entry;
  139. static int ett_corosync_totemknet_token_hold_cancel;
  140. static int ett_corosync_totemknet_memb_join_proc_list;
  141. static int ett_corosync_totemknet_memb_join_failed_list;
  142. static int ett_corosync_totemknet_srp_addr;
  143. static int ett_corosync_totemknet_totempg;
  144. static int ett_corosync_totemknet_cpg;
  145. static int ett_corosync_totemknet_cpg_name;
  146. /*
  147. * Value strings
  148. */
  149. #define COROSYNC_TOTEMKNET_MESSAGE_TYPE_ORF_TOKEN 0
  150. #define COROSYNC_TOTEMKNET_MESSAGE_TYPE_MCAST 1
  151. #define COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_MERGE_DETECT 2
  152. #define COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_JOIN 3
  153. #define COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_COMMIT_TOKEN 4
  154. #define COROSYNC_TOTEMKNET_MESSAGE_TYPE_TOKEN_HOLD_CANCEL 5
  155. static const value_string corosync_totemknet_message_header_type[] = {
  156. { COROSYNC_TOTEMKNET_MESSAGE_TYPE_ORF_TOKEN, "orf" },
  157. { COROSYNC_TOTEMKNET_MESSAGE_TYPE_MCAST, "mcast" },
  158. { COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_MERGE_DETECT, "merge rings" },
  159. { COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_JOIN, "join message" },
  160. { COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_COMMIT_TOKEN, "commit token" },
  161. { COROSYNC_TOTEMKNET_MESSAGE_TYPE_TOKEN_HOLD_CANCEL, "cancel" },
  162. { 0, NULL }
  163. };
  164. #define COROSYNC_TOTEMKNET_MESSAGE_ENCAPSULATED 1
  165. #define COROSYNC_TOTEMKNET_MESSAGE_NOT_ENCAPSULATED 2
  166. static const value_string corosync_totemknet_message_header_encapsulated[] = {
  167. { 0, "not mcast message" },
  168. { COROSYNC_TOTEMKNET_MESSAGE_ENCAPSULATED, "encapsulated" },
  169. { COROSYNC_TOTEMKNET_MESSAGE_NOT_ENCAPSULATED, "not encapsulated" },
  170. { 0, NULL }
  171. };
  172. enum cpg_message_req_types {
  173. MESSAGE_REQ_EXEC_CPG_PROCJOIN = 0,
  174. MESSAGE_REQ_EXEC_CPG_PROCLEAVE = 1,
  175. MESSAGE_REQ_EXEC_CPG_JOINLIST = 2,
  176. MESSAGE_REQ_EXEC_CPG_MCAST = 3,
  177. MESSAGE_REQ_EXEC_CPG_DOWNLIST_OLD = 4,
  178. MESSAGE_REQ_EXEC_CPG_DOWNLIST = 5,
  179. MESSAGE_REQ_EXEC_CPG_PARTIAL_MCAST = 6,
  180. };
  181. static const value_string cpg_msg_names[] = {
  182. { MESSAGE_REQ_EXEC_CPG_PROCJOIN, "Proc Join" },
  183. { MESSAGE_REQ_EXEC_CPG_PROCLEAVE, "Proc Leave" },
  184. { MESSAGE_REQ_EXEC_CPG_JOINLIST, "Join List" },
  185. { MESSAGE_REQ_EXEC_CPG_MCAST, "Mcast" },
  186. { MESSAGE_REQ_EXEC_CPG_DOWNLIST_OLD, "Downlist (old)" },
  187. { MESSAGE_REQ_EXEC_CPG_DOWNLIST, "Downlist" },
  188. { MESSAGE_REQ_EXEC_CPG_PARTIAL_MCAST, "Partial Mcast" },
  189. { 0, NULL }
  190. };
  191. static uint16_t
  192. corosync_totemknet_get_uint16(tvbuff_t* tvb, int offset, const unsigned encoding)
  193. {
  194. if (encoding == ENC_LITTLE_ENDIAN)
  195. return tvb_get_letohs(tvb, offset);
  196. return tvb_get_ntohs(tvb, offset);
  197. }
  198. static uint32_t
  199. corosync_totemknet_get_uint32(tvbuff_t* tvb, int offset, const unsigned encoding)
  200. {
  201. if (encoding == ENC_LITTLE_ENDIAN)
  202. return tvb_get_letohl(tvb, offset);
  203. return tvb_get_ntohl(tvb, offset);
  204. }
  205. static uint64_t
  206. corosync_totemknet_get_uint64(tvbuff_t* tvb, int offset, const unsigned encoding)
  207. {
  208. if (encoding == ENC_LITTLE_ENDIAN)
  209. return tvb_get_letoh64(tvb, offset);
  210. return tvb_get_ntoh64(tvb, offset);
  211. }
  212. static int dissect_corosync_totemknet0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
  213. bool encapsulated);
  214. static int dissect_mar_cpg_name(tvbuff_t *tvb, int offset,
  215. packet_info *pinfo, proto_tree *parent,
  216. const unsigned encoding)
  217. {
  218. proto_tree *name_tree;
  219. proto_item *item;
  220. uint32_t name_len;
  221. item = proto_tree_add_item(parent, hf_corosync_totemknet_cpg_name, tvb, offset,
  222. -1, encoding);
  223. name_tree = proto_item_add_subtree(item, ett_corosync_totemknet_cpg_name);
  224. proto_tree_add_item(name_tree, hf_corosync_totemknet_cpg_name_len,
  225. tvb, offset, 4, encoding);
  226. name_len = corosync_totemknet_get_uint32(tvb, offset, encoding);
  227. offset += 4 + 4; // 8 aligned
  228. proto_tree_add_item(name_tree, hf_corosync_totemknet_cpg_name_name,
  229. tvb, offset, name_len, encoding);
  230. offset += 128;
  231. return 128+4;
  232. }
  233. static int
  234. dissect_corosync_totemknet_cpg(uint16_t cpg_msg, tvbuff_t *tvb, int offset,
  235. packet_info *pinfo, proto_tree *parent,
  236. const unsigned encoding)
  237. {
  238. proto_tree *cpg_tree;
  239. proto_item *item;
  240. int left_nodes;
  241. int i;
  242. int cpg_msglen;
  243. item = proto_tree_add_item(parent, hf_corosync_totemknet_cpg, tvb, offset,
  244. -1, encoding);
  245. cpg_tree = proto_item_add_subtree(item, ett_corosync_totemknet_cpg);
  246. offset += dissect_mar_cpg_name(tvb, offset, pinfo, cpg_tree, encoding);
  247. offset += 4; // Pad
  248. switch (cpg_msg) {
  249. case MESSAGE_REQ_EXEC_CPG_PROCJOIN:
  250. case MESSAGE_REQ_EXEC_CPG_PROCLEAVE:
  251. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_procjoin_pid,
  252. tvb, offset, 4, encoding);
  253. offset += 8; // Padded to 8
  254. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_procjoin_reason,
  255. tvb, offset, 4, encoding);
  256. offset += 8; // Padded to 8
  257. break;
  258. case MESSAGE_REQ_EXEC_CPG_JOINLIST:
  259. break;
  260. case MESSAGE_REQ_EXEC_CPG_MCAST:
  261. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_msglen,
  262. tvb, offset, 4, encoding);
  263. cpg_msglen = corosync_totemknet_get_uint32(tvb, offset, encoding);
  264. offset += 8; // Padded to 8
  265. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_pid,
  266. tvb, offset, 4, encoding);
  267. offset += 8; // Padded to 8
  268. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_source_nodeid,
  269. tvb, offset, 4, encoding);
  270. offset += 8; // Padded to 8
  271. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_source_conn,
  272. tvb, offset, 8, encoding);
  273. offset += 8; // Padded to 8
  274. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_message,
  275. tvb, offset, cpg_msglen, encoding);
  276. break;
  277. case MESSAGE_REQ_EXEC_CPG_DOWNLIST_OLD:
  278. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_dlistold_left,
  279. tvb, offset, 4, encoding);
  280. left_nodes = corosync_totemknet_get_uint32(tvb, offset, encoding);
  281. offset += 8;
  282. for (i=0; i<left_nodes; i++) {
  283. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_dlistold_node,
  284. tvb, offset, 4, encoding);
  285. offset += 8; // Padded to 8
  286. }
  287. break;
  288. case MESSAGE_REQ_EXEC_CPG_DOWNLIST:
  289. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_dlist_old,
  290. tvb, offset, 4, encoding);
  291. offset += 8; // Padded to 8
  292. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_dlist_left,
  293. tvb, offset, 4, encoding);
  294. left_nodes = corosync_totemknet_get_uint32(tvb, offset, encoding);
  295. offset += 8; // Padded to 8
  296. for (i=0; i<left_nodes; i++) {
  297. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_dlist_node,
  298. tvb, offset, 4, encoding);
  299. offset += 8; // Padded to 8
  300. }
  301. break;
  302. case MESSAGE_REQ_EXEC_CPG_PARTIAL_MCAST:
  303. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_pmcast_msglen,
  304. tvb, offset, 4, encoding);
  305. cpg_msglen = corosync_totemknet_get_uint32(tvb, offset, encoding);
  306. offset += 8; // Padded to 8
  307. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_pmcast_fraglen,
  308. tvb, offset, 4, encoding);
  309. offset += 8; // Padded to 8
  310. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_pmcast_pid,
  311. tvb, offset, 4, encoding);
  312. offset += 8; // Padded to 8
  313. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_pmcast_type,
  314. tvb, offset, 4, encoding);
  315. offset += 8; // Padded to 8
  316. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_source_nodeid,
  317. tvb, offset, 4, encoding);
  318. offset += 8; // Padded to 8
  319. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_source_conn,
  320. tvb, offset, 8, encoding);
  321. offset += 8; // Padded to 8
  322. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_mcast_message,
  323. tvb, offset, cpg_msglen, encoding);
  324. break;
  325. }
  326. return 0; // Caller already knows the message length
  327. }
  328. static int
  329. dissect_corosync_totemknet_totempg(tvbuff_t *tvb, int offset,
  330. packet_info *pinfo, proto_tree *parent,
  331. const unsigned encoding)
  332. {
  333. proto_tree *pg_tree;
  334. proto_tree *cpg_tree;
  335. proto_item *item;
  336. uint16_t msg_count;
  337. uint16_t group_count;
  338. uint16_t service;
  339. uint16_t cpg_msg;
  340. uint16_t msg_lens[32]; // Matches MAX_IOVECS_FROM_APP
  341. int saved_offset;
  342. int i;
  343. item = proto_tree_add_item(parent, hf_corosync_totemknet_totempg, tvb, offset,
  344. -1, encoding);
  345. pg_tree = proto_item_add_subtree(item, ett_corosync_totemknet_totempg);
  346. proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_header_version,
  347. tvb, offset, 2, encoding);
  348. offset += 2;
  349. proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_header_type,
  350. tvb, offset, 2, encoding);
  351. offset += 2;
  352. proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_fragmented,
  353. tvb, offset, 1, encoding);
  354. offset += 1;
  355. proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_continuation,
  356. tvb, offset, 1, encoding);
  357. if (tvb_get_uint8(tvb, offset)) {
  358. // Don't decode continuation messages as they are just more data
  359. return 0;
  360. }
  361. offset += 1;
  362. proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_msg_count,
  363. tvb, offset, 2, encoding);
  364. msg_count = corosync_totemknet_get_uint16(tvb, offset, encoding);
  365. offset += 2;
  366. for (i = 0; i<msg_count; i++) {
  367. item = proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_msg_len,
  368. tvb, offset, 2, encoding);
  369. msg_lens[i] = corosync_totemknet_get_uint16(tvb, offset, encoding);
  370. offset += 2;
  371. proto_item_append_text(item, " (msg %d)", i+1);
  372. }
  373. proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_group_cnt,
  374. tvb, offset, 2, encoding);
  375. group_count = corosync_totemknet_get_uint16(tvb, offset, encoding);
  376. offset += 2;
  377. for (i = 0; i<group_count; i++) {
  378. item = proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_group_len,
  379. tvb, offset, 2, encoding);
  380. proto_item_append_text(item, " (group %d)", i+1);
  381. offset += 2;
  382. }
  383. offset += 1; // Skip for alignment
  384. for (i = 0; i<msg_count; i++) {
  385. saved_offset = offset;
  386. // All totem PG messages
  387. item = proto_tree_add_item(pg_tree, hf_corosync_totemknet_cpg, tvb, offset,
  388. -1, encoding);
  389. cpg_tree = proto_item_add_subtree(item, ett_corosync_totemknet_cpg);
  390. // first, a qb_ipc_response_header
  391. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_ipc_header_id_message,
  392. tvb, offset, 2, encoding);
  393. cpg_msg = corosync_totemknet_get_uint16(tvb, offset, encoding);
  394. offset += 2;
  395. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_ipc_header_id_service,
  396. tvb, offset, 2, encoding);
  397. service = corosync_totemknet_get_uint16(tvb, offset, encoding);
  398. offset += 2;
  399. offset += 4; // 8 aligned
  400. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_ipc_header_size,
  401. tvb, offset, 4, encoding);
  402. offset += 4;
  403. proto_tree_add_item(cpg_tree, hf_corosync_totemknet_cpg_ipc_header_error,
  404. tvb, offset, 4, encoding);
  405. offset += 4;
  406. // if service == 2 then it's CPG
  407. if (service == 2) {
  408. dissect_corosync_totemknet_cpg(cpg_msg, tvb, offset, pinfo, cpg_tree, encoding);
  409. } else {
  410. // Just call it 'data'
  411. proto_tree_add_item(pg_tree, hf_corosync_totemknet_totempg_mcast_message,
  412. tvb, offset, msg_lens[i], encoding);
  413. }
  414. offset = saved_offset + msg_lens[i];
  415. }
  416. return offset;
  417. }
  418. static int
  419. dissect_corosync_totemknet_memb_ring_id(tvbuff_t *tvb,
  420. __attribute__((unused)) packet_info *pinfo, proto_tree *parent_tree,
  421. __attribute__((unused)) unsigned length, int offset,
  422. const unsigned encoding,
  423. unsigned *node_id,
  424. uint64_t *ring_id)
  425. {
  426. int original_offset = offset;
  427. proto_tree *tree;
  428. proto_item *item;
  429. uint64_t rid;
  430. unsigned nid;
  431. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_memb_ring_id, tvb, offset,
  432. -1, encoding);
  433. tree = proto_item_add_subtree(item, ett_corosync_totemknet_memb_ring_id);
  434. proto_tree_add_item(tree, hf_corosync_totemknet_memb_ring_id_rep,
  435. tvb, offset, 4, encoding);
  436. nid = corosync_totemknet_get_uint32(tvb, offset, encoding);
  437. offset += 4;
  438. proto_tree_add_item(tree, hf_corosync_totemknet_memb_ring_id_seq,
  439. tvb, offset, 8, encoding);
  440. rid = corosync_totemknet_get_uint64(tvb, offset, encoding);
  441. offset += 8;
  442. proto_item_append_text(item, " (ring: %" PRIu64 ")", rid);
  443. if (node_id)
  444. *node_id = nid;
  445. if (ring_id)
  446. *ring_id = rid;
  447. proto_item_set_len(item, offset - original_offset);
  448. return offset - original_offset;
  449. }
  450. static int
  451. dissect_corosync_totemknet_rtr_list(tvbuff_t *tvb,
  452. packet_info *pinfo, proto_tree *parent_tree,
  453. unsigned length, int offset,
  454. const unsigned encoding)
  455. {
  456. int original_offset = offset;
  457. proto_tree *tree;
  458. proto_item *item;
  459. unsigned node_id;
  460. uint64_t ring_id;
  461. uint32_t seq;
  462. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_rtr_item, tvb, offset,
  463. -1, ENC_NA);
  464. tree = proto_item_add_subtree(item, ett_corosync_totemknet_rtr_item);
  465. offset += dissect_corosync_totemknet_memb_ring_id(tvb, pinfo, tree,
  466. length, offset,
  467. encoding,
  468. &node_id,
  469. &ring_id);
  470. proto_tree_add_item(tree, hf_corosync_totemknet_rtr_item_seq,
  471. tvb, offset, 4, encoding);
  472. seq = corosync_totemknet_get_uint32(tvb, offset, encoding);
  473. proto_item_append_text(item, " (ring: %" PRIu64 " node: %u seq: %u)",
  474. ring_id, node_id, seq);
  475. offset += 4;
  476. proto_item_set_len(item, offset - original_offset);
  477. return (offset - original_offset);
  478. }
  479. static int
  480. dissect_corosync_totemknet_orf_token(tvbuff_t *tvb,
  481. packet_info *pinfo, proto_tree *parent_tree,
  482. unsigned length, int offset,
  483. const unsigned encoding)
  484. {
  485. int original_offset = offset;
  486. uint32_t rtr_list_entries = 0, seq, aru, i;
  487. proto_tree *tree;
  488. proto_item *item;
  489. unsigned node_id;
  490. uint64_t ring_id;
  491. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_orf_token,
  492. tvb, offset, -1, ENC_NA);
  493. tree = proto_item_add_subtree(item, ett_corosync_totemknet_orf_token);
  494. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_seq,
  495. tvb, offset, 4, encoding);
  496. offset += 4;
  497. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_token_seq,
  498. tvb, offset, 4, encoding);
  499. seq = corosync_totemknet_get_uint32(tvb, offset, encoding);
  500. offset += 4;
  501. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_aru,
  502. tvb, offset, 4, encoding);
  503. aru = corosync_totemknet_get_uint32(tvb, offset, encoding);
  504. offset += 4;
  505. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_aru_addr,
  506. tvb, offset, 4, encoding);
  507. offset += 4;
  508. offset += dissect_corosync_totemknet_memb_ring_id(tvb, pinfo, tree,
  509. length, offset,
  510. encoding,
  511. &node_id,
  512. &ring_id);
  513. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_backlog,
  514. tvb, offset, 4, encoding);
  515. offset += 4;
  516. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_fcc,
  517. tvb, offset, 4, encoding);
  518. offset += 4;
  519. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_retrans_flg,
  520. tvb, offset, 4, encoding);
  521. offset += 4;
  522. proto_tree_add_item(tree, hf_corosync_totemknet_orf_token_rtr_list_entries,
  523. tvb, offset, 4, encoding);
  524. rtr_list_entries = corosync_totemknet_get_uint32(tvb, offset, encoding);
  525. offset += 4;
  526. for (i = 0; i < rtr_list_entries; i++) {
  527. offset += dissect_corosync_totemknet_rtr_list(tvb, pinfo,
  528. tree,
  529. length, offset,
  530. encoding);
  531. }
  532. proto_item_append_text(item, " (ring: %" PRIu64 " node: %u nrtr: %d seq: %d au: %u)",
  533. ring_id, node_id, rtr_list_entries, seq, aru);
  534. proto_item_set_len(item, offset - original_offset);
  535. return offset - original_offset;
  536. }
  537. static int
  538. dissect_corosync_totemknet_srp_addr(tvbuff_t *tvb,
  539. packet_info *pinfo _U_, proto_tree *parent_tree,
  540. unsigned length _U_, int offset,
  541. int hf,
  542. const unsigned encoding)
  543. {
  544. // proto_tree_add_item(parent_tree, hf_corosync_totemknet_srp_addr, tvb, offset, 4, encoding);
  545. proto_tree_add_item(parent_tree, hf, tvb, offset, 4, encoding);
  546. return 4;
  547. }
  548. static int
  549. // NOLINTNEXTLINE(misc-no-recursion)
  550. dissect_corosync_totemknet_mcast(tvbuff_t *tvb,
  551. packet_info *pinfo, proto_tree *tree,
  552. unsigned length, int offset,
  553. uint8_t message_header__encapsulated,
  554. const unsigned encoding, proto_tree *parent_tree,
  555. struct corosync_totemknet_info *totemknet_info)
  556. {
  557. int original_offset = offset;
  558. proto_tree *mcast_tree;
  559. proto_item *item;
  560. unsigned node_id;
  561. uint64_t ring_id;
  562. tvbuff_t *next_tvb;
  563. heur_dtbl_entry_t *hdtbl_entry = NULL;
  564. item = proto_tree_add_item(tree, hf_corosync_totemknet_mcast, tvb, offset,
  565. -1, encoding);
  566. mcast_tree = proto_item_add_subtree(item, ett_corosync_totemknet_mcast);
  567. proto_tree_add_item(mcast_tree, hf_corosync_totemknet_mcast_system_from,
  568. tvb, offset, 4, encoding);
  569. offset += 4;
  570. proto_tree_add_item(mcast_tree, hf_corosync_totemknet_mcast_seq,
  571. tvb, offset, 4, encoding);
  572. offset += 4;
  573. proto_tree_add_item(mcast_tree, hf_corosync_totemknet_mcast_this_seqno,
  574. tvb, offset, 4, encoding);
  575. offset += 4;
  576. offset += dissect_corosync_totemknet_memb_ring_id(tvb, pinfo, mcast_tree,
  577. length, offset,
  578. encoding,
  579. &node_id,
  580. &ring_id);
  581. proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)",
  582. ring_id, node_id);
  583. proto_tree_add_item(tree, hf_corosync_totemknet_mcast_node_id,
  584. tvb, offset, 4, encoding);
  585. offset += 4;
  586. proto_tree_add_item(tree, hf_corosync_totemknet_mcast_guarantee,
  587. tvb, offset, 4, encoding);
  588. offset += 4;
  589. next_tvb = tvb_new_subset_remaining(tvb, offset);
  590. if (message_header__encapsulated == COROSYNC_TOTEMKNET_MESSAGE_ENCAPSULATED)
  591. {
  592. offset += dissect_corosync_totemknet0(next_tvb, pinfo, tree, true);
  593. }
  594. else
  595. {
  596. // TotemPG header
  597. if (dissect_corosync_totemknet_totempg(tvb, offset, pinfo, mcast_tree, encoding) == 0) {
  598. if (dissector_try_heuristic(heur_subdissector_list,
  599. next_tvb,
  600. pinfo,
  601. parent_tree,
  602. &hdtbl_entry,
  603. totemknet_info))
  604. offset = length;
  605. }
  606. }
  607. proto_item_set_len(item, offset - original_offset);
  608. return (offset - original_offset);
  609. }
  610. static int
  611. dissect_corosync_totemknet_memb_merge_detect(tvbuff_t *tvb,
  612. packet_info *pinfo, proto_tree *parent_tree,
  613. unsigned length, int offset,
  614. const unsigned encoding)
  615. {
  616. int original_offset = offset;
  617. proto_tree *tree;
  618. proto_item *item;
  619. unsigned node_id;
  620. uint64_t ring_id;
  621. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_memb_merge_detect, tvb, offset,
  622. -1, ENC_NA);
  623. tree = proto_item_add_subtree(item, ett_corosync_totemknet_memb_merge_detect);
  624. proto_tree_add_item(tree, hf_corosync_totemknet_memb_merge_detect_system_from,
  625. tvb, offset, 4, encoding);
  626. offset += 4;
  627. offset += dissect_corosync_totemknet_memb_ring_id(tvb, pinfo, tree,
  628. length, offset,
  629. encoding,
  630. &node_id,
  631. &ring_id);
  632. proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)",
  633. ring_id, node_id);
  634. proto_item_set_len(item, offset - original_offset);
  635. return (offset - original_offset);
  636. }
  637. static int
  638. dissect_corosync_totemknet_memb_join(tvbuff_t *tvb,
  639. packet_info *pinfo, proto_tree *parent_tree,
  640. unsigned length, int offset,
  641. const unsigned encoding)
  642. {
  643. int original_offset = offset;
  644. proto_tree *tree;
  645. proto_item *item;
  646. uint32_t proc_list_entries;
  647. proto_tree *proc_tree;
  648. uint32_t failed_list_entries;
  649. proto_tree *failed_tree;
  650. proto_item *failed_item;
  651. unsigned i;
  652. proto_item *proc_item;
  653. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_memb_join, tvb, offset,
  654. -1, encoding);
  655. tree = proto_item_add_subtree(item, ett_corosync_totemknet_memb_join);
  656. proto_tree_add_item(tree, hf_corosync_totemknet_memb_join_system_from,
  657. tvb, offset, 4, encoding);
  658. offset += 4;
  659. proc_item = proto_tree_add_item(tree, hf_corosync_totemknet_memb_join_proc_list_entries,
  660. tvb, offset, 4, encoding);
  661. proc_list_entries = corosync_totemknet_get_uint32(tvb, offset, encoding);
  662. offset += 4;
  663. failed_item = proto_tree_add_item(tree, hf_corosync_totemknet_memb_join_failed_list_entries,
  664. tvb, offset, 4, encoding);
  665. failed_list_entries = corosync_totemknet_get_uint32(tvb, offset, encoding);
  666. offset += 4;
  667. proto_tree_add_item(tree, hf_corosync_totemknet_memb_join_ring_seq,
  668. tvb, offset, 8, encoding);
  669. offset += 8;
  670. proc_tree = proto_item_add_subtree(proc_item, ett_corosync_totemknet_memb_join_proc_list);
  671. proto_item_append_text(item, " (nprocs: %u nfailed: %u)",
  672. proc_list_entries, failed_list_entries);
  673. for (i = 0; i < proc_list_entries; i++) {
  674. offset += dissect_corosync_totemknet_srp_addr(tvb, pinfo, proc_tree,
  675. length, offset,
  676. hf_corosync_totemknet_memb_join_proc_list_entry,
  677. encoding);
  678. }
  679. failed_tree = proto_item_add_subtree(failed_item,
  680. ett_corosync_totemknet_memb_join_failed_list);
  681. for (i = 0; i < failed_list_entries; i++) {
  682. offset += dissect_corosync_totemknet_srp_addr(tvb, pinfo, failed_tree,
  683. length, offset,
  684. hf_corosync_totemknet_memb_join_failed_list_entry,
  685. encoding);
  686. }
  687. proto_item_set_len(item, offset - original_offset);
  688. return (offset - original_offset);
  689. }
  690. static int
  691. dissect_corosync_totemknet_memb_commit_token_memb_entry(tvbuff_t *tvb,
  692. packet_info *pinfo,
  693. proto_tree *parent_tree,
  694. unsigned length, int offset,
  695. const unsigned encoding,
  696. unsigned *node_id,
  697. uint64_t *ring_id)
  698. {
  699. int original_offset = offset;
  700. proto_tree *tree;
  701. proto_item *item;
  702. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_memb_commit_token_memb_entry,
  703. tvb, offset, -1, encoding);
  704. tree = proto_item_add_subtree(item, ett_corosync_totemknet_memb_commit_token_memb_entry);
  705. offset += dissect_corosync_totemknet_memb_ring_id(tvb, pinfo, tree,
  706. length, offset,
  707. encoding,
  708. node_id,
  709. ring_id);
  710. proto_tree_add_item(tree, hf_corosync_totemknet_memb_commit_token_memb_entry_aru,
  711. tvb, offset, 4, encoding);
  712. offset += 4;
  713. proto_tree_add_item(tree, hf_corosync_totemknet_memb_commit_token_memb_entry_high_delivered,
  714. tvb, offset, 4, encoding);
  715. offset += 4;
  716. proto_tree_add_item(tree, hf_corosync_totemknet_memb_commit_token_memb_entry_received_flg,
  717. tvb, offset, 4, encoding);
  718. offset += 4;
  719. proto_item_set_len(item, offset - original_offset);
  720. return (offset - original_offset);
  721. }
  722. static int
  723. dissect_corosync_totemknet_memb_commit_token(tvbuff_t *tvb,
  724. packet_info *pinfo, proto_tree *parent_tree,
  725. unsigned length, int offset,
  726. const unsigned encoding)
  727. {
  728. int original_offset = offset;
  729. proto_tree *tree;
  730. proto_item *item;
  731. uint32_t i, addr_entries;
  732. uint32_t seq;
  733. unsigned node_id;
  734. uint64_t ring_id;
  735. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_memb_commit_token,
  736. tvb, offset, -1, ENC_NA);
  737. tree = proto_item_add_subtree(item, ett_corosync_totemknet_memb_commit_token);
  738. proto_tree_add_item(tree, hf_corosync_totemknet_memb_commit_token_token_seq,
  739. tvb, offset, 4, encoding);
  740. seq = corosync_totemknet_get_uint32(tvb, offset, encoding);
  741. offset += 4;
  742. offset += dissect_corosync_totemknet_memb_ring_id(tvb, pinfo, tree,
  743. length, offset,
  744. encoding,
  745. &node_id,
  746. &ring_id);
  747. proto_tree_add_item(tree, hf_corosync_totemknet_memb_commit_token_retrans_flg,
  748. tvb, offset, 4, encoding);
  749. offset += 4;
  750. proto_tree_add_item(tree, hf_corosync_totemknet_memb_commit_token_memb_index,
  751. tvb, offset, 4, encoding);
  752. offset += 4;
  753. proto_tree_add_item(tree, hf_corosync_totemknet_memb_commit_token_addr_entries,
  754. tvb, offset, 4, encoding);
  755. addr_entries = corosync_totemknet_get_uint32(tvb, offset, encoding);
  756. offset += 4;
  757. for (i = 0; i < addr_entries; i++) {
  758. offset += dissect_corosync_totemknet_srp_addr(tvb, pinfo, tree,
  759. length, offset,
  760. hf_corosync_totemknet_memb_commit_token_addr,
  761. encoding);
  762. }
  763. for (i = 0; i < addr_entries; i++) {
  764. offset += dissect_corosync_totemknet_memb_commit_token_memb_entry(tvb, pinfo, tree,
  765. length, offset,
  766. encoding,
  767. NULL,
  768. NULL);
  769. }
  770. proto_item_append_text(item, " (ring: %" PRIu64 " node: %u seq: %u entries: %u)",
  771. ring_id, node_id, seq, addr_entries);
  772. proto_item_set_len(item, offset - original_offset);
  773. return (offset - original_offset);
  774. }
  775. static int
  776. dissect_corosync_totemknet_token_hold_cancel(tvbuff_t *tvb,
  777. packet_info *pinfo, proto_tree *parent_tree,
  778. unsigned length, int offset,
  779. const unsigned encoding)
  780. {
  781. int original_offset = offset;
  782. proto_tree *tree;
  783. proto_item *item;
  784. unsigned node_id;
  785. uint64_t ring_id;
  786. item = proto_tree_add_item(parent_tree, hf_corosync_totemknet_token_hold_cancel, tvb, offset,
  787. -1, ENC_NA);
  788. tree = proto_item_add_subtree(item, ett_corosync_totemknet_token_hold_cancel);
  789. offset += dissect_corosync_totemknet_memb_ring_id(tvb, pinfo, tree,
  790. length, offset,
  791. encoding,
  792. &node_id,
  793. &ring_id);
  794. proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)",
  795. ring_id, node_id);
  796. proto_item_set_len(item, offset - original_offset);
  797. return (offset - original_offset);
  798. }
  799. static int
  800. dissect_corosync_totemknet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
  801. {
  802. return dissect_corosync_totemknet0(tvb, pinfo, parent_tree, false);
  803. }
  804. #define COROSYNC_TOTEMKNET_TEST_LITTLE_ENDIAN 0x22FF
  805. #define COROSYNC_TOTEMKNET_TEST_BIG_ENDIAN 0xFF22
  806. static int
  807. // NOLINTNEXTLINE(misc-no-recursion)
  808. dissect_corosync_totemknet0(tvbuff_t *tvb,
  809. packet_info *pinfo, proto_tree *tree,
  810. bool encapsulated)
  811. {
  812. proto_item *item;
  813. unsigned length;
  814. int offset = 0;
  815. proto_tree *corosync_tree;
  816. uint8_t message_header__type;
  817. uint16_t message_header__magic;
  818. uint8_t message_header__encapsulated;
  819. unsigned encoding;
  820. struct corosync_totemknet_info info;
  821. /* Check that there's enough data */
  822. length = tvb_reported_length(tvb);
  823. if (length < 1 + 1 + 2 + 4)
  824. return 0;
  825. /* message header */
  826. message_header__magic = tvb_get_uint16(tvb, 0, 0);
  827. if (message_header__magic == 0xC070) {
  828. encoding = ENC_BIG_ENDIAN;
  829. } else if (message_header__magic == 0x70c0) {
  830. encoding = ENC_LITTLE_ENDIAN;
  831. } else {
  832. return 0;
  833. }
  834. message_header__encapsulated = tvb_get_uint8(tvb, 4);
  835. message_header__type = tvb_get_uint8(tvb, 3);
  836. if (encapsulated == false)
  837. {
  838. col_set_str(pinfo->cinfo, COL_PROTOCOL, "COROSYNC/TOTEMKNET");
  839. col_set_str(pinfo->cinfo, COL_INFO,
  840. ((message_header__type == COROSYNC_TOTEMKNET_MESSAGE_TYPE_MCAST)
  841. && (message_header__encapsulated == COROSYNC_TOTEMKNET_MESSAGE_ENCAPSULATED))?
  842. "ENCAPSULATED":
  843. val_to_str_const(message_header__type,
  844. corosync_totemknet_message_header_type,
  845. "Unknown"));
  846. }
  847. item = proto_tree_add_item(tree, proto_corosync_totemknet, tvb, offset, -1, ENC_NA);
  848. corosync_tree = proto_item_add_subtree(item, ett_corosync_totemknet);
  849. proto_tree_add_item(corosync_tree, hf_corosync_message_header_magic,
  850. tvb, offset, 2, ENC_NA);
  851. offset += 2;
  852. proto_tree_add_item(corosync_tree, hf_corosync_message_header_version,
  853. tvb, offset, 1, ENC_NA);
  854. offset += 1;
  855. proto_tree_add_item(corosync_tree, hf_corosync_message_header_type,
  856. tvb, offset, 1, ENC_NA);
  857. offset += 1;
  858. proto_tree_add_item(corosync_tree, hf_corosync_message_header_encapsulated,
  859. tvb, offset, 1, ENC_NA);
  860. offset += 1;
  861. proto_tree_add_item(corosync_tree, hf_corosync_message_header_nodeid,
  862. tvb, offset, 4, encoding);
  863. info.nodeid = corosync_totemknet_get_uint32(tvb, offset, encoding);
  864. offset += 4;
  865. proto_tree_add_item(corosync_tree,
  866. hf_corosync_message_header_target_nodeid,
  867. tvb, offset, 4, encoding);
  868. info.encoding = encoding;
  869. offset += 4;
  870. increment_dissection_depth(pinfo);
  871. switch (message_header__type) {
  872. case COROSYNC_TOTEMKNET_MESSAGE_TYPE_ORF_TOKEN:
  873. dissect_corosync_totemknet_orf_token(tvb, pinfo, corosync_tree, length, offset, encoding);
  874. break;
  875. case COROSYNC_TOTEMKNET_MESSAGE_TYPE_MCAST:
  876. dissect_corosync_totemknet_mcast(tvb, pinfo, corosync_tree, length, offset,
  877. message_header__encapsulated,
  878. encoding, tree, &info);
  879. break;
  880. case COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_MERGE_DETECT:
  881. dissect_corosync_totemknet_memb_merge_detect(tvb, pinfo, corosync_tree, length, offset,
  882. encoding);
  883. break;
  884. case COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_JOIN:
  885. dissect_corosync_totemknet_memb_join(tvb, pinfo, corosync_tree, length, offset,
  886. encoding);
  887. break;
  888. case COROSYNC_TOTEMKNET_MESSAGE_TYPE_MEMB_COMMIT_TOKEN:
  889. dissect_corosync_totemknet_memb_commit_token(tvb, pinfo, corosync_tree, length, offset,
  890. encoding);
  891. break;
  892. case COROSYNC_TOTEMKNET_MESSAGE_TYPE_TOKEN_HOLD_CANCEL:
  893. dissect_corosync_totemknet_token_hold_cancel(tvb, pinfo, corosync_tree, length, offset,
  894. encoding);
  895. break;
  896. default:
  897. break;
  898. }
  899. decrement_dissection_depth(pinfo);
  900. return length;
  901. }
  902. void
  903. proto_register_corosync_totemknet(void)
  904. {
  905. static hf_register_info hf[] = {
  906. /* message_header */
  907. { &hf_corosync_message_header_magic,
  908. { "Magic", "corosync_totemknet.message_header.magic",
  909. FT_UINT16, BASE_HEX, NULL, 0x0,
  910. NULL, HFILL }},
  911. { &hf_corosync_message_header_version,
  912. { "Version", "corosync_totemknet.message_header.version",
  913. FT_INT8, BASE_DEC, NULL, 0x0,
  914. NULL, HFILL }},
  915. { &hf_corosync_message_header_type,
  916. { "Type", "corosync_totemknet.message_header.type",
  917. FT_INT8, BASE_DEC, VALS(corosync_totemknet_message_header_type), 0x0,
  918. NULL, HFILL }},
  919. { &hf_corosync_message_header_encapsulated,
  920. { "Encapsulated", "corosync_totemknet.message_header.encapsulated",
  921. FT_INT8, BASE_DEC, VALS(corosync_totemknet_message_header_encapsulated), 0x0,
  922. NULL, HFILL }},
  923. { &hf_corosync_message_header_nodeid,
  924. { "Node ID", "corosync_totemknet.message_header.nodeid",
  925. FT_UINT32, BASE_DEC, NULL, 0x0,
  926. NULL, HFILL }},
  927. { &hf_corosync_message_header_target_nodeid,
  928. { "Target Node ID", "corosync_totemknet.message_header.target_nodeid",
  929. FT_UINT32, BASE_DEC, NULL, 0x0,
  930. NULL, HFILL }},
  931. /* Orf_token */
  932. { &hf_corosync_totemknet_orf_token,
  933. { "Ordering, Reliability, Flow (ORF) control Token", "corosync_totemknet.orf_token",
  934. FT_NONE, BASE_NONE, NULL, 0x0,
  935. NULL, HFILL }},
  936. { &hf_corosync_totemknet_orf_token_seq,
  937. { "Sequence number allowing recognition of redundant copies of the token", "corosync_totemknet.orf_token.seq",
  938. FT_UINT32, BASE_DEC, NULL, 0x0,
  939. NULL, HFILL }},
  940. { &hf_corosync_totemknet_orf_token_token_seq,
  941. { "The largest sequence number", "corosync_totemknet.orf_token.seq",
  942. FT_UINT32, BASE_DEC, NULL, 0x0,
  943. "The largest sequence number of any message "
  944. "that has been broadcast on the ring"
  945. "[1]" ,
  946. HFILL }},
  947. { &hf_corosync_totemknet_orf_token_aru,
  948. { "Sequence number all received up to", "corosync_totemknet.orf_token.aru",
  949. FT_UINT32, BASE_DEC, NULL, 0x0,
  950. NULL, HFILL }},
  951. { &hf_corosync_totemknet_orf_token_aru_addr,
  952. { "ID of node setting ARU", "corosync_totemknet.orf_token.aru_addr",
  953. FT_UINT32, BASE_DEC, NULL, 0x0,
  954. NULL, HFILL }},
  955. { &hf_corosync_totemknet_orf_token_backlog,
  956. { "Backlog", "corosync_totemknet.orf_token.backlog",
  957. FT_UINT32, BASE_DEC, NULL, 0x0,
  958. "The sum of the number of new message waiting to be transmitted by each processor on the ring "
  959. "at the time at which that processor forwarded the token during the previous rotation"
  960. "[1]",
  961. HFILL }},
  962. { &hf_corosync_totemknet_orf_token_fcc,
  963. { "FCC",
  964. "corosync_totemknet.orf_token.fcc",
  965. FT_UINT32, BASE_DEC, NULL, 0x0,
  966. "A count of the number of messages broadcast by all processors "
  967. "during the previous rotation of the token"
  968. "[1]",
  969. HFILL }},
  970. { &hf_corosync_totemknet_orf_token_retrans_flg,
  971. { "Retransmission flag", "corosync_totemknet.orf_token.retrans_flg",
  972. FT_INT32, BASE_DEC, NULL, 0x0,
  973. NULL, HFILL }},
  974. { &hf_corosync_totemknet_orf_token_rtr_list_entries,
  975. { "The number of retransmission list entries", "corosync_totemknet.orf_token.rtr_list_entries",
  976. FT_INT32, BASE_DEC, NULL, 0x0,
  977. NULL, HFILL }},
  978. /* memb_ring_id */
  979. { &hf_corosync_totemknet_memb_ring_id,
  980. { "Member ring id", "corosync_totemknet.memb_ring_id",
  981. FT_NONE, BASE_NONE, NULL, 0x0,
  982. NULL, HFILL }},
  983. { &hf_corosync_totemknet_memb_ring_id_seq,
  984. { "Sequence in member ring id", "corosync_totemknet.memb_ring_id.seq",
  985. FT_UINT64, BASE_DEC, NULL, 0x0,
  986. NULL, HFILL }},
  987. { &hf_corosync_totemknet_memb_ring_id_rep,
  988. { "Sequence in member ring id", "corosync_totemknet.memb_ring_id.rep",
  989. FT_UINT32, BASE_DEC, NULL, 0x0,
  990. NULL, HFILL }},
  991. /* mcast */
  992. { &hf_corosync_totemknet_mcast,
  993. { "ring ordered multicast message", "corosync_totemknet.mcast",
  994. FT_NONE, BASE_NONE, NULL, 0x0,
  995. NULL, HFILL }},
  996. { &hf_corosync_totemknet_mcast_seq,
  997. {"Multicast sequence number", "corosync_totemknet.mcast.seq",
  998. FT_UINT32, BASE_DEC, NULL, 0x0,
  999. NULL, HFILL }},
  1000. { &hf_corosync_totemknet_mcast_this_seqno,
  1001. {"This Sequence number", "corosync_totemknet.mcast.this_seqno",
  1002. FT_INT32, BASE_DEC, NULL, 0x0,
  1003. NULL, HFILL }},
  1004. { &hf_corosync_totemknet_mcast_node_id,
  1005. {"Node id(unused?)", "corosync_totemknet.mcast.node_id",
  1006. FT_UINT32, BASE_DEC, NULL, 0x0,
  1007. NULL, HFILL }},
  1008. { &hf_corosync_totemknet_mcast_system_from,
  1009. {"System from nodeid", "corosync_totemknet.mcast.system_from",
  1010. FT_UINT32, BASE_DEC, NULL, 0x0,
  1011. NULL, HFILL }},
  1012. { &hf_corosync_totemknet_mcast_guarantee,
  1013. {"Guarantee", "corosync_totemknet.mcast.guarantee",
  1014. FT_INT32, BASE_DEC, NULL, 0x0,
  1015. NULL, HFILL }},
  1016. /* memb_merge_detect */
  1017. { &hf_corosync_totemknet_memb_merge_detect,
  1018. { "Merge rings if there are available rings", "corosync_totemknet.memb_merge_detect",
  1019. FT_NONE, BASE_NONE, NULL, 0x0,
  1020. NULL, HFILL }},
  1021. { &hf_corosync_totemknet_memb_merge_detect_system_from,
  1022. {"System from nodeid", "corosync_totemknet.memb_merge_detect.system_from",
  1023. FT_UINT32, BASE_DEC, NULL, 0x0,
  1024. NULL, HFILL }},
  1025. /* srp_addr */
  1026. { &hf_corosync_totemknet_srp_addr,
  1027. {"Single Ring Protocol Address", "corosync_totemknet.srp_addr",
  1028. FT_UINT32, BASE_DEC, NULL, 0x0,
  1029. NULL, HFILL }},
  1030. /* rtr_item */
  1031. { &hf_corosync_totemknet_rtr_item,
  1032. {"Retransmission Item", "corosync_totemknet.rtr_item",
  1033. FT_NONE, BASE_NONE, NULL, 0x0,
  1034. NULL, HFILL }},
  1035. { &hf_corosync_totemknet_rtr_item_seq,
  1036. {"Sequence of Retransmission Item", "corosync_totemknet.rtr_item.seq",
  1037. FT_UINT32, BASE_DEC, NULL, 0x0,
  1038. NULL, HFILL }},
  1039. /* memb_join */
  1040. { &hf_corosync_totemknet_memb_join,
  1041. {"Membership join message", "corosync_totemknet.memb_join",
  1042. FT_NONE, BASE_NONE, NULL, 0x0,
  1043. NULL, HFILL}},
  1044. { &hf_corosync_totemknet_memb_join_system_from,
  1045. {"System from address", "corosync_totemknet.memb_join.system_from",
  1046. FT_UINT32, BASE_DEC, NULL, 0x0,
  1047. NULL, HFILL }},
  1048. { &hf_corosync_totemknet_memb_join_proc_list_entries,
  1049. {"The number of processor list entries", "corosync_totemknet.memb_join.proc_list_entries",
  1050. FT_UINT32, BASE_DEC, NULL, 0x0,
  1051. NULL, HFILL}},
  1052. { &hf_corosync_totemknet_memb_join_proc_list_entry,
  1053. {"Processor node", "corosync_totemknet.memb_join.proc_list_entry",
  1054. FT_UINT32, BASE_DEC, NULL, 0x0,
  1055. NULL, HFILL}},
  1056. { &hf_corosync_totemknet_memb_join_failed_list_entries,
  1057. {"The number of failed list entries", "corosync_totemknet.memb_join.failed_list_entries",
  1058. FT_UINT32, BASE_DEC, NULL, 0x0,
  1059. NULL, HFILL}},
  1060. { &hf_corosync_totemknet_memb_join_failed_list_entry,
  1061. {"Failed node", "corosync_totemknet.memb_join.failed_list_entry",
  1062. FT_UINT32, BASE_DEC, NULL, 0x0,
  1063. NULL, HFILL}},
  1064. { &hf_corosync_totemknet_memb_join_ring_seq,
  1065. {"Ring sequence number", "corosync_totemknet.memb_join.ring_seq",
  1066. FT_UINT64, BASE_DEC, NULL, 0x0,
  1067. NULL, HFILL}},
  1068. /* memb_commit_token */
  1069. { &hf_corosync_totemknet_memb_commit_token,
  1070. {"Membership commit token", "corosync_totemknet.memb_commit_token",
  1071. FT_NONE, BASE_NONE, NULL, 0x0,
  1072. NULL, HFILL}},
  1073. { &hf_corosync_totemknet_memb_commit_token_token_seq,
  1074. {"Token sequence", "corosync_totemknet.memb_commit_token.token_seq",
  1075. FT_UINT32, BASE_DEC, NULL, 0x0,
  1076. NULL, HFILL}},
  1077. { &hf_corosync_totemknet_memb_commit_token_retrans_flg,
  1078. {"Retransmission flag", "corosync_totemknet.memb_commit_token.retrans_flg",
  1079. FT_UINT32, BASE_DEC, NULL, 0x0,
  1080. NULL, HFILL}},
  1081. { &hf_corosync_totemknet_memb_commit_token_memb_index,
  1082. {"Member index", "corosync_totemknet.memb_commit_token.memb_index",
  1083. FT_INT32, BASE_DEC, NULL, 0x0,
  1084. NULL, HFILL}},
  1085. { &hf_corosync_totemknet_memb_commit_token_addr_entries,
  1086. {"The number of address entries", "corosync_totemknet.memb_commit_token.addr_entries",
  1087. FT_INT32, BASE_DEC, NULL, 0x0,
  1088. NULL, HFILL}},
  1089. { &hf_corosync_totemknet_memb_commit_token_addr,
  1090. {"Commit token address", "corosync_totemknet.memb_commit_token.addr",
  1091. FT_INT32, BASE_DEC, NULL, 0x0,
  1092. NULL, HFILL}},
  1093. /* memb_commit_token_memb_entry */
  1094. { &hf_corosync_totemknet_memb_commit_token_memb_entry,
  1095. { "Membership entry", "corosync_totemknet.memb_commit_token_memb_entry",
  1096. FT_NONE, BASE_NONE, NULL, 0x0,
  1097. NULL, HFILL}},
  1098. { &hf_corosync_totemknet_memb_commit_token_memb_entry_aru,
  1099. {"Sequence number all received up to", "corosync_totemknet.memb_commit_token_memb_entry.aru",
  1100. FT_UINT32, BASE_DEC, NULL, 0x0,
  1101. NULL, HFILL}},
  1102. { &hf_corosync_totemknet_memb_commit_token_memb_entry_high_delivered,
  1103. {"High delivered", "corosync_totemknet.memb_commit_token_memb_entry.high_delivered",
  1104. FT_UINT32, BASE_DEC, NULL, 0x0,
  1105. NULL, HFILL}},
  1106. { &hf_corosync_totemknet_memb_commit_token_memb_entry_received_flg,
  1107. {"Received flag", "corosync_totemknet.memb_commit_token_memb_entry.received_flg",
  1108. FT_UINT32, BASE_DEC, NULL, 0x0,
  1109. NULL, HFILL}},
  1110. /* token_hold_cancel */
  1111. { &hf_corosync_totemknet_token_hold_cancel,
  1112. {"Hold cancel token", "corosync_totemknet.token_hold_cancel",
  1113. FT_NONE, BASE_NONE, NULL, 0x0,
  1114. NULL, HFILL}},
  1115. /* totempg */
  1116. { &hf_corosync_totemknet_totempg,
  1117. {"TotemPG message", "corosync_totemknet.totempg",
  1118. FT_NONE, BASE_NONE, NULL, 0x0,
  1119. NULL, HFILL}},
  1120. { &hf_corosync_totemknet_totempg_mcast_header_version,
  1121. {"TotemPG header version", "corosync_totemknet.totempg.header.version",
  1122. FT_UINT16, BASE_DEC, NULL, 0x0,
  1123. NULL, HFILL}},
  1124. { &hf_corosync_totemknet_totempg_mcast_header_type,
  1125. {"TotemPG header type", "corosync_totemknet.totempg.header.type",
  1126. FT_UINT16, BASE_DEC, NULL, 0x0,
  1127. NULL, HFILL}},
  1128. { &hf_corosync_totemknet_totempg_mcast_fragmented,
  1129. {"TotemPG is fragmented", "corosync_totemknet.totempg.fragmented",
  1130. FT_UINT8, BASE_DEC, NULL, 0x0,
  1131. NULL, HFILL}},
  1132. { &hf_corosync_totemknet_totempg_mcast_continuation,
  1133. {"TotemPG is continuation", "corosync_totemknet.totempg.continuation",
  1134. FT_UINT8, BASE_DEC, NULL, 0x0,
  1135. NULL, HFILL}},
  1136. { &hf_corosync_totemknet_totempg_mcast_msg_count,
  1137. {"TotemPG message count", "corosync_totemknet.totempg.msg_count",
  1138. FT_UINT16, BASE_DEC, NULL, 0x0,
  1139. NULL, HFILL}},
  1140. { &hf_corosync_totemknet_totempg_mcast_msg_len,
  1141. {"TotemPG message length", "corosync_totemknet.totempg.msg_len",
  1142. FT_UINT16, BASE_DEC, NULL, 0x0,
  1143. NULL, HFILL}},
  1144. { &hf_corosync_totemknet_totempg_mcast_group_cnt,
  1145. {"TotemPG group count", "corosync_totemknet.totempg.group_cnt",
  1146. FT_UINT16, BASE_DEC, NULL, 0x0,
  1147. NULL, HFILL}},
  1148. { &hf_corosync_totemknet_totempg_mcast_group_len,
  1149. {"TotemPG group length", "corosync_totemknet.totempg.group_len",
  1150. FT_UINT16, BASE_DEC, NULL, 0x0,
  1151. NULL, HFILL}},
  1152. { &hf_corosync_totemknet_totempg_mcast_message,
  1153. {"TotemPG unknown data", "corosync_totemknet.totempg.message",
  1154. FT_NONE, BASE_NONE, NULL, 0x0,
  1155. NULL, HFILL}},
  1156. /* CPG ipc_header */
  1157. { &hf_corosync_totemknet_cpg,
  1158. {"Closed Process Groups message", "corosync_totemknet.cpg",
  1159. FT_NONE, BASE_NONE, NULL, 0x0,
  1160. NULL, HFILL}},
  1161. { &hf_corosync_totemknet_cpg_ipc_header_id_service,
  1162. {"CPG header ID service", "corosync_totemknet.cpg.header.id.service",
  1163. FT_UINT16, BASE_DEC, NULL, 0x0,
  1164. NULL, HFILL}},
  1165. { &hf_corosync_totemknet_cpg_ipc_header_id_message,
  1166. {"CPG header ID message", "corosync_totemknet.cpg.header.id.message",
  1167. FT_UINT16, BASE_DEC, VALS(cpg_msg_names), 0x0,
  1168. NULL, HFILL}},
  1169. { &hf_corosync_totemknet_cpg_ipc_header_size,
  1170. {"CPG header size", "corosync_totemknet.cpg.header.size",
  1171. FT_UINT32, BASE_DEC, NULL, 0x0,
  1172. NULL, HFILL}},
  1173. { &hf_corosync_totemknet_cpg_ipc_header_error,
  1174. {"CPG header error", "corosync_totemknet.cpg.header.error",
  1175. FT_UINT32, BASE_DEC, NULL, 0x0,
  1176. NULL, HFILL}},
  1177. { &hf_corosync_totemknet_cpg_name,
  1178. {"CPG group name", "corosync_totemknet.cpg.name",
  1179. FT_NONE, BASE_NONE, NULL, 0x0,
  1180. NULL, HFILL}},
  1181. { &hf_corosync_totemknet_cpg_name_name,
  1182. {"CPG name", "corosync_totemknet.cpg.name.name.name",
  1183. FT_STRING, BASE_NONE, NULL, 0x0,
  1184. NULL, HFILL}},
  1185. { &hf_corosync_totemknet_cpg_name_len,
  1186. {"CPG name length", "corosync_totemknet.cpg.name.len",
  1187. FT_UINT32, BASE_DEC, NULL, 0x0,
  1188. NULL, HFILL}},
  1189. { &hf_corosync_totemknet_cpg_procjoin_pid,
  1190. {"PID", "corosync_totemknet.cpg.procjoin.pid",
  1191. FT_UINT32, BASE_DEC, NULL, 0x0,
  1192. NULL, HFILL}},
  1193. { &hf_corosync_totemknet_cpg_procjoin_reason,
  1194. {"Join/leave reason", "corosync_totemknet.cpg.procjoin.reason",
  1195. FT_UINT32, BASE_DEC, NULL, 0x0,
  1196. NULL, HFILL}},
  1197. { &hf_corosync_totemknet_cpg_mcast_msglen,
  1198. {"mcast message length", "corosync_totemknet.cpg.mcast.msg_len",
  1199. FT_UINT32, BASE_DEC, NULL, 0x0,
  1200. NULL, HFILL}},
  1201. { &hf_corosync_totemknet_cpg_mcast_pid,
  1202. {"PID", "corosync_totemknet.cpg.mcast.pid",
  1203. FT_UINT32, BASE_DEC, NULL, 0x0,
  1204. NULL, HFILL}},
  1205. { &hf_corosync_totemknet_cpg_mcast_source_nodeid,
  1206. {"Source Nodeid", "corosync_totemknet.cpg.mcast.source_nodeid",
  1207. FT_UINT32, BASE_DEC, NULL, 0x0,
  1208. NULL, HFILL}},
  1209. { &hf_corosync_totemknet_cpg_mcast_source_conn,
  1210. {"Source con ID", "corosync_totemknet.cpg.mcast.source_con",
  1211. FT_UINT64, BASE_HEX, NULL, 0x0,
  1212. NULL, HFILL}},
  1213. { &hf_corosync_totemknet_cpg_mcast_message,
  1214. {"Message", "corosync_totemknet.cpg.mcast.message",
  1215. FT_NONE, BASE_NONE, NULL, 0x0,
  1216. NULL, HFILL}},
  1217. { &hf_corosync_totemknet_cpg_dlistold_left,
  1218. {"Num of lefet nodes", "corosync_totemknet.cpg.dlist_old.left_nodes",
  1219. FT_UINT32, BASE_DEC, NULL, 0x0,
  1220. NULL, HFILL}},
  1221. { &hf_corosync_totemknet_cpg_dlistold_node,
  1222. {"Node ID", "corosync_totemknet.cpg.dlist_old.node",
  1223. FT_UINT32, BASE_DEC, NULL, 0x0,
  1224. NULL, HFILL}},
  1225. { &hf_corosync_totemknet_cpg_pmcast_msglen,
  1226. {"Message len", "corosync_totemknet.cpg.pmcast.msglen",
  1227. FT_UINT32, BASE_DEC, NULL, 0x0,
  1228. NULL, HFILL}},
  1229. { &hf_corosync_totemknet_cpg_pmcast_fraglen,
  1230. {"Fragment len", "corosync_totemknet.cpg.pmcast.fraglen",
  1231. FT_UINT32, BASE_DEC, NULL, 0x0,
  1232. NULL, HFILL}},
  1233. { &hf_corosync_totemknet_cpg_pmcast_pid,
  1234. {"PID", "corosync_totemknet.cpg.pmcast.pid",
  1235. FT_UINT32, BASE_DEC, NULL, 0x0,
  1236. NULL, HFILL}},
  1237. { &hf_corosync_totemknet_cpg_pmcast_type,
  1238. {"Type", "corosync_totemknet.cpg.pmcast.type",
  1239. FT_UINT32, BASE_DEC, NULL, 0x0,
  1240. NULL, HFILL}},
  1241. { &hf_corosync_totemknet_cpg_pmcast_message,
  1242. {"Message", "corosync_totemknet.cpg.pmcast.message",
  1243. FT_NONE, BASE_NONE, NULL, 0x0,
  1244. NULL, HFILL}},
  1245. };
  1246. static int *ett[] = {
  1247. &ett_corosync_totemknet,
  1248. &ett_corosync_totemknet_orf_token,
  1249. &ett_corosync_totemknet_memb_ring_id,
  1250. &ett_corosync_totemknet_ip_address,
  1251. &ett_corosync_totemknet_mcast,
  1252. &ett_corosync_totemknet_memb_merge_detect,
  1253. &ett_corosync_totemknet_srp_addr,
  1254. &ett_corosync_totemknet_rtr_item,
  1255. &ett_corosync_totemknet_memb_join,
  1256. &ett_corosync_totemknet_memb_commit_token,
  1257. &ett_corosync_totemknet_memb_commit_token_memb_entry,
  1258. &ett_corosync_totemknet_token_hold_cancel,
  1259. &ett_corosync_totemknet_memb_join_proc_list,
  1260. &ett_corosync_totemknet_memb_join_failed_list
  1261. };
  1262. proto_corosync_totemknet = proto_register_protocol("Totem Single Ring Protocol implemented in Corosync Cluster Engine 3",
  1263. "COROSYNC/TOTEMKNET", "corosync_totemknet");
  1264. proto_register_field_array(proto_corosync_totemknet, hf, array_length(hf));
  1265. proto_register_subtree_array(ett, array_length(ett));
  1266. heur_subdissector_list = register_heur_dissector_list_with_description("corosync_totemknet.mcast", "COROSYNC/TOTEMKNET multicast data", proto_corosync_totemknet);
  1267. totemknet_handle = register_dissector( "corosync_totemknet", dissect_corosync_totemknet, proto_corosync_totemknet);
  1268. }
  1269. void
  1270. proto_reg_handoff_corosync_totemknet(void)
  1271. {
  1272. dissector_add_uint_with_preference("udp.port", 5405, totemknet_handle);
  1273. /* Nothing to be done.
  1274. dissect_corosync_totemknet is directly called from kronsnet dissector. */
  1275. }
  1276. WS_DLL_PUBLIC_DEF void plugin_register(void)
  1277. {
  1278. static proto_plugin plug_corosync_totemknet;
  1279. plug_corosync_totemknet.register_protoinfo = proto_register_corosync_totemknet;
  1280. plug_corosync_totemknet.register_handoff = proto_reg_handoff_corosync_totemknet;
  1281. proto_register_plugin(&plug_corosync_totemknet);
  1282. }
  1283. /*
  1284. * Editor modelines - https://www.wireshark.org/tools/modelines.html
  1285. *
  1286. * Local variables:
  1287. * c-basic-offset: 2
  1288. * tab-width: 8
  1289. * indent-tabs-mode: nil
  1290. * End:
  1291. *
  1292. * vi: set shiftwidth=2 tabstop=8 expandtab:
  1293. * :indentSize=2:tabSize=8:noTabs=true:
  1294. */