2 # ain conformation file
11 # Removed as they are giving 'defined but not used' warnings currently.
20 DisplayInformation/notificationIndicator displayInformation_notificationIndicator
21 Reject/problem/invoke invokeproblem
22 Action8/invoke action8_invoke
24 #.OMIT_ASSIGNMENT Remote-Operations-Information-Objects
31 OPERATION.&ArgumentType
34 # This table creates the value_string to name AIN operation codes and errors
35 # in file packet-ain-table.c which is included in the template file
39 static const value_string ain_opr_code_strings[] = {
40 #.TABLE_BODY OPERATION.&operationCode
41 { %(&operationCode)-40s, "%(_ident)s" },
49 static const value_string ain_err_code_string_vals[] = {
50 #.TABLE_BODY ERROR.&errorCode
51 { %(&errorCode)-40s, "%(_ident)s" },
57 # This table creates the switch() to branch on AIN operation codes and errors
58 # in file packet-ain-table2.c which is included in the template file
61 static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx) {
64 #.TABLE2_BODY OPERATION.&ArgumentType
65 case %(&operationCode)s: /* %(_ident)s */
66 offset= %(_argument_pdu)s(tvb, actx->pinfo , tree , NULL);
70 proto_tree_add_expert_format(tree, actx->pinfo, &ei_ain_unknown_invokeData,
71 tvb, offset, -1, "Unknown invokeData %d", opcode);
72 /* todo call the asn.1 dissector */
79 static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) {
81 #.TABLE2_BODY OPERATION.&ResultType
82 case %(&operationCode)s: /* %(_ident)s */
83 offset= %(_result_pdu)s(tvb, actx->pinfo , tree , NULL);
87 proto_tree_add_expert_format(tree, actx->pinfo, &ei_ain_unknown_returnResultData,
88 tvb, offset, -1, "Unknown returnResultData %d", opcode);
94 static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,asn1_ctx_t *actx) {
96 #.TABLE2_BODY ERROR.&ParameterType
97 case %(&errorCode)s: /* %(_ident)s */
98 offset= %(_parameter_pdu)s(tvb, actx->pinfo , tree , NULL);
102 proto_tree_add_expert_format(tree, actx->pinfo, &ei_ain_unknown_returnErrorData,
103 tvb, offset, -1, "Unknown returnErrorData %d", opcode);
109 # Create a table of opcode and corresponding args and res
111 typedef struct _ain_op_t {
117 static const ain_op_t ain_op_tab[] = {
118 #.TABLE11_BODY OPERATION.&operationCode
119 /* %(_name)-31s */ { %(&operationCode)-40s, %(_argument_pdu)-45s, %(_result_pdu)s },
125 typedef struct _ain_err_t {
130 static const ain_err_t ain_err_tab[] = {
131 #.TABLE11_BODY ERROR.&errorCode
132 /* %(_name)-30s */ { %(&errorCode)4s, %(_parameter_pdu)s },
137 # ROS stuff here XXX change when TCAP is redone.
139 #.FN_BODY Code/local VAL_PTR = &opcode
141 if (ain_opcode_type == AIN_OPCODE_RETURN_ERROR){
143 col_append_str(actx->pinfo->cinfo, COL_INFO, val_to_str(errorCode, ain_err_code_string_vals, "Unknown AIN error (%%u)"));
144 col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
145 col_set_fence(actx->pinfo->cinfo, COL_INFO);
147 col_append_str(actx->pinfo->cinfo, COL_INFO, val_to_str(opcode, ain_opr_code_strings, "Unknown AIN (%%u)"));
148 col_append_str(actx->pinfo->cinfo, COL_INFO, " ");
149 col_set_fence(actx->pinfo->cinfo, COL_INFO);
154 ain_opcode_type=AIN_OPCODE_INVOKE;
156 #.FN_HDR ReturnResult
158 ain_opcode_type=AIN_OPCODE_RETURN_RESULT;
162 ain_opcode_type=AIN_OPCODE_RETURN_ERROR;
166 ain_opcode_type=AIN_OPCODE_REJECT;
168 #.FN_BODY Invoke/argument
170 offset = dissect_invokeData(tree, tvb, offset, actx);
172 #.FN_BODY ReturnResult/result/result
174 offset = dissect_returnResultData(tree, tvb, offset, actx);
176 #.FN_BODY ReturnError/parameter
178 offset = dissect_returnErrorData(tree, tvb, offset, actx);
181 #.FN_PARS ExtensionParameter/assignmentAuthority
182 FN_VARIANT = _str HF_INDEX = hf_ain_ext_type_oid VAL_PTR = &actx->external.direct_reference
184 #.FN_BODY ExtensionParameter/parameters
185 offset=call_ber_oid_callback(actx->external.direct_reference, tvb, offset, actx->pinfo, tree, NULL);
187 #.FN_BODY AINDigits VAL_PTR = ¶meter_tvb
188 tvbuff_t *parameter_tvb;
196 subtree = proto_item_add_subtree(actx->created_item, ett_ain_digits);
197 proto_tree_add_item(subtree, hf_ain_odd_even_indicator, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
198 proto_tree_add_item(subtree, hf_ain_nature_of_address, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
200 proto_tree_add_item(subtree, hf_ain_numbering_plan, parameter_tvb, 1, 1, ENC_BIG_ENDIAN);
202 proto_tree_add_item(subtree, hf_ain_bcd_digits, parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb, 2), ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN);
204 #.FN_BODY CarrierFormat VAL_PTR = ¶meter_tvb
205 tvbuff_t *parameter_tvb;
213 subtree = proto_item_add_subtree(actx->created_item, ett_ain_carrierformat);
214 /* Carrier Selection */
215 proto_tree_add_item(subtree, hf_ain_carrier_selection, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
216 /* Nature of Carrier Number of Digits (always 4 )*/
217 proto_tree_add_item(subtree, hf_ain_nature_of_carrier, parameter_tvb, 1, 1, ENC_BIG_ENDIAN);
218 proto_tree_add_item(subtree, hf_ain_nr_digits, parameter_tvb, 1, 1, ENC_BIG_ENDIAN);
220 /* 2nd Digit 1st Digit .. */
221 proto_tree_add_item(subtree, hf_ain_carrier_bcd_digits, parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb, 2), ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN);
223 #.FN_BODY AMAslpID VAL_PTR = ¶meter_tvb
224 tvbuff_t *parameter_tvb;
232 subtree = proto_item_add_subtree(actx->created_item, ett_ain_amaslpid);
234 proto_tree_add_item(subtree, hf_ain_amaslpid, parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb, 0), ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN);
237 DisplayInformation/notificationIndicator ABBREV=displayInformation.notificationIndicator
238 Reject/problem/invoke ABBREV=invokeproblem
239 Action8/invoke ABBREV=action8.invoke
243 # Editor modelines - https://www.wireshark.org/tools/modelines.html
248 # indent-tabs-mode: nil
251 # vi: set shiftwidth=2 tabstop=8 expandtab:
252 # :indentSize=2:tabSize=8:noTabs=true: