aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>2007-09-24 11:01:53 +0000
committerkukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7>2007-09-24 11:01:53 +0000
commit256266acdc90940b507143e8ac95773e6c9c8ec3 (patch)
tree863015b9909ec8016dce882eef61928e08bdbcc9
parent5f38b7749f9af06b365803164dac95e9605be0ff (diff)
improvements in ROS handling in Q.932 and H.450
move common ROS code into ros/ros-*.cnf files git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22936 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--asn1/h225/h225.cnf1
-rw-r--r--asn1/h450/Makefile4
-rw-r--r--asn1/h450/Makefile.nmake4
-rw-r--r--asn1/h450/h450-ros-exp.cnf4
-rw-r--r--asn1/h450/h450-ros.cnf99
-rw-r--r--asn1/q932/Makefile4
-rw-r--r--asn1/q932/Makefile.nmake4
-rw-r--r--asn1/q932/packet-q932-ros-template.c1
-rw-r--r--asn1/q932/q932-ros.cnf97
-rw-r--r--asn1/ros/ros-err.cnf44
-rw-r--r--asn1/ros/ros-inv.cnf45
-rw-r--r--asn1/ros/ros-rej.cnf19
-rw-r--r--asn1/ros/ros-res.cnf44
-rw-r--r--epan/asn1.h4
-rw-r--r--epan/dissectors/packet-h225.c2
-rw-r--r--epan/dissectors/packet-h450-ros.c99
-rw-r--r--epan/dissectors/packet-h450-ros.h4
-rw-r--r--epan/dissectors/packet-h450.c2
-rw-r--r--epan/dissectors/packet-q932-ros.c112
-rw-r--r--epan/libwireshark.def1
20 files changed, 326 insertions, 268 deletions
diff --git a/asn1/h225/h225.cnf b/asn1/h225/h225.cnf
index b311ca0c99..236c3ae28d 100644
--- a/asn1/h225/h225.cnf
+++ b/asn1/h225/h225.cnf
@@ -605,4 +605,5 @@ FastStart/_item TYPE = FT_UINT32 DISPLAY = BASE_DEC
ParallelH245Control/_item TYPE = FT_UINT32 DISPLAY = BASE_DEC
H245Control/_item TYPE = FT_UINT32 DISPLAY = BASE_DEC
GloballyUniqueID TYPE = FT_GUID DISPLAY = BASE_NONE
+H323-UU-PDU/h4501SupplementaryService/_item TYPE = FT_UINT32 DISPLAY = BASE_DEC
#.END
diff --git a/asn1/h450/Makefile b/asn1/h450/Makefile
index 4769142b14..ffd26d795b 100644
--- a/asn1/h450/Makefile
+++ b/asn1/h450/Makefile
@@ -15,8 +15,8 @@ generate_dissector: $(DISSECTOR_FILES)
$(H450_FILES): ../../tools/asn2wrs.py $(H450_ASN) $(H450_OP_ASN) packet-h450-template.c h450.cnf
python ../../tools/asn2wrs.py -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template $(H450_ASN) $(H450_OP_ASN)
-$(H450_ROS_FILES): ../../tools/asn2wrs.py $(H450_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf
- python ../../tools/asn2wrs.py -e -p $(PROTOCOL_NAME).ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(H450_ROS_ASN)
+$(H450_ROS_FILES): ../../tools/asn2wrs.py $(H450_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf ../ros/ros-inv.cnf ../ros/ros-res.cnf ../ros/ros-err.cnf ../ros/ros-rej.cnf
+ python ../../tools/asn2wrs.py -e -p $(PROTOCOL_NAME).ros -I ../ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(H450_ROS_ASN)
clean:
rm -f parsetab.py $(DISSECTOR_FILES)
diff --git a/asn1/h450/Makefile.nmake b/asn1/h450/Makefile.nmake
index 4cd8aff7cd..588166aa80 100644
--- a/asn1/h450/Makefile.nmake
+++ b/asn1/h450/Makefile.nmake
@@ -26,9 +26,9 @@ $(H450_FILES): ../../tools/asn2wrs.py $(H450_ASN) $(H450_OP_ASN) packet-$(PROTOC
@exit 1
!ENDIF
-$(H450_ROS_FILES): ../../tools/asn2wrs.py $(H450_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf
+$(H450_ROS_FILES): ../../tools/asn2wrs.py $(H450_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf ../ros/ros-inv.cnf ../ros/ros-res.cnf ../ros/ros-err.cnf ../ros/ros-rej.cnf
!IFDEF PYTHON
- $(PYTHON) "../../tools/asn2wrs.py" -e -p $(PROTOCOL_NAME).ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(H450_ROS_ASN)
+ $(PYTHON) "../../tools/asn2wrs.py" -e -p $(PROTOCOL_NAME).ros -I ../ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(H450_ROS_ASN)
!ELSE
@echo Error: You need Python to use asn2wrs.py
@exit 1
diff --git a/asn1/h450/h450-ros-exp.cnf b/asn1/h450/h450-ros-exp.cnf
index d379db5e5c..80b77a0cc5 100644
--- a/asn1/h450/h450-ros-exp.cnf
+++ b/asn1/h450/h450-ros-exp.cnf
@@ -1,7 +1,7 @@
# Do not modify this file.
# It is created automatically by the ASN.1 to Wireshark dissector compiler
-# .\h450-ros-exp.cnf
-# ../../tools/asn2wrs.py -e -p h450.ros -c h450-ros.cnf -o h450-ros -s packet-h450-ros-template ../ros/Remote-Operations-Information-Objects.asn Remote-Operations-Apdus.asn
+# ./h450-ros-exp.cnf
+# ../../tools/asn2wrs.py -e -p h450.ros -I ../ros -c h450-ros.cnf -o h450-ros -s packet-h450-ros-template ../ros/Remote-Operations-Information-Objects.asn Remote-Operations-Apdus.asn
#.MODULE
Remote-Operations-Information-Objects h450.ros
diff --git a/asn1/h450/h450-ros.cnf b/asn1/h450/h450-ros.cnf
index ce7f484676..9f7fd1963c 100644
--- a/asn1/h450/h450-ros.cnf
+++ b/asn1/h450/h450-ros.cnf
@@ -71,37 +71,9 @@ Invoke/argument TYPE = FT_BYTES DISPLAY = BASE_HEX
#.FN_PARS Invoke/argument
FN_VARIANT = _pdu
TYPE_REF_FN = argument_cb
-
-#.FN_HDR Invoke
- dissector_handle_t arg_handle = NULL;
-
- arg_next_tvb = NULL;
-#.FN_FTR Invoke
- actx->rose_ctx->d.pdu = 1;
-
- if (actx->rose_ctx->d.code == 0) {
- arg_handle = dissector_get_port_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
- arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
- } else {
- arg_handle = NULL;
- }
-
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " INV:");
- 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)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
- else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
- }
- if (!arg_next_tvb) { /* empty argument */
- arg_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
- }
- actx->pinfo->private_data = actx->rose_ctx;
- call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
#.END
+#.INCLUDE ros-inv.cnf
#--- RETURN RESULT ---
@@ -112,38 +84,10 @@ ReturnResult/result/result TYPE = FT_BYTES DISPLAY = BASE_HEX
FN_VARIANT = _pdu
TYPE_REF_FN = result_cb
-#.FN_HDR ReturnResult
- dissector_handle_t res_handle = NULL;
-
- res_next_tvb = NULL;
-#.FN_FTR ReturnResult
- actx->rose_ctx->d.pdu = 2;
-
- if (actx->rose_ctx->d.code == 0) {
- res_handle = dissector_get_port_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
- res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
- } else {
- res_handle = NULL;
- }
-
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " RES:");
- if (!res_handle ||
- !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
- if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
- else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
- else if (actx->rose_ctx->d.code == -1) /* Code not available */
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " -");
- }
- if (!res_next_tvb) { /* empty result */
- res_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
- }
- actx->pinfo->private_data = actx->rose_ctx;
- call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
#.END
+#.INCLUDE ros-res.cnf
+
#--- RETURN ERROR ---
#.FIELD_ATTR
@@ -152,41 +96,10 @@ ReturnError/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX
#.FN_PARS ReturnError/parameter
FN_VARIANT = _pdu
TYPE_REF_FN = error_cb
-
-#.FN_HDR ReturnError
- dissector_handle_t err_handle = NULL;
-
- err_next_tvb = NULL;
-#.FN_FTR ReturnError
- actx->rose_ctx->d.pdu = 3;
-
- if (actx->rose_ctx->d.code == 0) {
- err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
- err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
- } else {
- err_handle = NULL;
- }
-
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " ERR:");
- if (!err_handle ||
- !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
- if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
- else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
- }
- if (!err_next_tvb) { /* empty error */
- err_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
- }
- actx->pinfo->private_data = actx->rose_ctx;
- call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
#.END
+#.INCLUDE ros-err.cnf
+
#--- REJECT ---
-#.FN_HDR Reject
- problem_str[0] = '\0';
-#.FN_FTR Reject
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " REJ: %s", problem_str);
-#.END
+#.INCLUDE ros-rej.cnf
diff --git a/asn1/q932/Makefile b/asn1/q932/Makefile
index 7f5b2a8d71..1fa6c0cae6 100644
--- a/asn1/q932/Makefile
+++ b/asn1/q932/Makefile
@@ -14,8 +14,8 @@ generate_dissector: $(DISSECTOR_FILES)
$(Q932_FILES): ../../tools/asn2wrs.py $(Q932_ASN) packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
python ../../tools/asn2wrs.py -b -T -X -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template $(Q932_ASN)
-$(Q932_ROS_FILES): ../../tools/asn2wrs.py $(Q932_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf
- python ../../tools/asn2wrs.py -b -T -X -e -p $(PROTOCOL_NAME).ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(Q932_ROS_ASN)
+$(Q932_ROS_FILES): ../../tools/asn2wrs.py $(Q932_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf ../ros/ros-inv.cnf ../ros/ros-res.cnf ../ros/ros-err.cnf ../ros/ros-rej.cnf
+ python ../../tools/asn2wrs.py -b -T -X -e -p $(PROTOCOL_NAME).ros -I ../ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(Q932_ROS_ASN)
clean:
rm -f parsetab.py $(DISSECTOR_FILES)
diff --git a/asn1/q932/Makefile.nmake b/asn1/q932/Makefile.nmake
index 68229ac96c..404d1cd809 100644
--- a/asn1/q932/Makefile.nmake
+++ b/asn1/q932/Makefile.nmake
@@ -25,9 +25,9 @@ $(Q932_FILES): ../../tools/asn2wrs.py $(Q932_ASN) packet-$(PROTOCOL_NAME)-templa
@exit 1
!ENDIF
-$(Q932_ROS_FILES): ../../tools/asn2wrs.py $(Q932_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf
+$(Q932_ROS_FILES): ../../tools/asn2wrs.py $(Q932_ROS_ASN) packet-$(PROTOCOL_NAME)-ros-template.c $(PROTOCOL_NAME)-ros.cnf ../ros/ros-inv.cnf ../ros/ros-res.cnf ../ros/ros-err.cnf ../ros/ros-rej.cnf
!IFDEF PYTHON
- $(PYTHON) "../../tools/asn2wrs.py" -b -T -X -p $(PROTOCOL_NAME).ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(Q932_ROS_ASN)
+ $(PYTHON) "../../tools/asn2wrs.py" -b -T -X -p $(PROTOCOL_NAME).ros -I ../ros -c $(PROTOCOL_NAME)-ros.cnf -o $(PROTOCOL_NAME)-ros -s packet-$(PROTOCOL_NAME)-ros-template $(Q932_ROS_ASN)
!ELSE
@echo Error: You need Python to use asn2wrs.py
@exit 1
diff --git a/asn1/q932/packet-q932-ros-template.c b/asn1/q932/packet-q932-ros-template.c
index f2404b5d8e..30805fece4 100644
--- a/asn1/q932/packet-q932-ros-template.c
+++ b/asn1/q932/packet-q932-ros-template.c
@@ -30,7 +30,6 @@
#include <string.h>
#include <epan/packet.h>
-#include <epan/prefs.h>
#include <epan/strutil.h>
#include <epan/emem.h>
#include <epan/asn1.h>
diff --git a/asn1/q932/q932-ros.cnf b/asn1/q932/q932-ros.cnf
index bdf39ab616..e97fd83e5c 100644
--- a/asn1/q932/q932-ros.cnf
+++ b/asn1/q932/q932-ros.cnf
@@ -74,37 +74,9 @@ Invoke/argument TYPE = FT_BYTES DISPLAY = BASE_HEX
arg_next_tvb = tvb_new_subset(tvb, offset, len, len);
offset += tvb_length_remaining(tvb, offset);
-
-#.FN_HDR Invoke
- dissector_handle_t arg_handle = NULL;
-
- arg_next_tvb = NULL;
-#.FN_FTR Invoke
- actx->rose_ctx->d.pdu = 1;
-
- if (actx->rose_ctx->d.code == 0) {
- arg_handle = dissector_get_port_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
- arg_handle = dissector_get_string_handle(actx->rose_ctx->arg_global_dissector_table, actx->rose_ctx->d.code_global);
- } else {
- arg_handle = NULL;
- }
-
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " INV:");
- 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)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
- else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
- }
- if (!arg_next_tvb) { /* empty argument */
- arg_next_tvb = tvb_new_subset(tvb, offset, 0, 0);
- }
- actx->pinfo->private_data = actx->rose_ctx;
- call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
#.END
+#.INCLUDE ros-inv.cnf
#--- RETURN RESULT ---
@@ -121,36 +93,10 @@ ReturnResult/result/result TYPE = FT_BYTES DISPLAY = BASE_HEX
offset += tvb_length_remaining(tvb, offset);
-#.FN_HDR ReturnResult
- dissector_handle_t res_handle = NULL;
-
- res_next_tvb = NULL;
-#.FN_FTR ReturnResult
- actx->rose_ctx->d.pdu = 2;
-
- if (actx->rose_ctx->d.code == 0) {
- res_handle = dissector_get_port_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
- res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
- } else {
- res_handle = NULL;
- }
-
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " RES:");
- if (!res_handle ||
- !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
- if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
- else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
- }
- if (!res_next_tvb) { /* empty result */
- res_next_tvb = tvb_new_subset(tvb, offset, 0, 0);
- }
- actx->pinfo->private_data = actx->rose_ctx;
- call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
#.END
+#.INCLUDE ros-res.cnf
+
#--- RETURN ERROR ---
#.FIELD_ATTR
@@ -166,41 +112,10 @@ ReturnError/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX
err_next_tvb = tvb_new_subset(tvb, offset, len, len);
offset += tvb_length_remaining(tvb, offset);
-
-#.FN_HDR ReturnError
- dissector_handle_t err_handle = NULL;
-
- err_next_tvb = NULL;
-#.FN_FTR ReturnError
- actx->rose_ctx->d.pdu = 3;
-
- if (actx->rose_ctx->d.code == 0) {
- err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
- err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
- } else {
- err_handle = NULL;
- }
-
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " ERR:");
- if (!err_handle ||
- !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
- if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
- else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
- }
- if (!err_next_tvb) { /* empty error */
- err_next_tvb = tvb_new_subset(tvb, offset, 0, 0);
- }
- actx->pinfo->private_data = actx->rose_ctx;
- call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
#.END
+#.INCLUDE ros-err.cnf
+
#--- REJECT ---
-#.FN_HDR Reject
- problem_str[0] = '\0';
-#.FN_FTR Reject
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " REJ: %s", problem_str);
-#.END
+#.INCLUDE ros-rej.cnf
diff --git a/asn1/ros/ros-err.cnf b/asn1/ros/ros-err.cnf
new file mode 100644
index 0000000000..dba299ad1a
--- /dev/null
+++ b/asn1/ros/ros-err.cnf
@@ -0,0 +1,44 @@
+# ros-err.cnf
+# ROS ReturnError common code
+# Copyright 2007 Tomas Kukosa
+# $Id$
+
+#.FN_HDR ReturnError
+ dissector_handle_t err_handle = NULL;
+ const gchar *descr = "";
+
+ err_next_tvb = NULL;
+#.FN_FTR ReturnError
+ actx->rose_ctx->d.pdu = 3;
+
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) {
+ err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
+ } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) {
+ err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
+ } else {
+ err_handle = NULL;
+ }
+
+ if (!err_handle ||
+ !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
+ if (actx->rose_ctx->d.code == 0)
+ descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local);
+ else if (actx->rose_ctx->d.code == 1)
+ descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("ERR:");
+ }
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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 (!err_next_tvb) { /* empty error */
+ err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
+ }
+ actx->pinfo->private_data = actx->rose_ctx;
+ call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
+#.END
diff --git a/asn1/ros/ros-inv.cnf b/asn1/ros/ros-inv.cnf
new file mode 100644
index 0000000000..3822413ed9
--- /dev/null
+++ b/asn1/ros/ros-inv.cnf
@@ -0,0 +1,45 @@
+# ros-inv.cnf
+# ROS Invoke common code
+# Copyright 2007 Tomas Kukosa
+# $Id$
+
+
+#.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_port_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 = ep_strdup_printf("INV: %d", actx->rose_ctx->d.code_local);
+ else if (actx->rose_ctx->d.code == 1)
+ descr = ep_strdup_printf("INV: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("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 && check_col(actx->pinfo->cinfo, COL_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);
+ }
+ actx->pinfo->private_data = actx->rose_ctx;
+ call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
+#.END
diff --git a/asn1/ros/ros-rej.cnf b/asn1/ros/ros-rej.cnf
new file mode 100644
index 0000000000..a651953dec
--- /dev/null
+++ b/asn1/ros/ros-rej.cnf
@@ -0,0 +1,19 @@
+# ros-rej.cnf
+# ROS Reject common code
+# Copyright 2007 Tomas Kukosa
+# $Id$
+
+#.FN_HDR Reject
+ const gchar *descr = "";
+
+ problem_str[0] = '\0';
+#.FN_FTR Reject
+ descr = ep_strdup_printf("REJ: %s", problem_str);
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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);
+#.END
diff --git a/asn1/ros/ros-res.cnf b/asn1/ros/ros-res.cnf
new file mode 100644
index 0000000000..218d1c7357
--- /dev/null
+++ b/asn1/ros/ros-res.cnf
@@ -0,0 +1,44 @@
+# ros-res.cnf
+# ROS ReturnResult common code
+# Copyright 2007 Tomas Kukosa
+# $Id$
+
+#.FN_HDR ReturnResult
+ dissector_handle_t res_handle = NULL;
+ const gchar *descr = "";
+
+ res_next_tvb = NULL;
+#.FN_FTR ReturnResult
+ actx->rose_ctx->d.pdu = 2;
+
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) {
+ res_handle = dissector_get_port_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
+ } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->res_global_dissector_table) {
+ res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
+ } else {
+ res_handle = NULL;
+ }
+
+ if (!res_handle ||
+ !proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
+ if (actx->rose_ctx->d.code == 0)
+ descr = ep_strdup_printf("RES: %d", actx->rose_ctx->d.code_local);
+ else if (actx->rose_ctx->d.code == 1)
+ descr = ep_strdup_printf("RES: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("RES:");
+ }
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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 (!res_next_tvb) { /* empty result */
+ res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
+ }
+ actx->pinfo->private_data = actx->rose_ctx;
+ call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
+#.END
diff --git a/epan/asn1.h b/epan/asn1.h
index 02d5a51a62..aafad94e8a 100644
--- a/epan/asn1.h
+++ b/epan/asn1.h
@@ -141,7 +141,11 @@ typedef struct _rose_ctx_t {
dissector_table_t res_local_dissector_table;
dissector_table_t err_global_dissector_table;
dissector_table_t err_local_dissector_table;
+ /* filling in description into tree, info column, any buffer */
int apdu_depth;
+ gboolean fillin_info;
+ gchar *fillin_ptr;
+ gsize fillin_buf_size;
struct { /* "dynamic" data */
gint pdu;
/*
diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c
index 6c61ee39be..1962bb3b40 100644
--- a/epan/dissectors/packet-h225.c
+++ b/epan/dissectors/packet-h225.c
@@ -7505,7 +7505,7 @@ void proto_register_h225(void) {
"h225.T_h4501SupplementaryService", HFILL }},
{ &hf_h225_h4501SupplementaryService_item,
{ "Item", "h225.h4501SupplementaryService_item",
- FT_BYTES, BASE_HEX, NULL, 0,
+ FT_UINT32, BASE_DEC, NULL, 0,
"h225.T_h4501SupplementaryService_item", HFILL }},
{ &hf_h225_h245Tunneling,
{ "h245Tunneling", "h225.h245Tunneling",
diff --git a/epan/dissectors/packet-h450-ros.c b/epan/dissectors/packet-h450-ros.c
index a56ead68a3..5b2784e397 100644
--- a/epan/dissectors/packet-h450-ros.c
+++ b/epan/dissectors/packet-h450-ros.c
@@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
-/* .\packet-h450-ros.c */
-/* ../../tools/asn2wrs.py -e -p h450.ros -c h450-ros.cnf -o h450-ros -s packet-h450-ros-template ../ros/Remote-Operations-Information-Objects.asn Remote-Operations-Apdus.asn */
+/* ./packet-h450-ros.c */
+/* ../../tools/asn2wrs.py -e -p h450.ros -I ../ros -c h450-ros.cnf -o h450-ros -s packet-h450-ros-template ../ros/Remote-Operations-Information-Objects.asn Remote-Operations-Apdus.asn */
/* Input file: packet-h450-ros-template.c */
@@ -208,35 +208,45 @@ static const per_sequence_t Invoke_sequence[] = {
static int
dissect_h450_ros_Invoke(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 76 "h450-ros.cnf"
+#line 8 "ros-inv.cnf"
dissector_handle_t arg_handle = NULL;
+ const gchar *descr = "";
arg_next_tvb = NULL;
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_h450_ros_Invoke, Invoke_sequence);
-#line 80 "h450-ros.cnf"
+#line 13 "ros-inv.cnf"
actx->rose_ctx->d.pdu = 1;
- if (actx->rose_ctx->d.code == 0) {
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->arg_local_dissector_table) {
arg_handle = dissector_get_port_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
+ } 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;
}
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " INV:");
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)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
+ descr = ep_strdup_printf("INV: %d", actx->rose_ctx->d.code_local);
else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
+ descr = ep_strdup_printf("INV: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("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 && check_col(actx->pinfo->cinfo, COL_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, offset>>3, 0, 0);
+ arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
@@ -277,37 +287,45 @@ static const per_sequence_t ReturnResult_sequence[] = {
static int
dissect_h450_ros_ReturnResult(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 116 "h450-ros.cnf"
+#line 7 "ros-res.cnf"
dissector_handle_t res_handle = NULL;
+ const gchar *descr = "";
res_next_tvb = NULL;
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_h450_ros_ReturnResult, ReturnResult_sequence);
-#line 120 "h450-ros.cnf"
+#line 12 "ros-res.cnf"
actx->rose_ctx->d.pdu = 2;
- if (actx->rose_ctx->d.code == 0) {
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) {
res_handle = dissector_get_port_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
+ } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->res_global_dissector_table) {
res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
} else {
res_handle = NULL;
}
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " RES:");
if (!res_handle ||
!proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
+ descr = ep_strdup_printf("RES: %d", actx->rose_ctx->d.code_local);
else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
- else if (actx->rose_ctx->d.code == -1) /* Code not available */
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " -");
+ descr = ep_strdup_printf("RES: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("RES:");
}
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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 (!res_next_tvb) { /* empty result */
- res_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
+ res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
@@ -334,35 +352,45 @@ static const per_sequence_t ReturnError_sequence[] = {
static int
dissect_h450_ros_ReturnError(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 157 "h450-ros.cnf"
+#line 7 "ros-err.cnf"
dissector_handle_t err_handle = NULL;
+ const gchar *descr = "";
err_next_tvb = NULL;
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_h450_ros_ReturnError, ReturnError_sequence);
-#line 161 "h450-ros.cnf"
+#line 12 "ros-err.cnf"
actx->rose_ctx->d.pdu = 3;
- if (actx->rose_ctx->d.code == 0) {
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) {
err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
+ } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) {
err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
} else {
err_handle = NULL;
}
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " ERR:");
if (!err_handle ||
!proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
+ descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local);
else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
+ descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("ERR:");
}
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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 (!err_next_tvb) { /* empty error */
- err_next_tvb = tvb_new_subset(tvb, offset>>3, 0, 0);
+ err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
@@ -488,14 +516,23 @@ static const per_sequence_t Reject_sequence[] = {
static int
dissect_h450_ros_Reject(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 189 "h450-ros.cnf"
+#line 7 "ros-rej.cnf"
+ const gchar *descr = "";
+
problem_str[0] = '\0';
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_h450_ros_Reject, Reject_sequence);
-#line 191 "h450-ros.cnf"
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " REJ: %s", problem_str);
+#line 11 "ros-rej.cnf"
+ descr = ep_strdup_printf("REJ: %s", problem_str);
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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);
return offset;
}
diff --git a/epan/dissectors/packet-h450-ros.h b/epan/dissectors/packet-h450-ros.h
index fc790fcb49..935357c847 100644
--- a/epan/dissectors/packet-h450-ros.h
+++ b/epan/dissectors/packet-h450-ros.h
@@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
-/* .\packet-h450-ros.h */
-/* ../../tools/asn2wrs.py -e -p h450.ros -c h450-ros.cnf -o h450-ros -s packet-h450-ros-template ../ros/Remote-Operations-Information-Objects.asn Remote-Operations-Apdus.asn */
+/* ./packet-h450-ros.h */
+/* ../../tools/asn2wrs.py -e -p h450.ros -I ../ros -c h450-ros.cnf -o h450-ros -s packet-h450-ros-template ../ros/Remote-Operations-Information-Objects.asn Remote-Operations-Apdus.asn */
/* Input file: packet-h450-ros-template.h */
diff --git a/epan/dissectors/packet-h450.c b/epan/dissectors/packet-h450.c
index 05db2fc411..9922326249 100644
--- a/epan/dissectors/packet-h450.c
+++ b/epan/dissectors/packet-h450.c
@@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
-/* .\packet-h450.c */
+/* ./packet-h450.c */
/* ../../tools/asn2wrs.py -c h450.cnf -s packet-h450-template H4501-Supplementary-ServiceAPDU-Structure.asn Addressing-Data-Elements.asn H225-generic-parameters-definition.asn Manufacturer-specific-service-extension-definition.asn H4501-General-Error-List.asn Call-Transfer-Operations.asn Call-Diversion-Operations.asn Call-Hold-Operations.asn Call-Park-Pickup-Operations.asn Call-Waiting-Operations.asn Message-Waiting-Indication-Operations.asn Name-Operations.asn Call-Completion-Operations.asn Call-Offer-Operations.asn Call-Intrusion-Operations.asn Common-Information-Operations.asn */
/* Input file: packet-h450-template.c */
diff --git a/epan/dissectors/packet-q932-ros.c b/epan/dissectors/packet-q932-ros.c
index d353396031..5e57ce353b 100644
--- a/epan/dissectors/packet-q932-ros.c
+++ b/epan/dissectors/packet-q932-ros.c
@@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* ./packet-q932-ros.c */
-/* ../../tools/asn2wrs.py -b -T -X -e -p q932.ros -c q932-ros.cnf -o q932-ros -s packet-q932-ros-template ../ros/Remote-Operations-Information-Objects.asn Facility-Information-Element-Components.asn */
+/* ../../tools/asn2wrs.py -b -T -X -p q932.ros -I ../ros -c q932-ros.cnf -o q932-ros -s packet-q932-ros-template ../ros/Remote-Operations-Information-Objects.asn Facility-Information-Element-Components.asn */
/* Input file: packet-q932-ros-template.c */
@@ -38,7 +38,6 @@
#include <string.h>
#include <epan/packet.h>
-#include <epan/prefs.h>
#include <epan/strutil.h>
#include <epan/emem.h>
#include <epan/asn1.h>
@@ -80,7 +79,7 @@ static int hf_q932_ros_present = -1; /* INTEGER */
static int hf_q932_ros_InvokeId_present = -1; /* InvokeId_present */
/*--- End of included file: packet-q932-ros-hf.c ---*/
-#line 47 "packet-q932-ros-template.c"
+#line 46 "packet-q932-ros-template.c"
/* Initialize the subtree pointers */
@@ -98,7 +97,7 @@ static gint ett_q932_ros_T_problem = -1;
static gint ett_q932_ros_InvokeId = -1;
/*--- End of included file: packet-q932-ros-ett.c ---*/
-#line 50 "packet-q932-ros-template.c"
+#line 49 "packet-q932-ros-template.c"
/* Preferences */
@@ -257,7 +256,6 @@ dissect_q932_ros_InvokeArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
offset += tvb_length_remaining(tvb, offset);
-
return offset;
}
@@ -272,35 +270,45 @@ static const ber_sequence_t Invoke_sequence[] = {
static int
dissect_q932_ros_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 79 "q932-ros.cnf"
+#line 8 "ros-inv.cnf"
dissector_handle_t arg_handle = NULL;
+ const gchar *descr = "";
arg_next_tvb = NULL;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Invoke_sequence, hf_index, ett_q932_ros_Invoke);
-#line 83 "q932-ros.cnf"
+#line 13 "ros-inv.cnf"
actx->rose_ctx->d.pdu = 1;
- if (actx->rose_ctx->d.code == 0) {
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->arg_local_dissector_table) {
arg_handle = dissector_get_port_handle(actx->rose_ctx->arg_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
+ } 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;
}
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " INV:");
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)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
+ descr = ep_strdup_printf("INV: %d", actx->rose_ctx->d.code_local);
else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
+ descr = ep_strdup_printf("INV: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("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 && check_col(actx->pinfo->cinfo, COL_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, offset, 0, 0);
+ arg_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
@@ -312,7 +320,7 @@ dissect_q932_ros_Invoke(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_q932_ros_ResultArgument(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 115 "q932-ros.cnf"
+#line 87 "q932-ros.cnf"
gint len;
len = tvb_length_remaining(tvb, offset);
@@ -351,35 +359,45 @@ static const ber_sequence_t ReturnResult_sequence[] = {
static int
dissect_q932_ros_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 125 "q932-ros.cnf"
+#line 7 "ros-res.cnf"
dissector_handle_t res_handle = NULL;
+ const gchar *descr = "";
res_next_tvb = NULL;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ReturnResult_sequence, hf_index, ett_q932_ros_ReturnResult);
-#line 129 "q932-ros.cnf"
+#line 12 "ros-res.cnf"
actx->rose_ctx->d.pdu = 2;
- if (actx->rose_ctx->d.code == 0) {
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->res_local_dissector_table) {
res_handle = dissector_get_port_handle(actx->rose_ctx->res_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
+ } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->res_global_dissector_table) {
res_handle = dissector_get_string_handle(actx->rose_ctx->res_global_dissector_table, actx->rose_ctx->d.code_global);
} else {
res_handle = NULL;
}
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " RES:");
if (!res_handle ||
!proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(res_handle)))) {
if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
+ descr = ep_strdup_printf("RES: %d", actx->rose_ctx->d.code_local);
else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
+ descr = ep_strdup_printf("RES: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("RES:");
}
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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 (!res_next_tvb) { /* empty result */
- res_next_tvb = tvb_new_subset(tvb, offset, 0, 0);
+ res_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
@@ -391,7 +409,7 @@ dissect_q932_ros_ReturnResult(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
static int
dissect_q932_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 160 "q932-ros.cnf"
+#line 106 "q932-ros.cnf"
gint len;
@@ -403,7 +421,6 @@ dissect_q932_ros_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
offset += tvb_length_remaining(tvb, offset);
-
return offset;
}
@@ -417,35 +434,45 @@ static const ber_sequence_t ReturnError_sequence[] = {
static int
dissect_q932_ros_ReturnError(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 171 "q932-ros.cnf"
+#line 7 "ros-err.cnf"
dissector_handle_t err_handle = NULL;
+ const gchar *descr = "";
err_next_tvb = NULL;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
ReturnError_sequence, hf_index, ett_q932_ros_ReturnError);
-#line 175 "q932-ros.cnf"
+#line 12 "ros-err.cnf"
actx->rose_ctx->d.pdu = 3;
- if (actx->rose_ctx->d.code == 0) {
+ if ((actx->rose_ctx->d.code == 0) && actx->rose_ctx->err_local_dissector_table) {
err_handle = dissector_get_port_handle(actx->rose_ctx->err_local_dissector_table, actx->rose_ctx->d.code_local);
- } else if (actx->rose_ctx->d.code == 1) {
+ } else if ((actx->rose_ctx->d.code == 1) && actx->rose_ctx->err_global_dissector_table) {
err_handle = dissector_get_string_handle(actx->rose_ctx->err_global_dissector_table, actx->rose_ctx->d.code_global);
} else {
err_handle = NULL;
}
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " ERR:");
if (!err_handle ||
!proto_is_protocol_enabled(find_protocol_by_id(dissector_handle_get_protocol_index(err_handle)))) {
if (actx->rose_ctx->d.code == 0)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %d", actx->rose_ctx->d.code_local);
+ descr = ep_strdup_printf("ERR: %d", actx->rose_ctx->d.code_local);
else if (actx->rose_ctx->d.code == 1)
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " %s", actx->rose_ctx->d.code_global);
+ descr = ep_strdup_printf("ERR: %s", actx->rose_ctx->d.code_global);
+ } else {
+ descr = ep_strdup_printf("ERR:");
}
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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 (!err_next_tvb) { /* empty error */
- err_next_tvb = tvb_new_subset(tvb, offset, 0, 0);
+ err_next_tvb = tvb_new_subset(tvb, (actx->encoding==ASN1_ENC_PER)?offset>>3:offset, 0, 0);
}
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
@@ -575,14 +602,23 @@ static const ber_sequence_t Reject_sequence[] = {
static int
dissect_q932_ros_Reject(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 203 "q932-ros.cnf"
+#line 7 "ros-rej.cnf"
+ const gchar *descr = "";
+
problem_str[0] = '\0';
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Reject_sequence, hf_index, ett_q932_ros_Reject);
-#line 205 "q932-ros.cnf"
- proto_item_append_text(proto_item_get_parent_nth(proto_tree_get_parent(tree), actx->rose_ctx->apdu_depth), " REJ: %s", problem_str);
+#line 11 "ros-rej.cnf"
+ descr = ep_strdup_printf("REJ: %s", problem_str);
+
+ 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 && check_col(actx->pinfo->cinfo, COL_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);
return offset;
}
@@ -630,7 +666,7 @@ static int dissect_ROS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree
/*--- End of included file: packet-q932-ros-fn.c ---*/
-#line 65 "packet-q932-ros-template.c"
+#line 64 "packet-q932-ros-template.c"
/*--- dissect_q932_ros -----------------------------------------------------*/
static int dissect_q932_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
@@ -745,7 +781,7 @@ void proto_register_q932_ros(void) {
"q932_ros.InvokeId_present", HFILL }},
/*--- End of included file: packet-q932-ros-hfarr.c ---*/
-#line 79 "packet-q932-ros-template.c"
+#line 78 "packet-q932-ros-template.c"
};
/* List of subtrees */
@@ -765,7 +801,7 @@ void proto_register_q932_ros(void) {
&ett_q932_ros_InvokeId,
/*--- End of included file: packet-q932-ros-ettarr.c ---*/
-#line 84 "packet-q932-ros-template.c"
+#line 83 "packet-q932-ros-template.c"
};
/* Register protocol and dissector */
diff --git a/epan/libwireshark.def b/epan/libwireshark.def
index 3e93055236..5fa25162ba 100644
--- a/epan/libwireshark.def
+++ b/epan/libwireshark.def
@@ -725,6 +725,7 @@ report_open_failure
report_read_failure
reset_tap_listeners
reset_tcp_reassembly
+rose_ctx_clean_data
rose_ctx_init
rpc_init_proc_table
rpc_init_prog