1# tcap.cnf
2# tcap conformation file
3
4#.NO_EMIT ONLY_VALS
5PackageType
6
7#.OMIT_ASSIGNMENT
8# Removed as they are giving 'defined but not used' warnings currently.
9Priority
10#.END
11
12#.FIELD_RENAME
13Invoke/parameter                        invoke_parameter
14ReturnResult/parameter                  returnResult_parameter
15ReturnError/parameter                   returnError_parameter
16Reject/parameter                        reject_parameter
17Abort/causeInformation/userInformation  abort_userInformation
18ErrorCode/private                       ec_private
19#.FIELD_ATTR
20ErrorCode/private ABBREV=ec_private
21#--- OperationCode ---
22
23#.FN_PARS
24OperationCode            VAL_PTR = &ansi_tcap_private.d.OperationCode
25OperationCode/private    VAL_PTR = &ansi_tcap_private.d.OperationCode_private
26#.FN_FTR OperationCode
27  ansi_tcap_private.d.OperationCode_item = actx->created_item;
28#.END
29
30#.FN_BODY OperationCode/national VAL_PTR = &ansi_tcap_private.d.OperationCode_national
31 proto_tree *subtree;
32 proto_item *spcifier_item;
33 int start_offset = offset;
34 guint8 family;
35 guint8 specifier;
36
37  %(DEFAULT_BODY)s
38  /* mask off the H bit */
39  ansi_tcap_private.d.OperationCode_national = (ansi_tcap_private.d.OperationCode_national&0x7fff);
40
41  subtree = proto_item_add_subtree(actx->created_item, ett_ansi_tcap_op_code_nat);
42  /* Bit H is used to distinguish between Operations that require a reply and those that do not. A value of 1
43   * indicates that a reply is required; a value of 0 indicates that a reply is not required.
44   */
45  family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8;
46  specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff);
47  proto_tree_add_item(subtree, hf_ansi_tcap_bit_h, tvb, start_offset, 2, ENC_BIG_ENDIAN);
48  proto_tree_add_item(subtree, hf_ansi_tcap_op_family, tvb, start_offset, 2, ENC_BIG_ENDIAN);
49  spcifier_item = proto_tree_add_item(subtree, hf_ansi_tcap_op_specifier, tvb, start_offset, 2, ENC_BIG_ENDIAN);
50
51  switch(family){
52	case 0:
53		/* All Families ( Not used ) */
54		break;
55	case 1:
56		/* Parameter */
57		if(specifier== 1){
58			proto_item_append_text(spcifier_item, " Provide Value");
59		}else if (specifier== 2){
60			proto_item_append_text(spcifier_item, " Set Value");
61		}
62		break;
63	case 2:
64		/* Charging */
65		if (specifier== 1){
66			proto_item_append_text(spcifier_item, " Bill Call");
67		}
68		break;
69	case 3:
70		/* Provide Instructions */
71		if (specifier== 1){
72			proto_item_append_text(spcifier_item, " Start");
73		}else if (specifier== 2){
74			proto_item_append_text(spcifier_item, " Assist");
75		}
76		break;
77	case 4:
78		/* Connection Control */
79		if (specifier== 1){
80			proto_item_append_text(spcifier_item, " Connect");
81		}else if (specifier== 2){
82			proto_item_append_text(spcifier_item, " Temporary Connect");
83		}else if (specifier== 3){
84			proto_item_append_text(spcifier_item, " Disconnect");
85		}else if (specifier== 4){
86			proto_item_append_text(spcifier_item, " Forward Disconnect");
87		}
88		break;
89	default:
90		break;
91  }
92
93#--- INVOKE ---
94
95#.FN_BODY Invoke/parameter
96
97  if(find_tcap_subdissector(tvb, actx, tree))
98    offset = tvb_reported_length(tvb);
99
100
101#.FN_HDR Invoke
102  ansi_tcap_private.d.pdu = 1;
103
104#--- RETURN RESULT ---
105
106#.FIELD_ATTR
107
108#.FN_BODY ReturnResult/parameter
109  if(find_tcap_subdissector(tvb, actx, tree))
110    offset = tvb_reported_length(tvb);
111
112#.FN_HDR ReturnResult
113  ansi_tcap_private.d.pdu = 2;
114
115
116#--- RETURN ERROR ---
117
118#.FN_BODY ReturnError/parameter
119  if(find_tcap_subdissector(tvb, actx, tree))
120    offset = tvb_reported_length(tvb);
121
122#.FN_HDR ReturnError
123  ansi_tcap_private.d.pdu = 3;
124
125#--- ObjectIDApplicationContext --
126#.FN_BODY ObjectIDApplicationContext FN_VARIANT = _str  VAL_PTR = &oid_str
127
128 static const char * oid_str;
129
130 %(DEFAULT_BODY)s
131 	ansi_tcap_private.objectApplicationId_oid= (const void*) oid_str;
132	ansi_tcap_private.oid_is_present=TRUE;
133
134#.FN_HDR PackageType/unidirectional
135gp_tcapsrt_info->ope=TC_ANSI_ALL;
136col_set_str(actx->pinfo->cinfo, COL_INFO, "unidirectional ");
137
138#.FN_HDR PackageType/queryWithPerm
139gp_tcapsrt_info->ope=TC_ANSI_ALL;
140col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithPerm ");
141
142#.FN_HDR PackageType/queryWithoutPerm
143gp_tcapsrt_info->ope=TC_ANSI_ALL;
144col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithoutPerm ");
145
146#.FN_HDR PackageType/response
147gp_tcapsrt_info->ope=TC_ANSI_ALL;
148col_set_str(actx->pinfo->cinfo, COL_INFO, "response ");
149
150#.FN_HDR PackageType/conversationWithPerm
151gp_tcapsrt_info->ope=TC_ANSI_ALL;
152col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithPerm ");
153
154#.FN_HDR PackageType/conversationWithoutPerm
155gp_tcapsrt_info->ope=TC_ANSI_ALL;
156col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithoutPerm ");
157
158#.FN_HDR PackageType/abort
159gp_tcapsrt_info->ope=TC_ANSI_ABORT;
160col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
161
162#.FN_BODY TransactionID/_untag VAL_PTR = &next_tvb
163
164tvbuff_t *next_tvb;
165guint8 len;
166
167%(DEFAULT_BODY)s
168
169if(next_tvb) {
170	len = tvb_reported_length_remaining(next_tvb, 0);
171	if(len !=0){
172		/* 0 octets for the Unidirectional,
173		 * 4 octets for Query, Response & Abort
174		 * 8 octets for Conversation in the order Originating then Responding TID
175		 *
176		 * In order to match this it seems like we should only use the last 4 octets
177		 * in the 8 octets case.
178		 */
179		if (len > 4){
180			ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(actx->pinfo->pool, next_tvb, 4,len-4);
181		}else{
182			ansi_tcap_private.TransactionID_str = tvb_bytes_to_str(actx->pinfo->pool, next_tvb, 0,len);
183		}
184	}
185	switch(len) {
186	case 1:
187		gp_tcapsrt_info->src_tid=tvb_get_guint8(next_tvb, 0);
188		break;
189	case 2:
190		gp_tcapsrt_info->src_tid=tvb_get_ntohs(next_tvb, 0);
191		break;
192	case 4:
193		gp_tcapsrt_info->src_tid=tvb_get_ntohl(next_tvb, 0);
194		break;
195	default:
196		gp_tcapsrt_info->src_tid=0;
197		break;
198	}
199}
200
201#.END
202