epan/dissectors/pidl/ C99 drsuapi
[wireshark-sm.git] / epan / dissectors / asn1 / ansi_tcap / ansi_tcap.cnf
blob9c8c8e0644dbf7d0372a7803f8004e857a7a2e00
1 # tcap.cnf
2 # tcap conformation file
4 #.NO_EMIT ONLY_VALS
5 PackageType
7 #.OMIT_ASSIGNMENT
8 # Removed as they are giving 'defined but not used' warnings currently.
9 Priority
10 #.END
12 #.FIELD_RENAME
13 Invoke/parameter                        invoke_parameter
14 ReturnResult/parameter                  returnResult_parameter
15 ReturnError/parameter                   returnError_parameter
16 Reject/parameter                        reject_parameter
17 Abort/causeInformation/userInformation  abort_userInformation
18 ErrorCode/private                       ec_private
19 #.FIELD_ATTR
20 ErrorCode/private ABBREV=ec_private
21 #--- OperationCode ---
23 #.FN_PARS
24 OperationCode            VAL_PTR = &ansi_tcap_private.d.OperationCode
25 OperationCode/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
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  uint8_t family;
35  uint8_t specifier;
37   %(DEFAULT_BODY)s
38   /* mask off the H bit */
39   ansi_tcap_private.d.OperationCode_national = (ansi_tcap_private.d.OperationCode_national&0x7fff);
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 = (uint8_t)(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);
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   }
93 #--- INVOKE ---
95 #.FN_BODY Invoke/parameter
97   if(find_tcap_subdissector(tvb, actx, tree))
98     offset = tvb_reported_length(tvb);
101 #.FN_HDR Invoke
102   ansi_tcap_private.d.pdu = 1;
104 #--- RETURN RESULT ---
106 #.FIELD_ATTR
108 #.FN_BODY ReturnResult/parameter
109   if(find_tcap_subdissector(tvb, actx, tree))
110     offset = tvb_reported_length(tvb);
112 #.FN_HDR ReturnResult
113   ansi_tcap_private.d.pdu = 2;
116 #--- RETURN ERROR ---
118 #.FN_BODY ReturnError/parameter
119   if(find_tcap_subdissector(tvb, actx, tree))
120     offset = tvb_reported_length(tvb);
122 #.FN_HDR ReturnError
123   ansi_tcap_private.d.pdu = 3;
125 #--- ObjectIDApplicationContext --
126 #.FN_BODY ObjectIDApplicationContext FN_VARIANT = _str  VAL_PTR = &oid_str
128  static const char * oid_str;
130  %(DEFAULT_BODY)s
131         ansi_tcap_private.objectApplicationId_oid= (const void*) oid_str;
132         ansi_tcap_private.oid_is_present=true;
134 #.FN_HDR PackageType/unidirectional
135 gp_tcapsrt_info->ope=TC_ANSI_ALL;
136 col_set_str(actx->pinfo->cinfo, COL_INFO, "unidirectional ");
138 #.FN_HDR PackageType/queryWithPerm
139 gp_tcapsrt_info->ope=TC_ANSI_ALL;
140 col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithPerm ");
142 #.FN_HDR PackageType/queryWithoutPerm
143 gp_tcapsrt_info->ope=TC_ANSI_ALL;
144 col_set_str(actx->pinfo->cinfo, COL_INFO, "queryWithoutPerm ");
146 #.FN_HDR PackageType/response
147 gp_tcapsrt_info->ope=TC_ANSI_ALL;
148 col_set_str(actx->pinfo->cinfo, COL_INFO, "response ");
150 #.FN_HDR PackageType/conversationWithPerm
151 gp_tcapsrt_info->ope=TC_ANSI_ALL;
152 col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithPerm ");
154 #.FN_HDR PackageType/conversationWithoutPerm
155 gp_tcapsrt_info->ope=TC_ANSI_ALL;
156 col_set_str(actx->pinfo->cinfo, COL_INFO, "conversationWithoutPerm ");
158 #.FN_HDR PackageType/abort
159 gp_tcapsrt_info->ope=TC_ANSI_ABORT;
160 col_set_str(actx->pinfo->cinfo, COL_INFO, "Abort ");
162 #.FN_BODY TransactionID/_untag VAL_PTR = &next_tvb
164 tvbuff_t *next_tvb;
165 uint8_t len;
167 %(DEFAULT_BODY)s
169 if(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_uint8(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         }
201 #.END