aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'asn1')
-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
13 files changed, 175 insertions, 195 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