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/q932 | |
parent | b2020800688458627abae49f331560c14b55e135 (diff) |
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/q932')
-rw-r--r-- | asn1/q932/Makefile | 4 | ||||
-rw-r--r-- | asn1/q932/Makefile.nmake | 4 | ||||
-rw-r--r-- | asn1/q932/packet-q932-ros-template.c | 1 | ||||
-rw-r--r-- | asn1/q932/q932-ros.cnf | 97 |
4 files changed, 10 insertions, 96 deletions
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 |