2 * Routines for sasp packet dissection
3 * Copyright 2010, Venkateshwaran Dorai<venkateshwaran.d@gmail.com>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <epan/packet.h>
31 #include <epan/expert.h>
32 #include "packet-tcp.h"
33 #include <epan/prefs.h>
36 /* forward reference */
38 static void dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
39 static void dissect_reg_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
40 static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
41 static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
42 static void dissect_dereg_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
43 static void dissect_sendwt(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
44 static void dissect_setmemstate_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
45 static void dissect_setmemstate_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
46 static void dissect_setlbstate_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
47 static void dissect_setlbstate_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
48 static void dissect_wt_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
49 static void dissect_wt_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
50 static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, proto_tree **mdct_p);
51 static guint32 dissect_grpdatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
52 static guint32 dissect_grp_memdatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
53 static guint32 dissect_grp_memstatedatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
54 static guint32 dissect_memstatedatacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
55 static guint32 dissect_weight_entry_data_comp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset);
56 static guint32 dissect_grp_wt_entry_datacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset);
61 /* Initialize the protocol and registered fields */
63 static int proto_sasp = -1;
64 static int hf_sasp_type = -1;
65 static int hf_sasp_length = -1;
66 static int hf_sasp_vrsn = -1;
67 static int hf_msg_len = -1;
68 static int hf_msg_id = -1;
70 static int hf_msg_type = -1;
74 static int hf_sasp_reg_rep_rcode = -1;
75 static int hf_sasp_reg_rep_sz = -1;
78 static int hf_sasp_reg_req_sz = -1;
79 static int hf_reg_req_lbflag = -1;
80 static int hf_sasp_gmd_cnt = -1;
83 static int hf_sasp_dereg_req_sz = -1;
84 static int hf_dereg_req_lbflag = -1;
85 /* static int hf_dereg_req_reason = -1; */
86 static int hf_dereg_req_reason_flag = -1;
89 static int hf_sasp_dereg_rep_rcode = -1;
90 static int hf_sasp_dereg_rep_sz = -1;
93 static int hf_sasp_sendwt_gwedcnt = -1;
94 static int hf_sasp_sendwt_sz = -1;
97 static int hf_sasp_setmemstate_req_sz = -1;
98 static int hf_setmemstate_req_lbflag = -1;
99 /*static int hf_sasp_setmemstate_req_data = -1;*/
100 static int hf_sasp_setmemstate_req_gmsd_cnt = -1;
102 /*setmemstate reply*/
103 /* static int hf_sasp_setmemstate_rep = -1; */
104 static int hf_sasp_setmemstate_rep_rcode = -1;
105 static int hf_sasp_setmemstate_rep_sz = -1;
108 static int hf_sasp_memdatacomp_type = -1;
109 static int hf_sasp_memdatacomp_sz = -1;
110 static int hf_sasp_memdatacomp_protocol = -1;
111 static int hf_sasp_memdatacomp_port = -1;
112 static int hf_sasp_memdatacomp_ip = -1;
113 static int hf_sasp_memdatacomp_lab_len = -1;
114 static int hf_sasp_memdatacomp_label = -1;
117 static int hf_sasp_grpdatacomp = -1;
118 static int hf_sasp_grpdatacomp_sz = -1;
119 static int hf_sasp_grpdatacomp_LB_uid_len = -1;
120 static int hf_sasp_grpdatacomp_LB_uid = -1;
121 static int hf_sasp_grpdatacomp_grp_name_len = -1;
122 static int hf_sasp_grpdatacomp_grp_name = -1;
124 /*grp mem data comp */
125 static int hf_sasp_grp_memdatacomp = -1;
126 static int hf_sasp_grp_memdatacomp_sz = -1;
127 static int hf_sasp_grp_memdatacomp_cnt = -1;
130 static int hf_sasp_wt_req_sz = -1;
131 static int hf_sasp_wt_req_gd_cnt = -1;
134 static int hf_sasp_wt_rep_sz = -1;
135 static int hf_sasp_wt_rep_rcode = -1;
136 static int hf_sasp_wt_rep_interval = -1;
137 static int hf_sasp_wt_rep_gwed_cnt = -1;
140 static int hf_sasp_setlbstate_req_sz = -1;
141 static int hf_sasp_setlbstate_req_LB_uid_len = -1;
142 static int hf_sasp_setlbstate_req_LB_uid = -1;
143 static int hf_sasp_setlbstate_req_LB_health = -1;
144 /*static int hf_sasp_setlbstate_req_LB_flag = -1;*/
145 /* static int hf_lbstate_flag = -1; */
146 static int hf_sasp_pushflag = -1;
147 static int hf_sasp_trustflag = -1;
148 static int hf_sasp_nochangeflag = -1;
151 /* static int hf_sasp_setlbstate_rep = -1; */
152 static int hf_sasp_setlbstate_rep_rcode = -1;
153 static int hf_sasp_setlbstate_rep_sz = -1;
155 /*grp mem state data*/
156 static int hf_sasp_grp_memstatedatacomp = -1;
157 static int hf_sasp_grp_memstatedatacomp_sz = -1;
158 static int hf_sasp_grp_memstatedatacomp_cnt = -1;
160 /*mem state data comp*/
161 static int hf_sasp_memstatedatacomp_instance = -1;
162 static int hf_sasp_memstatedatacomp_sz = -1;
163 static int hf_sasp_memstatedatacomp_state = -1;
164 static int hf_sasp_memstatedatacomp_quiesce_flag = -1;
166 /*wt entry dat comp*/
167 static int hf_sasp_weight_entry_data_comp_type = -1;
168 static int hf_sasp_weight_entry_data_comp_sz = -1;
169 static int hf_sasp_weight_entry_data_comp_state = -1;
170 /* static int hf_wtstate_flag = -1; */
171 static int hf_sasp_wed_contactsuccess_flag = -1;
172 static int hf_sasp_wed_quiesce_flag = -1;
173 static int hf_sasp_wed_registration_flag = -1;
174 static int hf_sasp_wed_confident_flag = -1;
175 static int hf_sasp_weight_entry_data_comp_weight = -1;
177 /*grp wt entry data comp */
178 static int hf_sasp_grp_wt_entry_datacomp_type = -1;
179 static int hf_sasp_grp_wt_entry_datacomp_sz = -1;
180 static int hf_sasp_grp_wt_entry_datacomp_cnt = -1;
183 /* Initialize the subtree pointers */
184 static gint ett_sasp_data = -1;
185 static gint ett_sasp_header = -1;
186 static gint ett_sasp_msg = -1;
187 static gint ett_sasp_payload = -1;
188 static gint ett_sasp_reg_req = -1;
189 static gint ett_sasp_reg_rep = -1;
190 static gint ett_sasp_reg_req_sz = -1;
191 static gint ett_sasp_dereg_req_sz= -1;
192 static gint ett_sasp_dereg_rep = -1;
193 static gint ett_sasp_sendwt = -1;
194 static gint ett_sasp_setmemstate_rep = -1;
195 static gint ett_sasp_memdatacomp = -1;
196 static gint ett_sasp_grpdatacomp = -1;
197 static gint ett_sasp_grp_memdatacomp = -1;
198 static gint ett_sasp_setlbstate_req = -1;
199 static gint ett_sasp_setlbstate_rep = -1;
200 static gint ett_sasp_getwt= -1;
201 static gint ett_sasp_setmemstate_req = -1;
202 static gint ett_setlbstate_req_lbflag = -1;
203 static gint ett_sasp_grp_memstatedatacomp = -1;
204 static gint ett_sasp_memstatedatacomp = -1;
205 /*static gint ett_dereg_req_reason_flag = -1;*/
206 static gint ett_sasp_grp_wt_entry_datacomp = -1;
207 static gint ett_sasp_weight_entry_data_comp = -1;
208 static gint ett_wt_entry_data_flag = -1;
209 static gint ett_sasp_wt_rep = -1;
211 /* desegmentation of SASP over TCP */
212 static gboolean sasp_desegment = TRUE;
214 static const value_string msg_table[] = {
215 { 0x1010, "Registration Request" },
216 { 0x1015, "Registration Reply"},
217 { 0x1020, "DeRegistration Request"},
218 { 0x1025, "DeRegistration Reply"},
219 { 0x1030, "Get Weights Request"},
220 { 0x1035, "Get Weights Reply" },
221 { 0x1040, "Send Weights"},
222 { 0x1050, "Set LB State Request"},
223 { 0x1055, "Set LB State Reply"},
224 { 0x1060, "Set Member State Request"},
225 { 0x1065, "Set Member State Reply"},
226 { 0x3010, "Member Data Component"},
227 { 0x3011, "Group Data Component"},
228 { 0x3012, "Weight Entry Data Component"},
229 { 0x3013, "Member State Instance"},
230 { 0x4010, "Group of Member Data"},
231 { 0x4011, "Group of Weight Entry Data" },
232 { 0x4012, "Group of Member State Data" },
235 static value_string_ext msg_table_ext = VALUE_STRING_EXT_INIT(msg_table);
237 static const value_string protocol_table[] = {
245 static const value_string lbstate_healthtable[] = {
246 { 0x00, "Least Healthy" },
247 { 0x7f, "Most Healthy" },
252 static const value_string reg_reply_response_code[] = {
253 { 0x00, "Successful" },
254 { 0x10, "Message not understood" },
255 { 0x11, "GWM will not accept this message from the sender" },
256 { 0x40, "Member already registered" },
257 { 0x44, "Duplicate Member in Request" },
258 { 0x45, "Invalid Group (determined by the GWM)"},
259 { 0x50, "Invalid Group Name Size (size == 0)"},
260 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
261 { 0x61, "Member is registering itself, but LB hasn't yet contacted the GWM."
262 " This registration will not be processed."},
266 static const value_string dereg_reply_response_code[] = {
267 { 0x00, "Successful" },
268 { 0x10, "Message not understood" },
269 { 0x11, "GWM will not accept this message from the sender" },
270 { 0x41, "Application or System not registered" },
271 { 0x42, "Unknown Group Name" },
272 { 0x43, "Unknown LB uid" },
273 { 0x44, "Duplicate Member in Request"},
274 { 0x46, "Duplicate Group in Request (for remove all members/groups requests)"},
275 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
276 { 0x61, "Member is deregistering itself, but LB hasn't yet contacted the GWM."
277 " This deregistration will not be processed."},
281 static const value_string get_weights_reply_response_code[] = {
282 { 0x00, "Successful" },
283 { 0x10, "Message not understood" },
284 { 0x11, "GWM will not accept this message from the sender" },
285 { 0x42, "Unknown Group Name" },
286 { 0x43, "Unknown LB uid" },
287 { 0x46, "Duplicate Group in Request"},
288 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
292 static const value_string set_lb_state_reply_response_code[] = {
293 { 0x00, "Successful" },
294 { 0x10, "Message not understood" },
295 { 0x11, "GWM will not accept this message from the sender" },
296 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
300 static const value_string set_mem_state_reply_response_code[] = {
301 { 0x00, "Successful" },
302 { 0x10, "Message not understood" },
303 { 0x11, "GWM will not accept this message from the sender" },
304 { 0x41, "Application or System not registered" },
305 { 0x42, "Unknown Group Name" },
306 { 0x43, "Unknown LB uid" },
307 { 0x44, "Duplicate Member in Request"},
308 { 0x46, "Duplicate Group in Request (for remove all members/groups requests)"},
309 { 0x50, "Invalid Group Name Size (size == 0)"},
310 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
315 #define SASP_GLOBAL_PORT 3860
316 #define SASP_MIN_PACKET_LEN 13
318 #define SASP_DEREG_REQ_REASON_LEARNED 0x01
319 #define SASP_DEREG_REQ_NOREASON_FLAG 0x00
320 #define SASP_HDR_TYPE 0x2010
321 #define SASP_WED_CONTACT_SUCCESS_FLAG 0x01
322 #define SASP_WED_QUIESCE_FLAG 0x02
323 #define SASP_WED_REG_FLAG 0x04
324 #define SASP_WED_CONF_FLAG 0x08
325 #define SASP_PUSH_FLAG 0x01
326 #define SASP_TRUST_FLAG 0x02
327 #define SASP_NOCHANGE_FLAG 0x04
328 #define SASP_QUIESCE_FLAG 0x01
334 get_sasp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
339 * Get the length of the SASP packet.
341 plen = tvb_get_ntohl(tvb, offset + 5);
349 dissect_sasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
351 tcp_dissect_pdus(tvb, pinfo, tree, sasp_desegment, SASP_MIN_PACKET_LEN, get_sasp_pdu_len,
352 (dissector_t)dissect_sasp_pdu);
358 /* Called from tcp_dissect_pdus with a complete SASP pdu */
360 dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
362 /* Set up structures needed to add the protocol subtree and manage it */
366 proto_tree *sasp_tree;
367 proto_tree *msg_tree;
368 proto_tree *pay_load;
375 /*protocol is being displayed*/
377 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SASP");
378 col_clear(pinfo->cinfo, COL_INFO);
380 ti = proto_tree_add_item(tree, proto_sasp, tvb, offset, -1, ENC_NA);
381 sasp_tree = proto_item_add_subtree(ti, ett_sasp_header);
383 hdr_type = tvb_get_ntohs(tvb, offset);
384 hti = proto_tree_add_uint_format(sasp_tree, hf_sasp_type, tvb, offset, 2, hdr_type,
385 "Type: %s", (hdr_type == SASP_HDR_TYPE) ? "SASP" : "[Invalid]");
386 if (hdr_type != SASP_HDR_TYPE) {
387 expert_add_info_format(pinfo, hti, PI_MALFORMED, PI_ERROR,
388 "Invalid SASP Header Type [0x%04x]", hdr_type);
389 /* XXX: The folowing should actually happen automatically ? */
390 col_set_str(pinfo->cinfo, COL_INFO, "[Malformed: Invalid SASP Header Type]");
396 proto_tree_add_item(sasp_tree, hf_sasp_length, tvb, offset, 2, ENC_BIG_ENDIAN);
400 proto_tree_add_item(sasp_tree, hf_sasp_vrsn, tvb, offset, 1, ENC_BIG_ENDIAN);
404 msg_tree = proto_item_add_subtree(ti, ett_sasp_msg);
407 proto_tree_add_item(msg_tree, hf_msg_len, tvb, offset, 4, ENC_BIG_ENDIAN);
411 proto_tree_add_item(msg_tree, hf_msg_id, tvb, offset, 4, ENC_BIG_ENDIAN);
415 msg_type = tvb_get_ntohs(tvb, offset);
416 mti = proto_tree_add_item(msg_tree, hf_msg_type, tvb, offset, 2, ENC_BIG_ENDIAN);
417 pay_load = proto_item_add_subtree(ti, ett_sasp_payload);
425 /* Registration Request */
426 col_set_str(pinfo->cinfo, COL_INFO, "Registration Request");
427 dissect_reg_req(tvb, pay_load, offset);
432 /* Registration Reply */
433 col_set_str(pinfo->cinfo, COL_INFO, "Registration Reply");
434 dissect_reg_rep(tvb, pay_load, offset);
439 /* Deregistration Request */
440 col_set_str(pinfo->cinfo, COL_INFO, "Deregistration Request");
441 dissect_dereg_req(tvb, pay_load, offset);
446 /* Deregistration Reply */
447 col_set_str(pinfo->cinfo, COL_INFO, "Deregistration Reply");
448 dissect_dereg_rep(tvb, pay_load, offset);
453 /* Get Weights Request */
454 col_set_str(pinfo->cinfo, COL_INFO, "Get Weights Request");
455 dissect_wt_req(tvb, pay_load, offset);
460 /* Get Weights Response */
461 col_set_str(pinfo->cinfo, COL_INFO, "Get Weights Response");
462 dissect_wt_rep(tvb, pay_load, offset);
467 /* Send Weights Request */
468 col_set_str(pinfo->cinfo, COL_INFO, "Send Weights Request");
469 dissect_sendwt(tvb, pay_load, offset);
474 /* Set LB State Request */
475 col_set_str(pinfo->cinfo, COL_INFO, "Set LB State Request");
476 dissect_setlbstate_req(tvb, pay_load, offset);
481 /* Set LB state Reply */
482 col_set_str(pinfo->cinfo, COL_INFO, "Set LB State Reply");
483 dissect_setlbstate_rep(tvb, pay_load, offset);
488 /* Set Member State Request*/
489 col_set_str(pinfo->cinfo, COL_INFO, "Set Member State Request");
490 dissect_setmemstate_req(tvb, pay_load, offset);
495 /* Set Member State Reply */
496 col_set_str(pinfo->cinfo, COL_INFO, "Set Member State Reply");
497 dissect_setmemstate_rep(tvb, pay_load, offset);
502 /* Unknown SASP Message Type */
503 col_add_fstr(pinfo->cinfo, COL_INFO,
504 "[Malformed: Unknown Message Type [0x%04x]", msg_type);
505 expert_add_info_format(pinfo, mti, PI_MALFORMED, PI_WARN,
506 "Unknown SASP Message Type: 0x%4x", msg_type);
513 static void dissect_reg_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
516 proto_item *reg_tree;
517 proto_tree *reg_req_data;
522 reg_tree = proto_tree_add_text(pay_load, tvb, offset, -1, "Reg Request");
523 reg_req_data = proto_item_add_subtree(reg_tree, ett_sasp_reg_req_sz);
526 proto_tree_add_item(reg_req_data, hf_sasp_reg_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
529 /* Reg Req LB Flag */
530 proto_tree_add_item(reg_req_data, hf_reg_req_lbflag, tvb, offset, 1, ENC_BIG_ENDIAN);
533 gmd_cnt = tvb_get_ntohs(tvb, offset);
535 /* Group MEM Data Count */
536 proto_tree_add_item(reg_req_data, hf_sasp_gmd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
539 for ( i=0; i<gmd_cnt; i++)
541 offset = dissect_grp_memdatacomp(tvb, reg_req_data, offset);
548 static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
552 proto_tree *reg_rep_tree;
554 reg_rep = proto_tree_add_text(pay_load, tvb, offset, -1 , "Reg Reply");
555 reg_rep_tree = proto_item_add_subtree(reg_rep, ett_sasp_reg_rep);
558 proto_tree_add_item(reg_rep_tree, hf_sasp_reg_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
562 proto_tree_add_item(reg_rep_tree, hf_sasp_reg_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN);
569 static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
572 /*proto_item *dereg_req_reason_flag;*/
573 /*proto_tree *dereg_req_reason_flag_tree;*/
576 proto_item *dereg_tree;
577 proto_tree *dereg_req_data;
580 gboolean first_flag = TRUE;
583 emem_strbuf_t *reasonflags_strbuf = ep_strbuf_new_label("");
584 const gchar *fstr[] = {"No Reason", "Learned & Purposeful" };
587 dereg_tree = proto_tree_add_text(pay_load, tvb, offset, -1 , "DeReg Request");
588 dereg_req_data = proto_item_add_subtree(dereg_tree, ett_sasp_dereg_req_sz);
591 proto_tree_add_item(dereg_req_data, hf_sasp_dereg_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
595 proto_tree_add_item(dereg_req_data, hf_dereg_req_lbflag, tvb, offset, 1, ENC_BIG_ENDIAN);
599 ep_strbuf_truncate(reasonflags_strbuf, 0);
600 reason_flag = tvb_get_guint8(tvb, offset);
602 if ((reason_flag & SASP_DEREG_REQ_REASON_LEARNED) == 0)
604 ep_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[0]);
609 ep_strbuf_append_printf(reasonflags_strbuf, "%s%s", first_flag ? "" : ", ", fstr[1]);
614 /*dereg_req_reason_flag =*/ proto_tree_add_uint_format(dereg_req_data, hf_dereg_req_reason_flag, tvb,
615 offset, 1, reason_flag,
616 "Reason: 0x%02x (%s)", reason_flag,
617 reasonflags_strbuf->str);
618 #if 0 /* XXX: ToDo?? Flags to be displayed under a subtree ? */
619 dereg_req_reason_flag_tree = proto_item_add_subtree(dereg_req_reason_flag, ett_dereg_req_reason_flag);
625 gmd_cnt = tvb_get_ntohs(tvb, offset);
627 /* Group Mem Data Count */
628 proto_tree_add_item(dereg_req_data, hf_sasp_gmd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
632 for ( i=0; i<gmd_cnt; i++)
634 offset = dissect_grp_memdatacomp(tvb, dereg_req_data, offset);
641 static void dissect_dereg_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
644 proto_item *dereg_rep;
645 proto_tree *dereg_rep_tree;
647 dereg_rep = proto_tree_add_text(pay_load, tvb, offset, -1 , "Dereg Reply");
648 dereg_rep_tree = proto_item_add_subtree(dereg_rep, ett_sasp_dereg_rep);
651 proto_tree_add_item(dereg_rep_tree, hf_sasp_dereg_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
655 proto_tree_add_item(dereg_rep_tree, hf_sasp_dereg_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN);
661 static void dissect_sendwt(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
665 proto_tree *sendwt_tree;
669 sendwt = proto_tree_add_text(pay_load, tvb, offset, -1 , "Send Weight");
670 sendwt_tree = proto_item_add_subtree(sendwt, ett_sasp_sendwt);
673 proto_tree_add_item(sendwt_tree, hf_sasp_sendwt_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
676 gwed_cnt = tvb_get_ntohs(tvb, offset);
678 /* Group Wt Entry Data Count */
679 proto_tree_add_item(sendwt_tree, hf_sasp_sendwt_gwedcnt, tvb, offset, 2, ENC_BIG_ENDIAN);
682 for (i=0; i<gwed_cnt; i++)
684 offset = dissect_grp_wt_entry_datacomp(tvb, sendwt_tree, offset);
691 static void dissect_setmemstate_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
694 proto_item *setmemstate;
695 proto_tree *setmemstate_req_data;
699 setmemstate = proto_tree_add_text(pay_load, tvb, offset, -1 , "Set Mem State Request");
700 setmemstate_req_data = proto_item_add_subtree(setmemstate, ett_sasp_setmemstate_req);
703 proto_tree_add_item(setmemstate_req_data, hf_sasp_setmemstate_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
707 proto_tree_add_item(setmemstate_req_data, hf_setmemstate_req_lbflag, tvb, offset, 1, ENC_BIG_ENDIAN);
711 gmsd_cnt = tvb_get_ntohs(tvb, offset);
712 proto_tree_add_item(setmemstate_req_data, hf_sasp_setmemstate_req_gmsd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
715 for ( i=0; i<gmsd_cnt; i++)
717 offset = dissect_grp_memstatedatacomp(tvb, setmemstate_req_data, offset);
723 static void dissect_setmemstate_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
726 proto_item *setmemstate_rep;
727 proto_tree *setmemstate_rep_tree;
730 setmemstate_rep = proto_tree_add_text(pay_load, tvb, offset, -1 , "Set Mem State Reply");
731 setmemstate_rep_tree = proto_item_add_subtree(setmemstate_rep, ett_sasp_setmemstate_rep);
734 proto_tree_add_item(setmemstate_rep_tree, hf_sasp_setmemstate_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
738 proto_tree_add_item(setmemstate_rep_tree, hf_sasp_setmemstate_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN);
743 static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset, proto_tree **mdct_p)
745 proto_item *memdatacomp;
746 proto_tree *memdatacomp_tree;
749 struct e_in6_addr ipv6_address;
753 tvb_get_ipv6(tvb, offset+7, &ipv6_address);
754 ip_str = ip6_to_str(&ipv6_address);
756 lab_len = tvb_get_guint8(tvb, offset+23);
758 memdatacomp = proto_tree_add_ipv6_format(pay_load, hf_sasp_memdatacomp_ip,
759 tvb, offset, 24+lab_len, (guint8*)&ipv6_address,
760 "Member Data Comp (%s)", ip_str);
762 memdatacomp_tree = proto_item_add_subtree(memdatacomp, ett_sasp_memdatacomp);
766 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_type, tvb, offset, 2, ENC_BIG_ENDIAN);
770 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
774 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
778 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_port, tvb, offset, 2, ENC_BIG_ENDIAN);
782 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_ip, tvb, offset, 16, ENC_NA);
787 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_lab_len, tvb, offset, 1, ENC_BIG_ENDIAN);
791 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_label, tvb, offset, lab_len, ENC_ASCII|ENC_NA);
795 *mdct_p = memdatacomp_tree;
803 static guint32 dissect_grpdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
806 proto_item *grpdatacomp;
807 proto_tree *grpdatacomp_tree;
813 grpdatacomp = proto_tree_add_text(pay_load, tvb, offset, -1 , "Group Data Component");
814 grpdatacomp_tree = proto_item_add_subtree(grpdatacomp, ett_sasp_grpdatacomp);
817 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp, tvb, offset, 2, ENC_BIG_ENDIAN);
821 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
824 LB_uid_len = tvb_get_guint8(tvb, offset);
827 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_LB_uid_len,
828 tvb, offset, 1, ENC_BIG_ENDIAN);
831 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_LB_uid,
832 tvb, offset, LB_uid_len, ENC_ASCII|ENC_NA);
833 offset += (guint8)LB_uid_len;
836 grp_name_len = tvb_get_guint8(tvb, offset);
840 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_grp_name_len,
841 tvb, offset, 1, ENC_BIG_ENDIAN);
845 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_grp_name,
846 tvb, offset, grp_name_len, ENC_ASCII|ENC_NA);
847 offset += grp_name_len;
854 static guint32 dissect_grp_memdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
857 proto_item *grp_memdatacomp;
858 proto_tree *grp_memdatacomp_tree;
863 grp_memdatacomp = proto_tree_add_text(pay_load, tvb, offset, -1 , "Group Of Member Data");
864 grp_memdatacomp_tree = proto_item_add_subtree(grp_memdatacomp, ett_sasp_grp_memdatacomp);
867 proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp, tvb, offset, 2, ENC_BIG_ENDIAN);
870 /* Group MEM Data Size*/
871 proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
874 mem_cnt = tvb_get_ntohs(tvb, offset);
876 /* Group MEM Data Count*/
877 proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
880 offset = dissect_grpdatacomp(tvb, grp_memdatacomp_tree, offset);
882 /* array of memdata */
883 for ( i=0; i<mem_cnt; i++)
885 offset = dissect_memdatacomp(tvb, grp_memdatacomp_tree, offset, NULL);
894 static void dissect_wt_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
897 proto_item *get_wt_data;
898 proto_tree *get_wt_tree;
903 get_wt_data = proto_tree_add_text(pay_load, tvb, offset, -1 , "Get Wt Req");
904 get_wt_tree = proto_item_add_subtree(get_wt_data, ett_sasp_getwt);
907 proto_tree_add_item(get_wt_tree, hf_sasp_wt_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
910 gd_cnt = tvb_get_ntohs(tvb, offset);
912 /* Group Data Count */
913 proto_tree_add_item(get_wt_tree, hf_sasp_wt_req_gd_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
916 for (i=0; i<gd_cnt; i++)
918 offset = dissect_grpdatacomp(tvb, get_wt_tree, offset);
924 static void dissect_wt_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
928 proto_tree *wt_rep_tree;
932 wt_rep = proto_tree_add_text(pay_load, tvb, offset, -1 , "Get Weights Reply");
933 wt_rep_tree = proto_item_add_subtree(wt_rep, ett_sasp_wt_rep);
936 proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
940 proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_rcode, tvb, offset, 1, ENC_BIG_ENDIAN);
944 proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
948 gwed_cnt = tvb_get_ntohs(tvb, offset);
950 /* Count of Group of Wt Entry Data */
951 proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_gwed_cnt, tvb, offset, 2, ENC_BIG_ENDIAN);
955 for (i=0; i<gwed_cnt; i++)
957 offset = dissect_grp_wt_entry_datacomp(tvb, wt_rep_tree, offset);
964 static void dissect_setlbstate_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
969 static const int *lbflags[] = {
972 &hf_sasp_nochangeflag,
977 proto_item *setlbstate_req;
978 proto_tree *setlbstate_req_tree;
980 setlbstate_req = proto_tree_add_text(pay_load, tvb, offset, -1 , "Set LB State Req");
981 setlbstate_req_tree = proto_item_add_subtree(setlbstate_req, ett_sasp_setlbstate_req);
984 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_sz,
985 tvb, offset, 2, ENC_BIG_ENDIAN);
988 LB_uid_len = tvb_get_guint8(tvb, offset);
992 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_uid_len,
993 tvb, offset, 1, ENC_BIG_ENDIAN);
997 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_uid,
998 tvb, offset, LB_uid_len, ENC_ASCII|ENC_NA);
999 offset += (guint8)LB_uid_len;
1002 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_health,
1003 tvb, offset, 1, ENC_BIG_ENDIAN);
1007 proto_tree_add_bitmask_text(setlbstate_req_tree, tvb, offset, 1, "LB Flags:", NULL,
1008 ett_setlbstate_req_lbflag, lbflags, ENC_BIG_ENDIAN, 0);
1018 static void dissect_setlbstate_rep(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
1021 proto_item *setlbstate_rep;
1022 proto_tree *setlbstate_rep_tree;
1024 setlbstate_rep = proto_tree_add_text(pay_load, tvb, offset, -1 , "Set LB State Rep");
1025 setlbstate_rep_tree = proto_item_add_subtree(setlbstate_rep, ett_sasp_setlbstate_rep);
1029 proto_tree_add_item(setlbstate_rep_tree, hf_sasp_setlbstate_rep_sz,
1030 tvb, offset, 2, ENC_BIG_ENDIAN);
1034 proto_tree_add_item(setlbstate_rep_tree, hf_sasp_setlbstate_rep_rcode,
1035 tvb, offset, 1, ENC_BIG_ENDIAN);
1042 static guint32 dissect_grp_memstatedatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
1045 proto_item *grp_memstatedatacomp;
1046 proto_tree *grp_memstatedatacomp_tree;
1051 grp_memstatedatacomp = proto_tree_add_text(pay_load, tvb, offset, -1 , "Group Mem State Comp");
1052 grp_memstatedatacomp_tree = proto_item_add_subtree(grp_memstatedatacomp,
1053 ett_sasp_grp_memstatedatacomp);
1056 proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp,
1057 tvb, offset, 2, ENC_BIG_ENDIAN);
1061 proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp_sz,
1062 tvb, offset, 2, ENC_BIG_ENDIAN);
1065 mem_cnt = tvb_get_ntohs(tvb, offset);
1068 proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp_cnt,
1069 tvb, offset, 2, ENC_BIG_ENDIAN);
1072 /* Group Data TLV */
1073 offset = dissect_grpdatacomp(tvb, grp_memstatedatacomp_tree, offset);
1075 /* Array of Mem State Data */
1076 for (i=0; i<mem_cnt; i++)
1078 offset = dissect_memstatedatacomp(tvb, grp_memstatedatacomp_tree, offset);
1086 static guint32 dissect_memstatedatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
1089 proto_tree *memstatedatacomp_tree;
1090 proto_item *memstatedatacomp;
1091 proto_tree *memdatacomp_tree;
1093 guint8 memstate_flag;
1096 offset = dissect_memdatacomp(tvb, pay_load, offset, &memdatacomp_tree);
1098 memstatedatacomp = proto_tree_add_text(memdatacomp_tree, tvb, offset, -1 , "Member State Data");
1099 memstatedatacomp_tree = proto_item_add_subtree(memstatedatacomp, ett_sasp_memstatedatacomp);
1103 proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_instance,
1104 tvb, offset, 2, ENC_BIG_ENDIAN);
1108 proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_sz,
1109 tvb, offset, 2, ENC_BIG_ENDIAN);
1113 proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_state,
1114 tvb, offset, 1, ENC_BIG_ENDIAN);
1118 memstate_flag = tvb_get_guint8(tvb, offset);
1119 proto_tree_add_boolean(memstatedatacomp_tree, hf_sasp_memstatedatacomp_quiesce_flag,
1120 tvb, offset, 1, memstate_flag);
1128 static guint32 dissect_weight_entry_data_comp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
1131 proto_tree *weight_entry_data_comp_tree;
1132 proto_item *weight_entry_data_comp;
1134 static const int *wtflags[] = {
1135 &hf_sasp_wed_contactsuccess_flag,
1136 &hf_sasp_wed_quiesce_flag,
1137 &hf_sasp_wed_registration_flag,
1138 &hf_sasp_wed_confident_flag,
1143 offset = dissect_memdatacomp(tvb, pay_load, offset, NULL);
1145 weight_entry_data_comp = proto_tree_add_text(pay_load, tvb, offset, -1 , "Weight Entry Data");
1146 weight_entry_data_comp_tree = proto_item_add_subtree(weight_entry_data_comp,
1147 ett_sasp_weight_entry_data_comp);
1150 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_type,
1151 tvb, offset, 2, ENC_BIG_ENDIAN);
1155 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_sz,
1156 tvb, offset, 2, ENC_BIG_ENDIAN);
1160 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_state,
1161 tvb, offset, 1, ENC_BIG_ENDIAN);
1165 proto_tree_add_bitmask_text(weight_entry_data_comp_tree, tvb, offset, 1, "Flags:", NULL,
1166 ett_wt_entry_data_flag, wtflags, ENC_BIG_ENDIAN, 0);
1172 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_weight,
1173 tvb, offset, 2, ENC_BIG_ENDIAN);
1181 static guint32 dissect_grp_wt_entry_datacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset)
1184 proto_item *grp_wt_entry_datacomp;
1185 proto_tree *grp_wt_entry_datacomp_tree;
1187 guint16 wt_entry_cnt;
1190 grp_wt_entry_datacomp = proto_tree_add_text(pay_load, tvb, offset, -1 , "Group of Wt Entry Data");
1191 grp_wt_entry_datacomp_tree = proto_item_add_subtree(grp_wt_entry_datacomp,
1192 ett_sasp_grp_wt_entry_datacomp);
1195 proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_type,
1196 tvb, offset, 2, ENC_BIG_ENDIAN);
1200 proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_sz,
1201 tvb, offset, 2, ENC_BIG_ENDIAN);
1204 wt_entry_cnt = tvb_get_ntohs(tvb, offset);
1207 proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_cnt,
1208 tvb, offset, 2, ENC_BIG_ENDIAN);
1212 offset = dissect_grpdatacomp(tvb, grp_wt_entry_datacomp_tree, offset);
1215 for (i=0; i<wt_entry_cnt; i++)
1217 offset = dissect_weight_entry_data_comp(tvb, grp_wt_entry_datacomp_tree, offset);
1226 /* sasp protocol register */
1227 void proto_register_sasp(void)
1230 static hf_register_info hf[] = {
1234 { "Type", "sasp.msg.type",
1235 FT_UINT16, BASE_HEX, NULL, 0x0,
1236 "SASP Header", HFILL }
1240 { "Length", "sasp.header.Len",
1241 FT_UINT16, BASE_DEC, NULL, 0x0,
1242 "SASP Header Length", HFILL }
1246 { "Version", "sasp.version",
1247 FT_UINT8, BASE_DEC, NULL, 0x0,
1248 "SASP Version", HFILL }
1252 { "Message Len", "sasp.msg.len",
1253 FT_UINT32, BASE_DEC, NULL, 0x0,
1254 "SASP Msg Len", HFILL }
1258 { "Message Id", "sasp.msg.id",
1259 FT_UINT32, BASE_DEC, NULL, 0x0,
1260 "SASP Msg Id", HFILL }
1265 { "Message Type", "sasp.msg.type",
1266 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1267 "SASP Msg Type", HFILL }
1271 { &hf_sasp_reg_req_sz,
1272 { "Reg Req-Size", "sasp.reg-req.size",
1273 FT_UINT32, BASE_DEC, NULL, 0x0,
1274 "SASP Reg Req Size", HFILL }
1277 { &hf_reg_req_lbflag,
1278 { "Reg Req-LB Flag", "sasp.reg-req.lbflag",
1279 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1280 "SASP Reg Req LB Flag", HFILL } },
1283 { "Grp Mem Data-Count", "sasp.grp-mem-data.count",
1284 FT_UINT16, BASE_DEC, NULL, 0x0,
1285 "SASP Grp Mem Data Count", HFILL } },
1289 { &hf_sasp_reg_rep_sz,
1290 { "Reg Reply-Size", "sasp.reg-rep.size",
1291 FT_UINT16, BASE_DEC, NULL, 0x0,
1292 "SASP Reg Reply size", HFILL } },
1294 { &hf_sasp_reg_rep_rcode,
1295 { "Reg Reply-Return Code", "sasp.reg-rep.retcode",
1296 FT_UINT8, BASE_HEX, VALS(reg_reply_response_code), 0x0,
1297 "SASP Reg Rep Return Code", HFILL } },
1300 { &hf_sasp_dereg_req_sz,
1301 { "Dereg Req-Size", "sasp.dereg-req.size",
1302 FT_UINT32, BASE_DEC, NULL, 0x0,
1303 "SASP Dereg Req Size", HFILL } },
1305 { &hf_dereg_req_lbflag,
1306 { "Dereg Req-LB Flag", "sasp.dereg-req.lbflag",
1307 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1308 "SASP Dereg Req LB Flag", HFILL } },
1310 { &hf_dereg_req_reason_flag,
1311 { "Reason Flags", "sasp.flags.reason",
1312 FT_UINT8, BASE_HEX, NULL, 0x0,
1316 { &hf_dereg_req_reason,
1317 { "Dereg Req-Reason", "sasp.dereg-req.reason",
1318 FT_UINT8, BASE_HEX, NULL, 0x0,
1319 "SASP Dereg Req Reason", HFILL } },
1323 { &hf_sasp_dereg_rep_sz,
1324 { "Dereg Rep-Size", "sasp.dereg-rep.size",
1325 FT_UINT16, BASE_DEC, NULL, 0x0,
1326 "SASP Dereg Rep Size", HFILL } },
1328 { &hf_sasp_dereg_rep_rcode,
1329 { "Dereg Rep-Return Code", "sasp.dereg-rep.retcode",
1330 FT_UINT8, BASE_HEX, VALS(dereg_reply_response_code), 0x0,
1331 "SASP Dereg Rep Return Code", HFILL } },
1335 { &hf_sasp_sendwt_sz,
1336 { "Sendwt-Size", "sasp.sendwt.size",
1337 FT_UINT16, BASE_DEC, NULL, 0x0,
1338 "SASP Sendwt-Size", HFILL } },
1340 { &hf_sasp_sendwt_gwedcnt,
1341 { "Sendwt-Grp Wt EntryData Count", "sasp.sendwt-grp-wtentrydata.count",
1342 FT_UINT16, BASE_DEC, NULL, 0x0,
1343 "SASP Sendwt Grp Wt Entry Data Count", HFILL } },
1345 /*Set Mem State Req*/
1347 { &hf_sasp_setmemstate_req_sz,
1348 { "Set Memstate Req-Size", "sasp.setmemstate-req.size",
1349 FT_UINT16, BASE_DEC, NULL, 0x0,
1350 "SASP Set Memstate Req Size", HFILL } },
1352 { &hf_setmemstate_req_lbflag,
1353 { "Set Memstate Req-LB Flag", "sasp.setmemstate-req.lbflag",
1354 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1355 "SASP Set Memstate Req LB Flag", HFILL } },
1357 { &hf_sasp_setmemstate_req_gmsd_cnt,
1358 { "Set Memstate Req-Gmsd Count", "sasp.group-memstate.count",
1359 FT_UINT16, BASE_DEC, NULL, 0x0,
1360 "Group Of Member State Data Count", HFILL } },
1362 /* Set Mem State Reply */
1364 { &hf_sasp_setmemstate_rep,
1365 { "Set Memstate Reply", "sasp.setmemstate-rep",
1366 FT_UINT32, BASE_HEX, NULL, 0x0,
1367 "SASP Set Memstate Reply", HFILL } },
1370 { &hf_sasp_setmemstate_rep_sz,
1371 { "Set Memstate Rep-Size", "sasp.setmemstate-rep.size",
1372 FT_UINT16, BASE_DEC, NULL, 0x0,
1373 "SASP Set Memstate Rep Size", HFILL } },
1375 { &hf_sasp_setmemstate_rep_rcode,
1376 { "Set Memstate Rep-Return Code", "sasp.setmemstate-rep.retcode",
1377 FT_UINT8, BASE_HEX, VALS(set_mem_state_reply_response_code), 0x0,
1378 "SASP Set Memstate Rep Return Code", HFILL } },
1380 /*Mem Data Component*/
1382 { &hf_sasp_memdatacomp_type,
1383 { "Message Type", "sasp.msg.type",
1384 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1385 "SASP Mem Data Comp", HFILL } },
1387 { &hf_sasp_memdatacomp_sz,
1388 { "Mem Data Comp-Size", "sasp.memdatacomp.size",
1389 FT_UINT16, BASE_DEC, NULL, 0x0,
1390 "SASP Mem Data Comp Size", HFILL } },
1392 { &hf_sasp_memdatacomp_protocol,
1393 { "Mem Data Comp-Protocol", "sasp.memdatacomp.protocol",
1394 FT_UINT8, BASE_HEX, VALS(protocol_table), 0x0,
1395 "SASP Mem Data Comp Protocol", HFILL } },
1397 { &hf_sasp_memdatacomp_port,
1398 { "Mem Data Comp-Port", "sasp.memdatacomp.port",
1399 FT_UINT16, BASE_DEC, NULL, 0x0,
1400 "SASP Mem Data Comp Port", HFILL } },
1402 { &hf_sasp_memdatacomp_ip,
1403 { "Mem Data Comp-Ip", "sasp.memdatacomp.ip",
1404 FT_IPv6, BASE_NONE, NULL, 0x0,
1405 "SASP Mem Data Comp Ip", HFILL } },
1407 { &hf_sasp_memdatacomp_lab_len,
1408 { "Mem Data Comp-Label Len", "sasp.memdatacomp.label.len",
1409 FT_UINT8, BASE_DEC, NULL, 0x0,
1410 "SASP Mem Data Comp Label Length", HFILL } },
1412 { &hf_sasp_memdatacomp_label,
1413 { "Mem Data Comp-Label", "sasp.memdatacomp.label",
1414 FT_STRING, BASE_NONE, NULL, 0x0,
1415 "SASP Mem Data Comp Label", HFILL } },
1417 /*Get Weight Request*/
1419 { &hf_sasp_wt_req_sz,
1420 { "Get Wt Req-Size", "sasp.getwt.req.size",
1421 FT_UINT16, BASE_DEC, NULL, 0x0,
1422 "SASP Get Wt Req Size", HFILL } },
1424 { &hf_sasp_wt_req_gd_cnt,
1425 { "Get Wt Req-Grp Data Count", "sasp.getwt-req-grpdata.count",
1426 FT_UINT16, BASE_DEC, NULL, 0x0,
1427 "SASP Get Wt Grp Data Count", HFILL } },
1429 /*Get Weight Reply*/
1431 { &hf_sasp_wt_rep_sz,
1432 { "Get Wt Rep-Size", "sasp.getwt.rep.size",
1433 FT_UINT16, BASE_DEC, NULL, 0x0,
1434 "SASP Get Wt Rep Size", HFILL } },
1436 { &hf_sasp_wt_rep_rcode,
1437 { "Get Wt Rep-Return Code", "sasp.getwt-rep.retcode",
1438 FT_UINT8, BASE_HEX, VALS(get_weights_reply_response_code), 0x0,
1439 "SASP Get Wt Rep Return Code", HFILL } },
1441 { &hf_sasp_wt_rep_interval,
1442 { "Get Wt Rep-Interval", "sasp.getwt-rep.interval",
1443 FT_UINT8, BASE_DEC, NULL, 0x0,
1444 "SASP Get Wt Rep Interval", HFILL } },
1446 { &hf_sasp_wt_rep_gwed_cnt,
1447 { "Get Wt Rep-Grp WtEntry Data Cnt", "sasp.getwt-rep-grpwtentrydata.count",
1448 FT_UINT16, BASE_DEC, NULL, 0x0,
1449 "SASP Get Wt Rep Grp Wt Entry Data Cnt", HFILL } },
1451 /*Set LB State Rep */
1454 { &hf_sasp_setlbstate_rep,
1455 { "Set Lbstate Rep", "sasp.msg.type",
1456 FT_UINT32, BASE_HEX, NULL, 0x0,
1457 "SASP Set Lbstate Rep", HFILL } },
1460 { &hf_sasp_setlbstate_rep_sz,
1461 { "Set Lbstate Rep-Size", "sasp.setlbstate-rep.size",
1462 FT_UINT16, BASE_DEC, NULL, 0x0,
1463 "SASP Set Lbstate Rep Size", HFILL } },
1465 { &hf_sasp_setlbstate_rep_rcode,
1466 { "Set Lbstate Rep-Return Code", "sasp.setlbstate-rep.retcode",
1467 FT_UINT8, BASE_HEX, VALS(set_lb_state_reply_response_code), 0x0,
1468 "SASP Set Lbstate Rep Return Code", HFILL } },
1473 { &hf_sasp_grpdatacomp,
1474 { "Message Type", "sasp.msg.type",
1475 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1476 "SASP Grp Data Comp", HFILL } },
1478 { &hf_sasp_grpdatacomp_sz,
1479 { "Grp Data Comp-Size", "sasp.grpdatacomp.size",
1480 FT_UINT16, BASE_DEC, NULL, 0x0,
1481 "SASP Grp Data Comp size", HFILL } },
1483 { &hf_sasp_grpdatacomp_LB_uid_len,
1484 { "Grp Data Comp-Label UID Len", "sasp.grpdatacomp.label.uid.len",
1485 FT_UINT8, BASE_DEC, NULL, 0x0,
1486 "SASP Grp Data Comp Label Uid Len", HFILL } },
1488 { &hf_sasp_grpdatacomp_LB_uid,
1489 { "Grp Data Comp-Label UID", "sasp.grpdatacomp.label.uid",
1490 FT_STRING, BASE_NONE, NULL, 0x0,
1491 "SASP Grp Data Comp Label Uid", HFILL } },
1493 { &hf_sasp_grpdatacomp_grp_name_len,
1494 { "Grp Data Comp-Grp Name Len", "sasp.grpdatacomp.grpname.len",
1495 FT_UINT8, BASE_DEC, NULL, 0x0,
1496 "SASP Grp Data Comp Grp Name Len", HFILL } },
1498 { &hf_sasp_grpdatacomp_grp_name,
1499 { "Grp Data Comp-Grp Name", "sasp.grpdatacomp.grpname",
1500 FT_STRING, BASE_NONE, NULL, 0x0,
1501 "SASP Grp Data Comp Grp Name", HFILL } },
1503 /*grp mem data comp */
1505 { &hf_sasp_grp_memdatacomp,
1506 { "Message Type", "sasp.msg.type",
1507 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1508 "SASP Grp Mem Data Comp", HFILL } },
1511 { &hf_sasp_grp_memdatacomp_sz,
1512 { "Grp Mem Data Comp-Size", "sasp.grp-memdatacomp.size",
1513 FT_UINT16, BASE_DEC, NULL, 0x0,
1514 "SASP Grp Mem Data Comp Size", HFILL } },
1516 { &hf_sasp_grp_memdatacomp_cnt,
1517 { "Grp Mem Data Comp-Count", "sasp.grp.memdatacomp.count",
1518 FT_UINT16, BASE_DEC, NULL, 0x0,
1519 "SASP Grp Mem Data Comp Cnt", HFILL } },
1522 /*set LB state req*/
1524 { &hf_sasp_setlbstate_req_sz,
1525 { "Set LB State Req-Size", "sasp.setlbstate-req.size",
1526 FT_UINT16, BASE_DEC, NULL, 0x0,
1527 "SASP Set LB State Req Size", HFILL } },
1529 { &hf_sasp_setlbstate_req_LB_uid_len,
1530 { "Set LB State Req-LB UID Len", "sasp.setlbstate-req.lbuid.len",
1531 FT_UINT8, BASE_DEC, NULL, 0x0,
1532 "SASP Set LB State Req LB Uid Len", HFILL } },
1534 { &hf_sasp_setlbstate_req_LB_uid,
1535 { "Set LB State Req-LB UID", "sasp.setlbstate-req.lbuid",
1536 FT_STRING, BASE_NONE, NULL, 0x0,
1537 "SASP Set LB State Req LB UID", HFILL } },
1539 { &hf_sasp_setlbstate_req_LB_health,
1540 { "Set LB State Req-LB Health", "sasp.setlbstate-req.lbhealth",
1541 FT_UINT8, BASE_HEX, VALS(lbstate_healthtable), 0x0,
1542 "SASP Set LB State Req LB Health", HFILL } },
1546 { "Flags", "sasp.flags.lbstate",
1547 FT_UINT8, BASE_HEX, NULL, 0x0,
1551 { &hf_sasp_pushflag,
1552 { "PUSH", "sasp.flags.push",
1553 FT_BOOLEAN, 8, NULL, SASP_PUSH_FLAG,
1554 "SASP Push Flag", HFILL } },
1556 { &hf_sasp_trustflag,
1557 { "TRUST", "sasp.flags.trust",
1558 FT_BOOLEAN, 8, NULL, SASP_TRUST_FLAG,
1559 "SASP Trust Flag", HFILL } },
1561 { &hf_sasp_nochangeflag,
1562 { "NOCHANGE", "sasp.flags.nochange",
1563 FT_BOOLEAN, 8, NULL, SASP_NOCHANGE_FLAG,
1564 "SASP Nochange Flag", HFILL } },
1566 /*grp mem state data comp */
1568 { &hf_sasp_grp_memstatedatacomp,
1569 { "Message Type", "sasp.msg.type",
1570 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1571 "SASP Message Type", HFILL } },
1574 { &hf_sasp_grp_memstatedatacomp_sz,
1575 { "Grp Mem State-Size", "sasp.grp.memstate.size",
1576 FT_UINT16, BASE_DEC, NULL, 0x0,
1577 "SASP Grp Mem State Data Comp Size", HFILL } },
1579 { &hf_sasp_grp_memstatedatacomp_cnt,
1580 { "Grp Mem State-Count", "sasp.grp.memstate.count",
1581 FT_UINT16, BASE_DEC, NULL, 0x0,
1582 "SASP Grp Mem State Data Comp Count", HFILL } },
1584 /*mem state instance */
1586 { &hf_sasp_memstatedatacomp_instance,
1587 { "Message Type", "sasp.msg.type",
1588 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1589 "SASP Message Type", HFILL } },
1592 { &hf_sasp_memstatedatacomp_sz,
1593 { "Mem State-Size", "sasp.memstate.size",
1594 FT_UINT16, BASE_DEC, NULL, 0x0,
1595 "SASP Mem State Data Comp Size", HFILL } },
1597 { &hf_sasp_memstatedatacomp_state,
1598 { "Mem State-State", "sasp.memstate.state",
1599 FT_UINT8, BASE_HEX, NULL, 0x0,
1600 "SASP Mem State Data Comp State", HFILL } },
1602 { &hf_sasp_memstatedatacomp_quiesce_flag,
1603 { "Mem State-Quiesce Flag", "sasp.flags.quiesce",
1604 FT_BOOLEAN, 8, NULL, SASP_QUIESCE_FLAG,
1605 "SASP Quiesce Flag", HFILL } },
1608 /*weight entry data comp*/
1610 { &hf_sasp_weight_entry_data_comp_type,
1611 { "Wt Entry Data Comp", "sasp.msg.type",
1612 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1613 "SASP Wt Entry Data Comp", HFILL } },
1615 { &hf_sasp_weight_entry_data_comp_sz,
1616 { "Wt Entry Data Comp-Size", "sasp.wtentry.size",
1617 FT_UINT16, BASE_DEC, NULL, 0x0,
1618 "SASP Wt Entry Data Comp Size", HFILL } },
1620 { &hf_sasp_weight_entry_data_comp_state,
1621 { "Wt Entry Data Comp-state", "sasp.wtentry.state",
1622 FT_UINT8, BASE_HEX, NULL, 0x0,
1623 "SASP Wt Entry Data Comp State", HFILL } },
1627 { "Flags", "sasp.flags.wtstate",
1628 FT_UINT8, BASE_HEX, NULL, 0x0,
1632 { &hf_sasp_wed_contactsuccess_flag,
1633 { "Contact Success", "sasp.flags.contactsuccess",
1634 FT_BOOLEAN, 8, NULL, SASP_WED_CONTACT_SUCCESS_FLAG,
1635 "SASP Contact Success Flag", HFILL } },
1637 { &hf_sasp_wed_quiesce_flag,
1638 { "Quiesce", "sasp.flags.quiesce",
1639 FT_BOOLEAN, 8, NULL, SASP_WED_QUIESCE_FLAG,
1640 "SASP Quiesce Flag", HFILL } },
1642 { &hf_sasp_wed_registration_flag,
1643 { "Registration", "sasp.flags.registration",
1644 FT_BOOLEAN, 8, NULL, SASP_WED_REG_FLAG,
1645 "SASP Registration Flag", HFILL } },
1647 { &hf_sasp_wed_confident_flag,
1648 { "Confident", "sasp.flags.confident",
1649 FT_BOOLEAN, 8, NULL, SASP_WED_CONF_FLAG,
1650 "SASP Confident Flag", HFILL } },
1652 { &hf_sasp_weight_entry_data_comp_weight,
1653 { "Wt Entry Data Comp-weight", "sasp.wtentrydatacomp.weight",
1654 FT_UINT16, BASE_DEC, NULL, 0x0,
1655 "SASP Wt Entry Data Comp weight", HFILL } },
1658 /*grp wt entry data comp */
1660 { &hf_sasp_grp_wt_entry_datacomp_type,
1661 { "Grp Wt Entry Data Comp", "sasp.msg.type",
1662 FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0,
1663 "SASP Grp Wt Entry Data Comp", HFILL } },
1665 { &hf_sasp_grp_wt_entry_datacomp_sz,
1666 { "Grp Wt Entry Data Comp Size", "sasp.grp-wtentrydata.size",
1667 FT_UINT16, BASE_DEC, NULL, 0x0,
1668 "SASP Grp Wt Entry Data Comp Size", HFILL } },
1670 { &hf_sasp_grp_wt_entry_datacomp_cnt,
1671 { "Grp Wt Entry Data Comp Cnt", "sasp.grp-wtentrydata.count",
1672 FT_UINT16, BASE_DEC, NULL, 0x0,
1673 "SASP Grp Wt Entry Data Comp Cnt", HFILL } },
1677 /* Setup protocol subtree array */
1679 static gint *ett[] = {
1686 &ett_sasp_reg_req_sz,
1687 &ett_sasp_dereg_req_sz,
1688 &ett_sasp_dereg_rep,
1690 &ett_sasp_setmemstate_req,
1691 &ett_sasp_setmemstate_rep,
1692 &ett_sasp_memdatacomp,
1693 &ett_sasp_grpdatacomp,
1694 &ett_sasp_grp_memdatacomp,
1695 &ett_sasp_setlbstate_req,
1696 &ett_sasp_setlbstate_rep,
1698 &ett_setlbstate_req_lbflag,
1699 &ett_sasp_grp_memstatedatacomp,
1700 &ett_sasp_memstatedatacomp,
1701 /* &ett_dereg_req_reason_flag, */
1702 &ett_sasp_grp_wt_entry_datacomp,
1703 &ett_sasp_weight_entry_data_comp,
1704 &ett_wt_entry_data_flag,
1708 module_t *sasp_module;
1710 proto_sasp = proto_register_protocol("Server/Application State Protocol", "SASP", "sasp");
1712 proto_register_field_array(proto_sasp, hf, array_length(hf));
1713 proto_register_subtree_array(ett, array_length(ett));
1715 sasp_module = prefs_register_protocol(proto_sasp, NULL);
1716 prefs_register_bool_preference(sasp_module, "desegment_sasp_messages",
1717 "Reassemble SASP messages spanning multiple TCP segments",
1718 "Whether the SASP dissector should reassemble messages"
1719 " spanning multiple TCP segments."
1720 " To use this option, you must also enable"
1721 " \"Allow subdissectors to reassemble TCP streams\""
1722 " in the TCP protocol settings.",
1727 /* Handing off to TCP */
1729 proto_reg_handoff_sasp(void)
1731 dissector_handle_t sasp_handle;
1732 sasp_handle = create_dissector_handle(dissect_sasp, proto_sasp);
1733 dissector_add_uint("tcp.port", SASP_GLOBAL_PORT, sasp_handle);