aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/ros/ros-inv.cnf
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/asn1/ros/ros-inv.cnf')
-rw-r--r--epan/dissectors/asn1/ros/ros-inv.cnf46
1 files changed, 46 insertions, 0 deletions
diff --git a/epan/dissectors/asn1/ros/ros-inv.cnf b/epan/dissectors/asn1/ros/ros-inv.cnf
new file mode 100644
index 0000000000..1bc9251c49
--- /dev/null
+++ b/epan/dissectors/asn1/ros/ros-inv.cnf
@@ -0,0 +1,46 @@
+# ros-inv.cnf
+# ROS Invoke common code
+# Copyright 2007 Tomas Kukosa
+
+#.FN_HDR Invoke
+ dissector_handle_t arg_handle = NULL;
+ const gchar *descr = "";
+
+ arg_next_tvb = NULL;
+#.FN_FTR Invoke
+ actx->rose_ctx->d.pdu = 1;
+
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->arg_local_dissector_table) {
+ arg_handle = dissector_get_uint_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
+ } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->arg_global_dissector_table) {
+ arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
+ } else {
+ arg_handle = NULL;
+ }
+
+ if (!arg_handle ||
+ !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(arg_handle)))) {
+ if (actx->rose_ctx->d.code == 0)
+ descr = wmem_strdup_printf(wmem_packet_scope(), "INV: %d", actx->rose_ctx->d.code_local);
+ else if (actx->rose_ctx->d.code == 1)
+ descr = wmem_strdup_printf(wmem_packet_scope(), "INV: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = wmem_strdup_printf(wmem_packet_scope(), "INV:");
+ }
+
+ if (actx->rose_ctx->apdu_depth >= 0)
+ proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", descr);
+ if (actx->rose_ctx->fillin_info)
+ col_append_str(actx->pinfo->cinfo, COL_INFO, descr);
+ if (actx->rose_ctx->fillin_ptr)
+ g_strlcat(actx->rose_ctx->fillin_ptr, descr, actx->rose_ctx->fillin_buf_size);
+
+ if (!arg_next_tvb) { /* empty argument */
+ arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
+ }
+
+ call_dissector_with_data((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree, actx->rose_ctx);
+ if (!arg_handle) {
+ expert_add_info_format(actx->pinfo, tree, &ei_ros_undecoded, "Undecoded %s", descr);
+ }
+#.END