diff options
Diffstat (limited to 'asn1/ros')
-rw-r--r-- | asn1/ros/ros-err.cnf | 44 | ||||
-rw-r--r-- | asn1/ros/ros-inv.cnf | 45 | ||||
-rw-r--r-- | asn1/ros/ros-rej.cnf | 19 | ||||
-rw-r--r-- | asn1/ros/ros-res.cnf | 44 |
4 files changed, 152 insertions, 0 deletions
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 |