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.
32 #include <epan/packet.h>
33 #include <epan/expert.h>
34 #include "packet-tcp.h"
35 #include <epan/prefs.h>
38 /* forward reference */
40 static void dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
41 static void dissect_reg_req(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
42 static void dissect_dereg_req(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
43 static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
44 static void dissect_dereg_rep(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
45 static void dissect_sendwt(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
46 static void dissect_setmemstate_req(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
47 static void dissect_setmemstate_rep(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
48 static void dissect_setlbstate_req(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
49 static void dissect_setlbstate_rep(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
50 static void dissect_wt_req(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
51 static void dissect_wt_rep(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
52 static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
53 static guint32 dissect_grpdatacomp(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
54 static guint32 dissect_grp_memdatacomp(tvbuff_t *tvb, proto_tree *tree,guint32 offset);
55 static guint32 dissect_grp_memstatedatacomp(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
56 static guint32 dissect_memstatedatacomp(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
57 static guint32 dissect_weight_entry_data_comp(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset);
58 static guint32 dissect_grp_wt_entry_datacomp(tvbuff_t *tvb,proto_tree *tree,guint32 offset);
63 /* Initialize the protocol and registered fields */
65 static int proto_sasp = -1;
66 static int hf_sasp_type = -1;
67 static int hf_sasp_length = -1;
68 static int hf_sasp_vrsn = -1;
69 static int hf_msg_len = -1;
70 static int hf_msg_id = -1;
72 static int hf_msg_type = -1;
76 static int hf_sasp_reg_rep_rcode = -1;
77 static int hf_sasp_reg_rep_sz = -1;
80 static int hf_sasp_reg_req_sz = -1;
81 static int hf_reg_req_lbflag = -1;
82 static int hf_sasp_gmd_cnt = -1;
85 static int hf_sasp_dereg_req_sz = -1;
86 static int hf_dereg_req_lbflag = -1;
87 static int hf_dereg_req_reason = -1;
88 static int hf_dereg_req_reason_flag = -1;
91 static int hf_sasp_dereg_rep_rcode = -1;
92 static int hf_sasp_dereg_rep_sz = -1;
95 static int hf_sasp_sendwt_gwedcnt = -1;
96 static int hf_sasp_sendwt_sz = -1;
99 static int hf_sasp_setmemstate_req_sz = -1;
100 static int hf_setmemstate_req_lbflag = -1;
101 /*static int hf_sasp_setmemstate_req_data = -1;*/
102 static int hf_sasp_setmemstate_req_gmsd_cnt = -1;
104 /*setmemstate reply*/
105 static int hf_sasp_setmemstate_rep = -1;
106 static int hf_sasp_setmemstate_rep_rcode = -1;
107 static int hf_sasp_setmemstate_rep_sz = -1;
110 static int hf_sasp_memdatacomp_type = -1;
111 static int hf_sasp_memdatacomp_sz = -1;
112 static int hf_sasp_memdatacomp_protocol = -1;
113 static int hf_sasp_memdatacomp_port = -1;
114 static int hf_sasp_memdatacomp_ip = -1;
115 static int hf_sasp_memdatacomp_lab_len = -1;
116 static int hf_sasp_memdatacomp_label = -1;
119 static int hf_sasp_grpdatacomp = -1;
120 static int hf_sasp_grpdatacomp_sz = -1;
121 static int hf_sasp_grpdatacomp_LB_uid_len = -1;
122 static int hf_sasp_grpdatacomp_LB_uid = -1;
123 static int hf_sasp_grpdatacomp_grp_name_len = -1;
124 static int hf_sasp_grpdatacomp_grp_name = -1;
126 /*grp mem data comp */
127 static int hf_sasp_grp_memdatacomp = -1;
128 static int hf_sasp_grp_memdatacomp_sz = -1;
129 static int hf_sasp_grp_memdatacomp_cnt = -1;
132 static int hf_sasp_wt_req_sz = -1;
133 static int hf_sasp_wt_req_gd_cnt = -1;
136 static int hf_sasp_wt_rep_sz = -1;
137 static int hf_sasp_wt_rep_rcode = -1;
138 static int hf_sasp_wt_rep_interval = -1;
139 static int hf_sasp_wt_rep_gwed_cnt = -1;
142 static int hf_sasp_setlbstate_req_sz = -1;
143 static int hf_sasp_setlbstate_req_LB_uid_len = -1;
144 static int hf_sasp_setlbstate_req_LB_uid = -1;
145 static int hf_sasp_setlbstate_req_LB_health = -1;
146 /*static int hf_sasp_setlbstate_req_LB_flag = -1;*/
147 static int hf_lbstate_flag = -1;
148 static int hf_sasp_pushflag = -1;
149 static int hf_sasp_trustflag = -1;
150 static int hf_sasp_nochangeflag = -1;
153 static int hf_sasp_setlbstate_rep = -1;
154 static int hf_sasp_setlbstate_rep_rcode = -1;
155 static int hf_sasp_setlbstate_rep_sz = -1;
157 /*grp mem state data*/
158 static int hf_sasp_grp_memstatedatacomp = -1;
159 static int hf_sasp_grp_memstatedatacomp_sz = -1;
160 static int hf_sasp_grp_memstatedatacomp_cnt = -1;
162 /*mem state data comp*/
163 static int hf_sasp_memstatedatacomp_instance =-1;
164 static int hf_sasp_memstatedatacomp_sz =-1;
165 static int hf_sasp_memstatedatacomp_state =-1;
166 static int hf_sasp_memstatedatacomp_quiesce_flag =-1;
168 /*wt entry dat comp*/
169 static int hf_sasp_weight_entry_data_comp_type =-1;
170 static int hf_sasp_weight_entry_data_comp_sz =-1;
171 static int hf_sasp_weight_entry_data_comp_state =-1;
172 static int hf_wtstate_flag = -1;
173 static int hf_sasp_wed_contactsuccess_flag =-1;
174 static int hf_sasp_wed_quiesce_flag =-1;
175 static int hf_sasp_wed_registration_flag =-1;
176 static int hf_sasp_wed_confident_flag =-1;
177 static int hf_sasp_weight_entry_data_comp_weight =-1;
179 /*grp wt entry data comp */
180 static int hf_sasp_grp_wt_entry_datacomp_type = -1;
181 static int hf_sasp_grp_wt_entry_datacomp_sz = -1;
182 static int hf_sasp_grp_wt_entry_datacomp_cnt = -1;
185 /* Initialize the subtree pointers */
186 static gint ett_sasp_data = -1;
187 static gint ett_sasp_header = -1;
188 static gint ett_sasp_msg = -1;
189 static gint ett_sasp_payload = -1;
190 static gint ett_sasp_reg_req = -1;
191 static gint ett_sasp_reg_rep = -1;
192 static gint ett_sasp_reg_req_sz = -1;
193 static gint ett_sasp_dereg_req_sz=-1;
194 static gint ett_sasp_dereg_rep = -1;
195 static gint ett_sasp_sendwt = -1;
196 static gint ett_sasp_setmemstate_rep = -1;
197 static gint ett_sasp_memdatacomp = -1;
198 static gint ett_sasp_grpdatacomp = -1;
199 static gint ett_sasp_grp_memdatacomp = -1;
200 static gint ett_sasp_setlbstate_req =-1;
201 static gint ett_sasp_setlbstate_rep =-1;
202 static gint ett_sasp_getwt= -1;
203 static gint ett_sasp_setmemstate_req = -1;
204 static gint ett_setlbstate_req_lbflag = -1;
205 static gint ett_sasp_grp_memstatedatacomp =-1;
206 static gint ett_sasp_memstatedatacomp =-1;
207 /*static gint ett_dereg_req_reason_flag = -1;*/
208 static gint ett_sasp_grp_wt_entry_datacomp = -1;
209 static gint ett_sasp_weight_entry_data_comp =-1;
210 static gint ett_wt_entry_data_flag = -1;
211 static gint ett_sasp_wt_rep = -1;
213 /* desegmentation of SASP over TCP */
214 static gboolean sasp_desegment = TRUE;
216 static const value_string msg_table[] = {
217 { 0x1010, "Registration Request" },
218 { 0x1015, "Registration Reply"},
219 { 0x1020, "DeRegistration Request"},
220 { 0x1025, "DeRegistration Reply"},
221 { 0x1030, "Get Weights Request"},
222 { 0x1035, "Get Weights Reply" },
223 { 0x1040, "Send Weights"},
224 { 0x1050, "Set LB State Request"},
225 { 0x1055, "Set LB State Reply"},
226 { 0x1060, "Set Member State Request"},
227 { 0x1065, "Set Member State Reply"},
228 { 0x3010, "Member Data Component"},
229 { 0x3011, "Group Data Component"},
230 { 0x3012, "Weight Entry Data Component"},
231 { 0x3013, "Member State Instance"},
232 { 0x4010, "Group of Member Data"},
233 { 0x4011, "Group of Weight Entry Data" },
234 { 0x4012, "Group of Member State Data" },
238 static const value_string protocol_table[] = {
246 static const value_string lbstate_healthtable[] = {
247 { 0x00, "Least Healthy" },
248 { 0x7f, "Most Healthy" },
253 static const value_string reg_reply_response_code[] = {
254 { 0x00, "Successful" },
255 { 0x10, "Message not understood" },
256 { 0x11, "GWM will not accept this message from the sender" },
257 { 0x40, "Member already registered" },
258 { 0x44, "Duplicate Member in Request" },
259 { 0x45, "Invalid Group (determined by the GWM)"},
260 { 0x50, "Invalid Group Name Size (size == 0)"},
261 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
262 { 0x61, "Member is registering itself, but LB hasn't yet contacted the GWM. 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. This deregistration will not be processed."},
280 static const value_string get_weights_reply_response_code[] = {
281 { 0x00, "Successful" },
282 { 0x10, "Message not understood" },
283 { 0x11, "GWM will not accept this message from the sender" },
284 { 0x42, "Unknown Group Name" },
285 { 0x43, "Unknown LB uid" },
286 { 0x46, "Duplicate Group in Request"},
287 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
291 static const value_string set_lb_state_reply_response_code[] = {
292 { 0x00, "Successful" },
293 { 0x10, "Message not understood" },
294 { 0x11, "GWM will not accept this message from the sender" },
295 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
299 static const value_string set_mem_state_reply_response_code[] = {
300 { 0x00, "Successful" },
301 { 0x10, "Message not understood" },
302 { 0x11, "GWM will not accept this message from the sender" },
303 { 0x41, "Application or System not registered" },
304 { 0x42, "Unknown Group Name" },
305 { 0x43, "Unknown LB uid" },
306 { 0x44, "Duplicate Member in Request"},
307 { 0x46, "Duplicate Group in Request (for remove all members/groups requests)"},
308 { 0x50, "Invalid Group Name Size (size == 0)"},
309 { 0x51, "Invalid LB uid Size (size == 0 or > max)"},
314 static proto_item *memdatacomp = NULL;
315 static proto_tree *memdatacomp_tree = NULL;
319 #define SASP_GLOBAL_PORT 3860
320 #define SASP_MIN_PACKET_LEN 13
322 #define SASP_DEREG_REQ_REASON_LEARNED 0x01
323 #define SASP_DEREG_REQ_NOREASON_FLAG 0x00
324 #define SASP_HDR_TYPE 0x2010
325 #define SASP_WED_CONTACT_SUCCESS_FLAG 0x01
326 #define SASP_WED_QUIESCE_FLAG 0x02
327 #define SASP_WED_REG_FLAG 0x04
328 #define SASP_WED_CONF_FLAG 0x08
329 #define SASP_PUSH_FLAG 0x01
330 #define SASP_TRUST_FLAG 0x02
331 #define SASP_NOCHANGE_FLAG 0x04
332 #define SASP_QUIESCE_FLAG 0x01
338 get_sasp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
343 * Get the length of the SASP packet.
345 plen = tvb_get_ntohl(tvb, offset + 5);
353 dissect_sasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
355 tcp_dissect_pdus(tvb, pinfo, tree, sasp_desegment, SASP_MIN_PACKET_LEN, get_sasp_pdu_len,
356 (dissector_t)dissect_sasp_pdu);
362 /* Called from tcp_dissect_pdus with a complete SASP pdu */
364 dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
366 /* Set up structures needed to add the protocol subtree and manage it */
370 proto_tree *sasp_tree;
371 proto_tree *msg_tree;
372 proto_tree *pay_load;
379 /*protocol is being displayed*/
381 col_set_str(pinfo->cinfo, COL_PROTOCOL, "SASP");
382 col_clear(pinfo->cinfo, COL_INFO);
384 ti = proto_tree_add_item(tree,proto_sasp,tvb,offset,-1,FALSE);
385 sasp_tree = proto_item_add_subtree(ti,ett_sasp_header);
387 hdr_type = tvb_get_ntohs(tvb, offset);
388 hti = proto_tree_add_uint_format(sasp_tree,hf_sasp_type,tvb,offset,2,hdr_type,
389 "Type: %s", (hdr_type==SASP_HDR_TYPE) ? "SASP" : "[Invalid]");
390 if (hdr_type != SASP_HDR_TYPE) {
391 expert_add_info_format(pinfo, hti, PI_MALFORMED, PI_ERROR,
392 "Invalid SASP Header Type [0x%04x]", hdr_type);
393 /* XXX: The folowing should actually happen automatically ? */
394 col_set_str(pinfo->cinfo, COL_INFO, "[Malformed: Invalid SASP Header Type]");
400 proto_tree_add_item(sasp_tree,hf_sasp_length,tvb,offset,2,ENC_BIG_ENDIAN);
404 proto_tree_add_item(sasp_tree,hf_sasp_vrsn,tvb,offset,1,ENC_BIG_ENDIAN);
408 msg_tree = proto_item_add_subtree(ti,ett_sasp_msg);
411 proto_tree_add_item(msg_tree,hf_msg_len,tvb,offset,4,ENC_BIG_ENDIAN);
415 proto_tree_add_item(msg_tree,hf_msg_id,tvb,offset,4,ENC_BIG_ENDIAN);
419 msg_type = tvb_get_ntohs(tvb, offset);
420 mti = proto_tree_add_item(msg_tree,hf_msg_type,tvb,offset,2,ENC_BIG_ENDIAN);
421 pay_load = proto_item_add_subtree(ti,ett_sasp_payload);
429 /* Registration Request */
430 col_set_str(pinfo->cinfo, COL_INFO, "Registration Request");
431 dissect_reg_req(tvb,pay_load,offset);
436 /* Registration Reply */
437 col_set_str(pinfo->cinfo, COL_INFO, "Registration Reply");
438 dissect_reg_rep(tvb,pay_load,offset);
443 /* Deregistration Request */
444 col_set_str(pinfo->cinfo, COL_INFO, "Deregistration Request");
445 dissect_dereg_req(tvb,pay_load,offset);
450 /* Deregistration Reply */
451 col_set_str(pinfo->cinfo, COL_INFO, "Deregistration Reply");
452 dissect_dereg_rep(tvb,pay_load,offset);
457 /* Get Weights Request */
458 col_set_str(pinfo->cinfo, COL_INFO, "Get Weights Request");
459 dissect_wt_req(tvb,pay_load,offset);
464 /* Get Weights Response */
465 col_set_str(pinfo->cinfo, COL_INFO, "Get Weights Response");
466 dissect_wt_rep(tvb,pay_load,offset);
471 /* Send Weights Request */
472 col_set_str(pinfo->cinfo, COL_INFO, "Send Weights Request");
473 dissect_sendwt(tvb,pay_load,offset);
478 /* Set LB State Request */
479 col_set_str(pinfo->cinfo, COL_INFO, "Set LB State Request");
480 dissect_setlbstate_req(tvb,pay_load,offset);
485 /* Set LB state Reply */
486 col_set_str(pinfo->cinfo, COL_INFO, "Set LB State Reply");
487 dissect_setlbstate_rep(tvb,pay_load,offset);
492 /* Set Member State Request*/
493 col_set_str(pinfo->cinfo, COL_INFO, "Set Member State Request");
494 dissect_setmemstate_req(tvb,pay_load,offset);
499 /* Set Member State Reply */
500 col_set_str(pinfo->cinfo, COL_INFO, "Set Member State Reply");
501 dissect_setmemstate_rep(tvb,pay_load,offset);
506 /* Unknown SASP Message Type */
507 col_add_fstr(pinfo->cinfo, COL_INFO, "[Malformed: Unknown Message Type [0x%04x]", msg_type);
508 expert_add_info_format(pinfo, mti, PI_MALFORMED, PI_WARN,
509 "Unknown SASP Message Type: 0x%4x", msg_type);
516 static void dissect_reg_req(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
521 proto_item *reg_tree;
522 proto_tree *reg_req_data;
525 reg_tree = proto_tree_add_text(pay_load,tvb,offset,-1,"Reg Request");
526 reg_req_data = proto_item_add_subtree(reg_tree, ett_sasp_reg_req_sz);
529 proto_tree_add_item(reg_req_data, hf_sasp_reg_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
532 /* Reg Req LB Flag */
533 proto_tree_add_item(reg_req_data,hf_reg_req_lbflag,tvb,offset,1,FALSE);
536 gmd_cnt=tvb_get_ntohs(tvb, offset);
538 /* Group MEM Data Count */
539 proto_tree_add_item(reg_req_data,hf_sasp_gmd_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
542 for( i=0; i<gmd_cnt; i++)
544 offset = dissect_grp_memdatacomp(tvb,reg_req_data,offset);
551 static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *pay_load,guint32 offset)
555 proto_tree *reg_rep_tree;
557 reg_rep = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Reg Reply");
558 reg_rep_tree = proto_item_add_subtree(reg_rep,ett_sasp_reg_rep);
561 proto_tree_add_item(reg_rep_tree, hf_sasp_reg_rep_sz, tvb, offset,2, ENC_BIG_ENDIAN);
565 proto_tree_add_item(reg_rep_tree, hf_sasp_reg_rep_rcode,tvb,offset,1,ENC_BIG_ENDIAN);
572 static void dissect_dereg_req(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
576 proto_item *dereg_tree;
577 proto_tree *dereg_req_data;
579 /*proto_item *dereg_req_reason_flag;*/
580 /*proto_tree *dereg_req_reason_flag_tree;*/
584 gboolean first_flag = TRUE;
587 emem_strbuf_t *reasonflags_strbuf = ep_strbuf_new_label("");
588 const gchar *fstr[] = {"No Reason", "Learned & Purposeful" };
591 dereg_tree = proto_tree_add_text(pay_load,tvb,offset,-1 ,"DeReg Request");
592 dereg_req_data = proto_item_add_subtree(dereg_tree,ett_sasp_dereg_req_sz);
595 proto_tree_add_item(dereg_req_data, hf_sasp_dereg_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
599 proto_tree_add_item(dereg_req_data,hf_dereg_req_lbflag,tvb,offset,1,FALSE);
603 ep_strbuf_truncate(reasonflags_strbuf, 0);
604 reason_flag = tvb_get_guint8(tvb, offset);
606 if(reason_flag & SASP_DEREG_REQ_NOREASON_FLAG)
608 ep_strbuf_append_printf(reasonflags_strbuf, "%s%s",first_flag ? "" : ", ",fstr[0]);
611 if(reason_flag & SASP_DEREG_REQ_REASON_LEARNED)
613 ep_strbuf_append_printf(reasonflags_strbuf, "%s%s",first_flag ? "" : ", ",fstr[1]);
618 /*dereg_req_reason_flag =*/ proto_tree_add_uint_format(dereg_req_data,hf_dereg_req_reason_flag,tvb,
619 offset,1,reason_flag,"Reason: 0x%02x (%s)",reason_flag,
620 reasonflags_strbuf->str);
621 #if 0 /* XXX: ToDo?? Flags to be displayed under a subtree ? */
622 dereg_req_reason_flag_tree = proto_item_add_subtree(dereg_req_reason_flag,ett_dereg_req_reason_flag);
628 gmd_cnt = tvb_get_ntohs(tvb, offset);
630 /* Group Mem Data Count */
631 proto_tree_add_item(dereg_req_data,hf_sasp_gmd_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
635 for( i=0; i<gmd_cnt; i++)
637 offset = dissect_grp_memdatacomp(tvb,dereg_req_data,offset);
644 static void dissect_dereg_rep(tvbuff_t *tvb, proto_tree *pay_load,guint32 offset)
647 proto_item *dereg_rep;
648 proto_tree *dereg_rep_tree;
650 dereg_rep = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Dereg Reply");
651 dereg_rep_tree = proto_item_add_subtree(dereg_rep,ett_sasp_dereg_rep);
654 proto_tree_add_item(dereg_rep_tree, hf_sasp_dereg_rep_sz, tvb, offset,2, ENC_BIG_ENDIAN);
658 proto_tree_add_item(dereg_rep_tree, hf_sasp_dereg_rep_rcode,tvb,offset,1,ENC_BIG_ENDIAN);
664 static void dissect_sendwt(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
670 proto_tree *sendwt_tree;
672 sendwt = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Send Weight");
673 sendwt_tree = proto_item_add_subtree(sendwt,ett_sasp_sendwt);
676 proto_tree_add_item(sendwt_tree, hf_sasp_sendwt_sz, tvb, offset,2, ENC_BIG_ENDIAN);
679 gwed_cnt=tvb_get_ntohs(tvb, offset);
681 /* Group Wt Entry Data Count */
682 proto_tree_add_item(sendwt_tree, hf_sasp_sendwt_gwedcnt,tvb,offset,2,ENC_BIG_ENDIAN);
685 for( i=0; i<gwed_cnt; i++)
687 offset =dissect_grp_wt_entry_datacomp(tvb,sendwt_tree,offset);
694 static void dissect_setmemstate_req(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
699 proto_item *setmemstate;
700 proto_tree *setmemstate_req_data;
702 setmemstate = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Set Mem State Request");
703 setmemstate_req_data = proto_item_add_subtree(setmemstate,ett_sasp_setmemstate_req);
706 proto_tree_add_item(setmemstate_req_data, hf_sasp_setmemstate_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
710 proto_tree_add_item(setmemstate_req_data,hf_setmemstate_req_lbflag,tvb,offset,1,FALSE);
714 gmsd_cnt=tvb_get_ntohs(tvb, offset);
715 proto_tree_add_item(setmemstate_req_data,hf_sasp_setmemstate_req_gmsd_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
718 for( i=0; i<gmsd_cnt; i++)
720 offset =dissect_grp_memstatedatacomp(tvb,setmemstate_req_data,offset);
726 static void dissect_setmemstate_rep(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
729 proto_item *setmemstate_rep;
730 proto_tree *setmemstate_rep_tree;
733 setmemstate_rep = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Set Mem State Reply");
734 setmemstate_rep_tree = proto_item_add_subtree(setmemstate_rep,ett_sasp_setmemstate_rep);
737 proto_tree_add_item(setmemstate_rep_tree, hf_sasp_setmemstate_rep_sz, tvb, offset,2, ENC_BIG_ENDIAN);
741 proto_tree_add_item(setmemstate_rep_tree, hf_sasp_setmemstate_rep_rcode,tvb,offset,1,ENC_BIG_ENDIAN);
746 static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *pay_load,guint32 offset)
750 struct e_in6_addr ipv6_addr;
754 tvb_get_ipv6(tvb,offset+7,&ipv6_addr);
755 ip_str = ip6_to_str(&ipv6_addr);
757 lab_len = tvb_get_guint8(tvb, offset+23);
759 memdatacomp = proto_tree_add_ipv6_format(pay_load,hf_sasp_memdatacomp_ip,
760 tvb,offset,24+lab_len,(guint8*)&ipv6_addr,
761 "Member Data Comp (%s)",ip_str);
763 memdatacomp_tree = proto_item_add_subtree(memdatacomp,ett_sasp_memdatacomp);
767 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_type, tvb, offset,2, ENC_BIG_ENDIAN);
771 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_sz, tvb, offset,2, ENC_BIG_ENDIAN);
775 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_protocol,tvb,offset,1,ENC_BIG_ENDIAN);
779 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_port, tvb, offset,2, ENC_BIG_ENDIAN);
783 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_ip, tvb, offset,16, FALSE);
788 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_lab_len,tvb,offset,1,ENC_BIG_ENDIAN);
792 proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_label,tvb,offset,lab_len,FALSE);
801 static guint32 dissect_grpdatacomp(tvbuff_t *tvb, proto_tree *pay_load,guint32 offset)
808 proto_item *grpdatacomp;
809 proto_tree *grpdatacomp_tree;
811 grpdatacomp = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Group Data Component");
812 grpdatacomp_tree = proto_item_add_subtree(grpdatacomp,ett_sasp_grpdatacomp);
815 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp, tvb, offset,2, ENC_BIG_ENDIAN);
819 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_sz, tvb, offset,2, ENC_BIG_ENDIAN);
822 LB_uid_len = tvb_get_guint8(tvb, offset);
825 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_LB_uid_len, tvb, offset,1, ENC_BIG_ENDIAN);
828 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_LB_uid, tvb,offset,LB_uid_len,FALSE);
829 offset+=(guint8)LB_uid_len;
832 grp_name_len = tvb_get_guint8(tvb, offset);
836 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_grp_name_len,tvb,offset,1,ENC_BIG_ENDIAN);
840 proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_grp_name,tvb,offset,grp_name_len,FALSE);
841 offset+=grp_name_len;
848 static guint32 dissect_grp_memdatacomp(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
853 proto_item *grp_memdatacomp;
854 proto_tree *grp_memdatacomp_tree;
856 grp_memdatacomp = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Group Of Member Data");
857 grp_memdatacomp_tree = proto_item_add_subtree(grp_memdatacomp,ett_sasp_grp_memdatacomp);
860 proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp, tvb, offset,2, ENC_BIG_ENDIAN);
863 /* Group MEM Data Size*/
864 proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp_sz, tvb, offset,2, ENC_BIG_ENDIAN);
867 mem_cnt=tvb_get_ntohs(tvb, offset);
869 /* Group MEM Data Count*/
870 proto_tree_add_item(grp_memdatacomp_tree, hf_sasp_grp_memdatacomp_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
873 offset = dissect_grpdatacomp(tvb,grp_memdatacomp_tree, offset);
875 /* array of memdata */
876 for( i=0; i< mem_cnt; i++)
878 offset=dissect_memdatacomp(tvb,grp_memdatacomp_tree, offset);
887 static void dissect_wt_req(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
890 proto_item *get_wt_data;
891 proto_tree *get_wt_tree;
896 get_wt_data = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Get Wt Req");
897 get_wt_tree = proto_item_add_subtree(get_wt_data,ett_sasp_getwt);
900 proto_tree_add_item(get_wt_tree, hf_sasp_wt_req_sz, tvb, offset, 2, ENC_BIG_ENDIAN);
903 gd_cnt=tvb_get_ntohs(tvb, offset);
905 /* Group Data Count */
906 proto_tree_add_item(get_wt_tree,hf_sasp_wt_req_gd_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
909 for( i=0; i<gd_cnt; i++)
911 offset = dissect_grpdatacomp(tvb,get_wt_tree,offset);
917 static void dissect_wt_rep(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
923 proto_tree *wt_rep_tree;
925 wt_rep = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Get Weights Reply");
926 wt_rep_tree = proto_item_add_subtree(wt_rep,ett_sasp_wt_rep);
929 proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_sz, tvb, offset,2, ENC_BIG_ENDIAN);
933 proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_rcode,tvb,offset,1,ENC_BIG_ENDIAN);
937 proto_tree_add_item(wt_rep_tree, hf_sasp_wt_rep_interval,tvb,offset,2,ENC_BIG_ENDIAN);
941 gwed_cnt=tvb_get_ntohs(tvb, offset);
943 /* Count of Group of Wt Entry Data */
944 proto_tree_add_item(wt_rep_tree,hf_sasp_wt_rep_gwed_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
948 for( i=0; i<gwed_cnt; i++)
950 offset =dissect_grp_wt_entry_datacomp(tvb,wt_rep_tree,offset);
957 static void dissect_setlbstate_req(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
962 static const int *lbflags[] = {
965 &hf_sasp_nochangeflag,
970 proto_item *setlbstate_req;
971 proto_tree *setlbstate_req_tree;
973 setlbstate_req = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Set LB State Req");
974 setlbstate_req_tree = proto_item_add_subtree(setlbstate_req,ett_sasp_setlbstate_req);
977 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_sz, tvb, offset,2, ENC_BIG_ENDIAN);
980 LB_uid_len = tvb_get_guint8(tvb, offset);
984 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_uid_len, tvb, offset,1, ENC_BIG_ENDIAN);
988 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_uid, tvb,offset,LB_uid_len,FALSE);
989 offset+=(guint8)LB_uid_len;
992 proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_health, tvb, offset,1, ENC_BIG_ENDIAN);
996 proto_tree_add_bitmask_text(setlbstate_req_tree,tvb,offset, 1, "LB Flags:", NULL,
997 ett_setlbstate_req_lbflag, lbflags, TRUE,0);
1007 static void dissect_setlbstate_rep(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
1010 proto_item *setlbstate_rep;
1011 proto_tree *setlbstate_rep_tree;
1013 setlbstate_rep = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Set LB State Rep");
1014 setlbstate_rep_tree = proto_item_add_subtree(setlbstate_rep,ett_sasp_setlbstate_rep);
1018 proto_tree_add_item(setlbstate_rep_tree, hf_sasp_setlbstate_rep_sz, tvb, offset,2, ENC_BIG_ENDIAN);
1022 proto_tree_add_item(setlbstate_rep_tree, hf_sasp_setlbstate_rep_rcode,tvb,offset,1,ENC_BIG_ENDIAN);
1029 static guint32 dissect_grp_memstatedatacomp(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
1035 proto_item *grp_memstatedatacomp;
1036 proto_tree *grp_memstatedatacomp_tree;
1039 grp_memstatedatacomp = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Group Mem State Comp");
1040 grp_memstatedatacomp_tree = proto_item_add_subtree(grp_memstatedatacomp,ett_sasp_grp_memstatedatacomp);
1043 proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp, tvb, offset,2, ENC_BIG_ENDIAN);
1047 proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp_sz, tvb, offset,2, ENC_BIG_ENDIAN);
1050 mem_cnt=tvb_get_ntohs(tvb, offset);
1053 proto_tree_add_item(grp_memstatedatacomp_tree, hf_sasp_grp_memstatedatacomp_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
1056 /* Group Data TLV */
1057 offset = dissect_grpdatacomp(tvb,grp_memstatedatacomp_tree, offset);
1059 /* Array of Mem State Data */
1060 for( i=0; i< mem_cnt; i++)
1062 offset=dissect_memstatedatacomp(tvb,grp_memstatedatacomp_tree, offset);
1070 static guint32 dissect_memstatedatacomp(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
1073 proto_tree *memstatedatacomp_tree;
1074 proto_item *memstatedatacomp;
1075 guint8 memstate_flag;
1077 offset=dissect_memdatacomp(tvb,pay_load, offset);
1079 memstatedatacomp = proto_tree_add_text(memdatacomp_tree,tvb,offset,-1 ,"Member State Data");
1080 memstatedatacomp_tree = proto_item_add_subtree(memstatedatacomp, ett_sasp_memstatedatacomp);
1083 proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_instance, tvb, offset,2, ENC_BIG_ENDIAN);
1087 proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_sz, tvb, offset,2, ENC_BIG_ENDIAN);
1091 proto_tree_add_item(memstatedatacomp_tree, hf_sasp_memstatedatacomp_state, tvb, offset,1, ENC_BIG_ENDIAN);
1095 memstate_flag = tvb_get_guint8(tvb, offset);
1096 proto_tree_add_boolean(memstatedatacomp_tree,hf_sasp_memstatedatacomp_quiesce_flag,tvb,offset,1,memstate_flag);
1104 static guint32 dissect_weight_entry_data_comp(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
1107 proto_tree *weight_entry_data_comp_tree;
1108 proto_item *weight_entry_data_comp;
1110 static const int *wtflags[] = {
1111 &hf_sasp_wed_contactsuccess_flag,
1112 &hf_sasp_wed_quiesce_flag,
1113 &hf_sasp_wed_registration_flag,
1114 &hf_sasp_wed_confident_flag,
1119 offset=dissect_memdatacomp(tvb,pay_load, offset);
1121 weight_entry_data_comp = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Weight Entry Data");
1122 weight_entry_data_comp_tree = proto_item_add_subtree(weight_entry_data_comp,ett_sasp_weight_entry_data_comp);
1125 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_type, tvb, offset,2, ENC_BIG_ENDIAN);
1129 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_sz, tvb, offset,2, ENC_BIG_ENDIAN);
1133 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_state, tvb, offset,1, ENC_BIG_ENDIAN);
1137 proto_tree_add_bitmask_text(weight_entry_data_comp_tree,tvb,offset, 1, "Flags:", NULL,
1138 ett_wt_entry_data_flag, wtflags, TRUE,0);
1144 proto_tree_add_item(weight_entry_data_comp_tree, hf_sasp_weight_entry_data_comp_weight, tvb, offset,2, ENC_BIG_ENDIAN);
1152 static guint32 dissect_grp_wt_entry_datacomp(tvbuff_t *tvb,proto_tree *pay_load,guint32 offset)
1155 guint16 wt_entry_cnt;
1157 proto_item *grp_wt_entry_datacomp;
1158 proto_tree *grp_wt_entry_datacomp_tree;
1160 grp_wt_entry_datacomp = proto_tree_add_text(pay_load,tvb,offset,-1 ,"Group of Wt Entry Data");
1161 grp_wt_entry_datacomp_tree = proto_item_add_subtree(grp_wt_entry_datacomp, ett_sasp_grp_wt_entry_datacomp);
1164 proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_type, tvb, offset,2, ENC_BIG_ENDIAN);
1168 proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_sz, tvb, offset,2, ENC_BIG_ENDIAN);
1171 wt_entry_cnt=tvb_get_ntohs(tvb, offset);
1174 proto_tree_add_item(grp_wt_entry_datacomp_tree, hf_sasp_grp_wt_entry_datacomp_cnt,tvb,offset,2,ENC_BIG_ENDIAN);
1178 offset = dissect_grpdatacomp(tvb,grp_wt_entry_datacomp_tree, offset);
1181 for( i=0; i<wt_entry_cnt; i++)
1183 offset=dissect_weight_entry_data_comp(tvb,grp_wt_entry_datacomp_tree, offset);
1192 /* sasp protocol register */
1193 void proto_register_sasp(void)
1196 static hf_register_info hf[] = {
1200 { "Type", "sasp.msg.type", FT_UINT16, BASE_HEX, NULL, 0x0,
1201 "SASP Header", HFILL } },
1204 { "Length", "sasp.header.Len", FT_UINT16, BASE_DEC, NULL, 0x0,
1205 "SASP Header Length", HFILL } },
1208 { "Version", "sasp.version", FT_UINT8, BASE_DEC, NULL, 0x0,
1209 "SASP Version", HFILL } },
1212 { "Message Len", "sasp.msg.len", FT_UINT32, BASE_DEC, NULL, 0x0,
1213 "SASP Msg Len", HFILL } },
1216 { "Message Id", "sasp.msg.id", FT_UINT32, BASE_DEC, NULL, 0x0,
1217 "SASP Msg Id", HFILL } },
1221 { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX,VALS(msg_table), 0x0,
1222 "SASP Msg Type", HFILL } },
1225 { &hf_sasp_reg_req_sz,
1226 { "Reg Req-Size", "sasp.reg-req.size", FT_UINT32, BASE_DEC, NULL, 0x0,
1227 "SASP Reg Req Size", HFILL } },
1229 { &hf_reg_req_lbflag,
1230 { "Reg Req-LB Flag", "sasp.reg-req.lbflag", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1231 "SASP Reg Req LB Flag", HFILL } },
1234 { "Grp Mem Data-Count", "sasp.grp-mem-data.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1235 "SASP Grp Mem Data Count", HFILL } },
1239 { &hf_sasp_reg_rep_sz,
1240 { "Reg Reply-Size", "sasp.reg-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1241 "SASP Reg Reply size", HFILL } },
1243 { &hf_sasp_reg_rep_rcode,
1244 { "Reg Reply-Return Code", "sasp.reg-rep.retcode", FT_UINT8, BASE_HEX, VALS(reg_reply_response_code), 0x0,
1245 "SASP Reg Rep Return Code", HFILL } },
1248 { &hf_sasp_dereg_req_sz,
1249 { "Dereg Req-Size", "sasp.dereg-req.size", FT_UINT32, BASE_DEC, NULL, 0x0,
1250 "SASP Dereg Req Size", HFILL } },
1252 { &hf_dereg_req_lbflag,
1253 { "Dereg Req-LB Flag", "sasp.dereg-req.lbflag", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1254 "SASP Dereg Req LB Flag", HFILL } },
1256 { &hf_dereg_req_reason_flag,
1257 { "Reason Flags","sasp.flags.reason", FT_UINT8, BASE_HEX, NULL, 0x0,
1260 { &hf_dereg_req_reason,
1261 { "Dereg Req-Reason", "sasp.dereg-req.reason", FT_UINT8, BASE_HEX, NULL, 0x0,
1262 "SASP Dereg Req Reason", HFILL } },
1265 { &hf_sasp_dereg_rep_sz,
1266 { "Dereg Rep-Size", "sasp.dereg-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1267 "SASP Dereg Rep Size", HFILL } },
1269 { &hf_sasp_dereg_rep_rcode,
1270 { "Dereg Rep-Return Code", "sasp.dereg-rep.retcode", FT_UINT8, BASE_HEX, VALS(dereg_reply_response_code), 0x0,
1271 "SASP Dereg Rep Return Code", HFILL } },
1275 { &hf_sasp_sendwt_sz,
1276 { "Sendwt-Size", "sasp.sendwt.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1277 "SASP Sendwt-Size", HFILL } },
1279 { &hf_sasp_sendwt_gwedcnt,
1280 { "Sendwt-Grp Wt EntryData Count", "sasp.sendwt-grp-wtentrydata.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1281 "SASP Sendwt Grp Wt Entry Data Count", HFILL } },
1283 /*Set Mem State Req*/
1285 { &hf_sasp_setmemstate_req_sz,
1286 { "Set Memstate Req-Size", "sasp.setmemstate-req.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1287 "SASP Set Memstate Req Size", HFILL } },
1289 { &hf_setmemstate_req_lbflag,
1290 { "Set Memstate Req-LB Flag", "sasp.setmemstate-req.lbflag", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
1291 "SASP Set Memstate Req LB Flag", HFILL } },
1293 { &hf_sasp_setmemstate_req_gmsd_cnt,
1294 { "Set Memstate Req-Gmsd Count", "sasp.group-memstate.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1295 "Group Of Member State Data Count", HFILL } },
1297 /* Set Mem State Reply */
1298 { &hf_sasp_setmemstate_rep,
1299 { "Set Memstate Reply", "sasp.setmemstate-rep", FT_UINT32, BASE_HEX, NULL, 0x0,
1300 "SASP Set Memstate Reply", HFILL } },
1302 { &hf_sasp_setmemstate_rep_sz,
1303 { "Set Memstate Rep-Size", "sasp.setmemstate-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1304 "SASP Set Memstate Rep Size", HFILL } },
1306 { &hf_sasp_setmemstate_rep_rcode,
1307 { "Set Memstate Rep-Return Code", "sasp.setmemstate-rep.retcode", FT_UINT8, BASE_HEX, VALS(set_mem_state_reply_response_code), 0x0,
1308 "SASP Set Memstate Rep Return Code", HFILL } },
1310 /*Mem Data Component*/
1312 { &hf_sasp_memdatacomp_type,
1313 { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX, VALS(msg_table), 0x0,
1314 "SASP Mem Data Comp", HFILL } },
1316 { &hf_sasp_memdatacomp_sz,
1317 { "Mem Data Comp-Size", "sasp.memdatacomp.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1318 "SASP Mem Data Comp Size", HFILL } },
1320 { &hf_sasp_memdatacomp_protocol,
1321 { "Mem Data Comp-Protocol", "sasp.memdatacomp.protocol", FT_UINT8, BASE_HEX, VALS(protocol_table), 0x0,
1322 "SASP Mem Data Comp Protocol", HFILL } },
1324 { &hf_sasp_memdatacomp_port,
1325 { "Mem Data Comp-Port", "sasp.memdatacomp.port", FT_UINT16, BASE_DEC, NULL, 0x0,
1326 "SASP Mem Data Comp Port", HFILL } },
1328 { &hf_sasp_memdatacomp_ip,
1329 { "Mem Data Comp-Ip", "sasp.memdatacomp.ip", FT_IPv6, BASE_NONE, NULL, 0x0,
1330 "SASP Mem Data Comp Ip", HFILL } },
1332 { &hf_sasp_memdatacomp_lab_len,
1333 { "Mem Data Comp-Label Len", "sasp.memdatacomp.label.len", FT_UINT8, BASE_DEC, NULL, 0x0,
1334 "SASP Mem Data Comp Label Length", HFILL } },
1336 { &hf_sasp_memdatacomp_label,
1337 { "Mem Data Comp-Label", "sasp.memdatacomp.label", FT_STRING, BASE_NONE, NULL, 0x0,
1338 "SASP Mem Data Comp Label", HFILL } },
1340 /*Get Weight Request*/
1342 { &hf_sasp_wt_req_sz,
1343 { "Get Wt Req-Size", "sasp.getwt.req.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1344 "SASP Get Wt Req Size", HFILL } },
1346 { &hf_sasp_wt_req_gd_cnt,
1347 { "Get Wt Req-Grp Data Count", "sasp.getwt-req-grpdata.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1348 "SASP Get Wt Grp Data Count", HFILL } },
1350 /*Get Weight Reply*/
1352 { &hf_sasp_wt_rep_sz,
1353 { "Get Wt Rep-Size", "sasp.getwt.rep.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1354 "SASP Get Wt Rep Size", HFILL } },
1356 { &hf_sasp_wt_rep_rcode,
1357 { "Get Wt Rep-Return Code", "sasp.getwt-rep.retcode", FT_UINT8, BASE_HEX, VALS(get_weights_reply_response_code), 0x0,
1358 "SASP Get Wt Rep Return Code", HFILL } },
1360 { &hf_sasp_wt_rep_interval,
1361 { "Get Wt Rep-Interval", "sasp.getwt-rep.interval", FT_UINT8, BASE_DEC, NULL, 0x0,
1362 "SASP Get Wt Rep Interval", HFILL } },
1364 { &hf_sasp_wt_rep_gwed_cnt,
1365 { "Get Wt Rep-Grp WtEntry Data Cnt", "sasp.getwt-rep-grpwtentrydata.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1366 "SASP Get Wt Rep Grp Wt Entry Data Cnt", HFILL } },
1368 /*Set LB State Rep */
1370 { &hf_sasp_setlbstate_rep,
1371 { "Set Lbstate Rep", "sasp.msg.type", FT_UINT32, BASE_HEX, NULL, 0x0,
1372 "SASP Set Lbstate Rep", HFILL } },
1374 { &hf_sasp_setlbstate_rep_sz,
1375 { "Set Lbstate Rep-Size", "sasp.setlbstate-rep.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1376 "SASP Set Lbstate Rep Size", HFILL } },
1378 { &hf_sasp_setlbstate_rep_rcode,
1379 { "Set Lbstate Rep-Return Code", "sasp.setlbstate-rep.retcode", FT_UINT8, BASE_HEX, VALS(set_lb_state_reply_response_code), 0x0,
1380 "SASP Set Lbstate Rep Return Code", HFILL } },
1385 { &hf_sasp_grpdatacomp,
1386 { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX, VALS(msg_table), 0x0,
1387 "SASP Grp Data Comp", HFILL } },
1389 { &hf_sasp_grpdatacomp_sz,
1390 { "Grp Data Comp-Size","sasp.grpdatacomp.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1391 "SASP Grp Data Comp size", HFILL } },
1393 { &hf_sasp_grpdatacomp_LB_uid_len,
1394 { "Grp Data Comp-Label UID Len","sasp.grpdatacomp.label.uid.len", FT_UINT8, BASE_DEC, NULL, 0x0,
1395 "SASP Grp Data Comp Label Uid Len", HFILL } },
1397 { &hf_sasp_grpdatacomp_LB_uid,
1398 { "Grp Data Comp-Label UID","sasp.grpdatacomp.label.uid", FT_STRING, BASE_NONE, NULL, 0x0,
1399 "SASP Grp Data Comp Label Uid",HFILL } },
1401 { &hf_sasp_grpdatacomp_grp_name_len,
1402 { "Grp Data Comp-Grp Name Len","sasp.grpdatacomp.grpname.len", FT_UINT8, BASE_DEC, NULL, 0x0,
1403 "SASP Grp Data Comp Grp Name Len",HFILL } },
1405 { &hf_sasp_grpdatacomp_grp_name,
1406 { "Grp Data Comp-Grp Name","sasp.grpdatacomp.grpname", FT_STRING, BASE_NONE, NULL, 0x0,
1407 "SASP Grp Data Comp Grp Name", HFILL } },
1409 /*grp mem data comp */
1411 { &hf_sasp_grp_memdatacomp,
1412 { "Message Type","sasp.msg.type", FT_UINT16, BASE_HEX, VALS(msg_table), 0x0,
1413 "SASP Grp Mem Data Comp", HFILL } },
1416 { &hf_sasp_grp_memdatacomp_sz,
1417 { "Grp Mem Data Comp-Size","sasp.grp-memdatacomp.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1418 "SASP Grp Mem Data Comp Size", HFILL } },
1420 { &hf_sasp_grp_memdatacomp_cnt,
1421 { "Grp Mem Data Comp-Count","sasp.grp.memdatacomp.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1422 "SASP Grp Mem Data Comp Cnt", HFILL } },
1425 /*set LB state req*/
1427 { &hf_sasp_setlbstate_req_sz,
1428 { "Set LB State Req-Size", "sasp.setlbstate-req.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1429 "SASP Set LB State Req Size", HFILL } },
1431 { &hf_sasp_setlbstate_req_LB_uid_len,
1432 { "Set LB State Req-LB UID Len", "sasp.setlbstate-req.lbuid.len", FT_UINT8, BASE_DEC, NULL, 0x0,
1433 "SASP Set LB State Req LB Uid Len", HFILL } },
1435 { &hf_sasp_setlbstate_req_LB_uid,
1436 { "Set LB State Req-LB UID", "sasp.setlbstate-req.lbuid", FT_STRING, BASE_NONE, NULL, 0x0,
1437 "SASP Set LB State Req LB UID", HFILL } },
1439 { &hf_sasp_setlbstate_req_LB_health,
1440 { "Set LB State Req-LB Health", "sasp.setlbstate-req.lbhealth", FT_UINT8, BASE_HEX, VALS(lbstate_healthtable), 0x0,
1441 "SASP Set LB State Req LB Health", HFILL } },
1444 { "Flags","sasp.flags.lbstate", FT_UINT8, BASE_HEX, NULL, 0x0,
1447 { &hf_sasp_pushflag,
1448 { "PUSH", "sasp.flags.push", FT_BOOLEAN, 8, NULL, SASP_PUSH_FLAG,
1449 "SASP Push Flag", HFILL }},
1451 { &hf_sasp_trustflag,
1452 { "TRUST", "sasp.flags.trust", FT_BOOLEAN, 8, NULL, SASP_TRUST_FLAG,
1453 "SASP Trust Flag", HFILL }},
1455 { &hf_sasp_nochangeflag,
1456 { "NOCHANGE", "sasp.flags.nochange", FT_BOOLEAN, 8, NULL, SASP_NOCHANGE_FLAG,
1457 "SASP Nochange Flag", HFILL }},
1459 /*grp mem state data comp */
1461 { &hf_sasp_grp_memstatedatacomp,
1462 { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX, VALS(msg_table), 0x0,
1463 "SASP Message Type", HFILL } },
1466 { &hf_sasp_grp_memstatedatacomp_sz,
1467 { "Grp Mem State-Size", "sasp.grp.memstate.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1468 "SASP Grp Mem State Data Comp Size", HFILL } },
1470 { &hf_sasp_grp_memstatedatacomp_cnt,
1471 { "Grp Mem State-Count", "sasp.grp.memstate.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1472 "SASP Grp Mem State Data Comp Count", HFILL } },
1474 /*mem state instance */
1476 { &hf_sasp_memstatedatacomp_instance,
1477 { "Message Type", "sasp.msg.type", FT_UINT16, BASE_HEX, VALS(msg_table), 0x0,
1478 "SASP Message Type", HFILL } },
1481 { &hf_sasp_memstatedatacomp_sz,
1482 { "Mem State-Size", "sasp.memstate.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1483 "SASP Mem State Data Comp Size", HFILL } },
1485 { &hf_sasp_memstatedatacomp_state,
1486 { "Mem State-State", "sasp.memstate.state", FT_UINT8, BASE_HEX, NULL, 0x0,
1487 "SASP Mem State Data Comp State", HFILL } },
1489 { &hf_sasp_memstatedatacomp_quiesce_flag,
1490 { "Mem State-Quiesce Flag", "sasp.flags.quiesce", FT_BOOLEAN, 8, NULL, SASP_QUIESCE_FLAG,
1491 "SASP Quiesce Flag", HFILL }},
1494 /*weight entry data comp*/
1496 { &hf_sasp_weight_entry_data_comp_type,
1497 { "Wt Entry Data Comp", "sasp.msg.type", FT_UINT16, BASE_HEX, VALS(msg_table), 0x0,
1498 "SASP Wt Entry Data Comp", HFILL } },
1500 { &hf_sasp_weight_entry_data_comp_sz,
1501 { "Wt Entry Data Comp-Size", "sasp.wtentry.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1502 "SASP Wt Entry Data Comp Size", HFILL } },
1504 { &hf_sasp_weight_entry_data_comp_state,
1505 { "Wt Entry Data Comp-state", "sasp.wtentry.state", FT_UINT8, BASE_HEX, NULL, 0x0,
1506 "SASP Wt Entry Data Comp State", HFILL } },
1509 { "Flags","sasp.flags.wtstate", FT_UINT8, BASE_HEX, NULL, 0x0,
1512 { &hf_sasp_wed_contactsuccess_flag,
1513 { "Contact Success", "sasp.flags.contactsuccess", FT_BOOLEAN, 8, NULL, SASP_WED_CONTACT_SUCCESS_FLAG,
1514 "SASP Contact Success Flag", HFILL }},
1516 { &hf_sasp_wed_quiesce_flag,
1517 { "Quiesce", "sasp.flags.quiesce", FT_BOOLEAN, 8, NULL, SASP_WED_QUIESCE_FLAG,
1518 "SASP Quiesce Flag", HFILL }},
1520 { &hf_sasp_wed_registration_flag,
1521 { "Registration", "sasp.flags.registration", FT_BOOLEAN, 8, NULL, SASP_WED_REG_FLAG,
1522 "SASP Registration Flag", HFILL }},
1524 { &hf_sasp_wed_confident_flag,
1525 { "Confident", "sasp.flags.confident", FT_BOOLEAN, 8, NULL, SASP_WED_CONF_FLAG,
1526 "SASP Confident Flag", HFILL }},
1528 { &hf_sasp_weight_entry_data_comp_weight,
1529 { "Wt Entry Data Comp-weight", "sasp.wtentrydatacomp.weight", FT_UINT16, BASE_DEC, NULL, 0x0,
1530 "SASP Wt Entry Data Comp weight", HFILL } },
1533 /*grp wt entry data comp */
1535 { &hf_sasp_grp_wt_entry_datacomp_type,
1536 { "Grp Wt Entry Data Comp", "sasp.msg.type", FT_UINT16, BASE_HEX, VALS(msg_table), 0x0,
1537 "SASP Grp Wt Entry Data Comp", HFILL } },
1539 { &hf_sasp_grp_wt_entry_datacomp_sz,
1540 { "Grp Wt Entry Data Comp Size", "sasp.grp-wtentrydata.size", FT_UINT16, BASE_DEC, NULL, 0x0,
1541 "SASP Grp Wt Entry Data Comp Size", HFILL } },
1543 { &hf_sasp_grp_wt_entry_datacomp_cnt,
1544 { "Grp Wt Entry Data Comp Cnt", "sasp.grp-wtentrydata.count", FT_UINT16, BASE_DEC, NULL, 0x0,
1545 "SASP Grp Wt Entry Data Comp Cnt", HFILL } },
1549 /* Setup protocol subtree array */
1551 static gint *ett[] = {
1558 &ett_sasp_reg_req_sz,
1559 &ett_sasp_dereg_req_sz,
1560 &ett_sasp_dereg_rep,
1562 &ett_sasp_setmemstate_req,
1563 &ett_sasp_setmemstate_rep,
1564 &ett_sasp_memdatacomp,
1565 &ett_sasp_grpdatacomp,
1566 &ett_sasp_grp_memdatacomp,
1567 &ett_sasp_setlbstate_req,
1568 &ett_sasp_setlbstate_rep,
1570 &ett_setlbstate_req_lbflag,
1571 &ett_sasp_grp_memstatedatacomp,
1572 &ett_sasp_memstatedatacomp,
1573 /* &ett_dereg_req_reason_flag,*/
1574 &ett_sasp_grp_wt_entry_datacomp,
1575 &ett_sasp_weight_entry_data_comp,
1576 &ett_wt_entry_data_flag,
1580 module_t *sasp_module;
1582 proto_sasp = proto_register_protocol("Server/Application State Protocol","SASP","sasp");
1584 proto_register_field_array(proto_sasp, hf, array_length(hf)); /*Registering Field Array */
1585 proto_register_subtree_array(ett, array_length(ett)); /*registering subtree*/
1587 sasp_module = prefs_register_protocol(proto_sasp, NULL);
1588 prefs_register_bool_preference(sasp_module, "desegment_sasp_messages",
1589 "Reassemble SASP messages spanning multiple TCP segments",
1590 "Whether the SASP dissector should reassemble messages spanning multiple TCP segments."
1591 " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\""
1592 " in the TCP protocol settings.",
1600 /* Handing off to TCP */
1602 proto_reg_handoff_sasp(void)
1604 dissector_handle_t sasp_handle;
1605 sasp_handle = create_dissector_handle(dissect_sasp, proto_sasp);
1606 dissector_add_uint("tcp.port", SASP_GLOBAL_PORT, sasp_handle);