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