diff options
author | Tomas Kukosa <tomas.kukosa@siemens.com> | 2007-09-24 11:01:53 +0000 |
---|---|---|
committer | Tomas Kukosa <tomas.kukosa@siemens.com> | 2007-09-24 11:01:53 +0000 |
commit | 138050c4ea596e554557ff4bc433674582189306 (patch) | |
tree | 863015b9909ec8016dce882eef61928e08bdbcc9 /asn1/h450 | |
parent | b2020800688458627abae49f331560c14b55e135 (diff) | |
download | wireshark-138050c4ea596e554557ff4bc433674582189306.tar.gz wireshark-138050c4ea596e554557ff4bc433674582189306.tar.bz2 wireshark-138050c4ea596e554557ff4bc433674582189306.zip |
improvements in ROS handling in Q.932 and H.450
move common ROS code into ros/ros-*.cnf files
svn path=/trunk/; revision=22936
Diffstat (limited to 'asn1/h450')
-rw-r--r-- | asn1/h450/Makefile | 4 | ||||
-rw-r--r-- | asn1/h450/Makefile.nmake | 4 | ||||
-rw-r--r-- | asn1/h450/h450-ros-exp.cnf | 4 | ||||
-rw-r--r-- | asn1/h450/h450-ros.cnf | 99 |
4 files changed, 12 insertions, 99 deletions
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 |