wireshark/asn1/q932/q932-ros.cnf

193 lines
6.5 KiB
INI

#.PDU_NEW
ROS
#.TYPE_RENAME
Invoke/argument InvokeArgument
ReturnResult/result/result ResultArgument
#.FIELD_RENAME
Invoke/linkedId/present linkedIdPresent
Reject/problem/invoke invokeProblem
Reject/problem/returnError returnErrorProblem
Reject/problem/returnResult returnResultProblem
ReturnResult/result/result resultArgument
#--- ROS ---
#.FN_PARS
ROS VAL_PTR = &%(ACTX)s->rose_ctx->d.pdu
#.FN_HDR ROS
/* will be moved to ROS_PDU when PDU function can be alternated from conformance file */
actx->rose_ctx = rose_ctx_tmp;
rose_ctx_clean_data(actx->rose_ctx);
#.END
#--- Code ---
#.FN_PARS
Code VAL_PTR = &%(ACTX)s->rose_ctx->d.code
Code/local VAL_PTR = &%(ACTX)s->rose_ctx->d.code_local
Code/global FN_VARIANT = _str VAL_PTR = &%(ACTX)s->rose_ctx->d.code_global
#.FN_FTR Code
actx->rose_ctx->d.code_item = actx->created_item;
#.END
#--- Problem ---
#.FN_PARS
GeneralProblem VAL_PTR = &problem_val
InvokeProblem VAL_PTR = &problem_val
ReturnResultProblem VAL_PTR = &problem_val
ReturnErrorProblem VAL_PTR = &problem_val
#.FN_FTR GeneralProblem
strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_GeneralProblem_vals), ""));
#.FN_FTR InvokeProblem
strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_InvokeProblem_vals), ""));
#.FN_FTR ReturnResultProblem
strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnResultProblem_vals), ""));
#.FN_FTR ReturnErrorProblem
strcpy(problem_str, val_to_str(problem_val, VALS(q932_ros_ReturnErrorProblem_vals), ""));
#.END
#--- INVOKE ---
#.FIELD_ATTR
Invoke/argument TYPE = FT_BYTES DISPLAY = BASE_HEX
#.FN_BODY Invoke/argument
gint len;
len = tvb_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
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
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) {
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((arg_handle)?arg_handle:data_handle, arg_next_tvb, actx->pinfo, tree);
}
#.END
#--- RETURN RESULT ---
#.FIELD_ATTR
ReturnResult/result/result TYPE = FT_BYTES DISPLAY = BASE_HEX
#.FN_BODY ReturnResult/result/result
gint len;
len = tvb_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
res_next_tvb = tvb_new_subset(tvb, offset, len, len);
offset += tvb_length_remaining(tvb, offset);
#.FN_HDR ReturnResult
dissector_handle_t res_handle = NULL;
res_next_tvb = NULL;
#.FN_FTR ReturnResult
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) {
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((res_handle)?res_handle:data_handle, res_next_tvb, actx->pinfo, tree);
}
#.END
#--- RETURN ERROR ---
#.FIELD_ATTR
ReturnError/parameter TYPE = FT_BYTES DISPLAY = BASE_HEX
#.FN_BODY ReturnError/parameter
gint len;
len = tvb_length_remaining(tvb, offset);
if (len)
proto_tree_add_item(tree, hf_index, tvb, offset, len, FALSE);
res_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
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) {
actx->pinfo->private_data = actx->rose_ctx;
call_dissector((err_handle)?err_handle:data_handle, err_next_tvb, actx->pinfo, tree);
}
#.END
#--- 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