This seems like an unnecessary encapsulation of registering a dissector, but it can be used at runtime and not just a handoff function.
Change-Id: Ic13e34b5cecf493115f27a984bb886f2f76bc7de
Reviewed-on: https://code.wireshark.org/review/12096
Reviewed-by: Michael Mann <mmann78@netscape.net>
};
void
-register_t124_ns_dissector(const char *nsKey, dissector_t dissector, int proto)
+register_t124_ns_dissector(const char *nsKey, new_dissector_t dissector, int proto)
{
dissector_handle_t dissector_handle;
- dissector_handle=create_dissector_handle(dissector, proto);
+ dissector_handle=new_create_dissector_handle(dissector, proto);
dissector_add_string("t124.ns", nsKey, dissector_handle);
}
-void register_t124_sd_dissector(packet_info *pinfo _U_, guint32 channelId_param, dissector_t dissector, int proto)
+void register_t124_sd_dissector(packet_info *pinfo _U_, guint32 channelId_param, new_dissector_t dissector, int proto)
{
/* XXX: we should keep the sub-dissectors list per conversation
as the same channels may be used.
dissector_handle_t dissector_handle;
- dissector_handle=create_dissector_handle(dissector, proto);
+ dissector_handle=new_create_dissector_handle(dissector, proto);
dissector_add_uint("t124.sd", channelId_param, dissector_handle);
}
extern guint32 t124_get_last_channelId(void);
extern void t124_set_top_tree(proto_tree *tree);
-extern void register_t124_ns_dissector(const char *nsKey, dissector_t dissector, int proto);
-extern void register_t124_sd_dissector(packet_info *pinfo, guint32 channelId, dissector_t dissector, int proto);
+extern void register_t124_ns_dissector(const char *nsKey, new_dissector_t dissector, int proto);
+extern void register_t124_sd_dissector(packet_info *pinfo, guint32 channelId, new_dissector_t dissector, int proto);
#include "packet-t124-exp.h"
return tree;
}
-static void
-dissect_rdp_SendData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_rdp_SendData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
proto_item *pi;
int offset = 0;
guint32 flags = 0;
break;
}
- return;
+ return tvb_captured_length(tvb);
} /* licensing stage */
if (rdp_info && (t124_get_last_channelId() == rdp_info->staticChannelId)) {
/* we may get multiple control headers in a single frame */
col_set_fence(pinfo->cinfo, COL_INFO);
- return;
+ return tvb_captured_length(tvb);
} /* (rdp_info && (t124_get_last_channelId() == rdp_info->staticChannelId)) */
/* Virtual Channel */
/*offset =*/ dissect_rdp_channelPDU(tvb, offset, pinfo, tree);
else
/*offset =*/ dissect_rdp_encrypted(tvb, offset, pinfo, tree, "Channel PDU");
+
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rdp_ClientData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_rdp_ClientData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
int offset = 0;
proto_item *pi;
proto_tree *next_tree;
}
offset += MAX(4, length); /* Use length from header, but advance at least 4 bytes */
}
+ return tvb_captured_length(tvb);
}
-static void
-dissect_rdp_ServerData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int
+dissect_rdp_ServerData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
int offset = 0;
proto_item *pi;
proto_tree *next_tree;
}
offset += MAX(4, length); /* Use length from header, but advance at least 4 bytes */
}
+ return tvb_captured_length(tvb);
}
/*--- proto_register_rdp -------------------------------------------*/
};
void
-register_t124_ns_dissector(const char *nsKey, dissector_t dissector, int proto)
+register_t124_ns_dissector(const char *nsKey, new_dissector_t dissector, int proto)
{
dissector_handle_t dissector_handle;
- dissector_handle=create_dissector_handle(dissector, proto);
+ dissector_handle=new_create_dissector_handle(dissector, proto);
dissector_add_string("t124.ns", nsKey, dissector_handle);
}
-void register_t124_sd_dissector(packet_info *pinfo _U_, guint32 channelId_param, dissector_t dissector, int proto)
+void register_t124_sd_dissector(packet_info *pinfo _U_, guint32 channelId_param, new_dissector_t dissector, int proto)
{
/* XXX: we should keep the sub-dissectors list per conversation
as the same channels may be used.
dissector_handle_t dissector_handle;
- dissector_handle=create_dissector_handle(dissector, proto);
+ dissector_handle=new_create_dissector_handle(dissector, proto);
dissector_add_uint("t124.sd", channelId_param, dissector_handle);
}
extern guint32 t124_get_last_channelId(void);
extern void t124_set_top_tree(proto_tree *tree);
-extern void register_t124_ns_dissector(const char *nsKey, dissector_t dissector, int proto);
-extern void register_t124_sd_dissector(packet_info *pinfo, guint32 channelId, dissector_t dissector, int proto);
+extern void register_t124_ns_dissector(const char *nsKey, new_dissector_t dissector, int proto);
+extern void register_t124_sd_dissector(packet_info *pinfo, guint32 channelId, new_dissector_t dissector, int proto);
/*--- Included file: packet-t124-exp.h ---*/