2 * Routines for Universal Computer Protocol dissection
3 * Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
5 * $Id: packet-ucp.c,v 1.21 2003/11/25 20:26:40 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 * Dissector of a UCP (Universal Computer Protocol) PDU, as defined for the
27 * ERMES paging system in ETS 300 133-3 (2nd final draft, September 1997,
29 * Includes the extension of EMI-UCP interface (V4.0, May 2001, www.cmgwds.com)
45 #include <epan/packet.h>
46 /* #include "packet-ucp.h" */ /* We autoregister */
49 static void dissect_ucp(tvbuff_t *, packet_info *, proto_tree *);
52 * Convert ASCII-hex character to binary equivalent. No checks, assume
53 * is valid hex character.
55 #define AHex2Bin(n) (((n) & 0x40) ? ((n) & 0x0F) + 9 : ((n) & 0x0F))
57 #define UCP_STX 0x02 /* Start of UCP PDU */
58 #define UCP_ETX 0x03 /* End of UCP PDU */
60 #define UCP_MALFORMED -1 /* Not a valid PDU */
61 #define UCP_SHORTENED -2 /* May be valid but short */
62 #define UCP_INV_CHK -3 /* Checksum doesn't add up */
64 #define UCP_O_R_OFFSET 10 /* Location of O/R field*/
65 #define UCP_OT_OFFSET 12 /* Location of OT field */
67 #define UCP_TRN_LEN 2 /* Length of TRN-field */
68 #define UCP_LEN_LEN 5 /* Length of LEN-field */
69 #define UCP_O_R_LEN 1 /* Length of O/R-field */
70 #define UCP_OT_LEN 2 /* Length of OT-field */
73 * Initialize the protocol and registered fields
75 * Header (fixed) section
77 static int proto_ucp = -1;
79 static int hf_ucp_hdr_TRN = -1;
80 static int hf_ucp_hdr_LEN = -1;
81 static int hf_ucp_hdr_O_R = -1;
82 static int hf_ucp_hdr_OT = -1;
85 * Data (variable) section
87 static int hf_ucp_oper_section = -1;
88 static int hf_ucp_parm_AdC = -1;
89 static int hf_ucp_parm_OAdC = -1;
90 static int hf_ucp_parm_DAdC = -1;
91 static int hf_ucp_parm_AC = -1;
92 static int hf_ucp_parm_OAC = -1;
93 static int hf_ucp_parm_BAS = -1;
94 static int hf_ucp_parm_LAR = -1;
95 static int hf_ucp_parm_LAC = -1;
96 static int hf_ucp_parm_L1R = -1;
97 static int hf_ucp_parm_L1P = -1;
98 static int hf_ucp_parm_L3R = -1;
99 static int hf_ucp_parm_L3P = -1;
100 static int hf_ucp_parm_LCR = -1;
101 static int hf_ucp_parm_LUR = -1;
102 static int hf_ucp_parm_LRR = -1;
103 static int hf_ucp_parm_RT = -1;
104 static int hf_ucp_parm_NoN = -1;
105 static int hf_ucp_parm_NoA = -1;
106 static int hf_ucp_parm_NoB = -1;
107 static int hf_ucp_parm_NAC = -1;
108 static int hf_ucp_parm_PNC = -1;
109 static int hf_ucp_parm_LNo = -1;
110 static int hf_ucp_parm_LST = -1;
111 static int hf_ucp_parm_TNo = -1;
112 static int hf_ucp_parm_CS = -1;
113 static int hf_ucp_parm_PID = -1;
114 static int hf_ucp_parm_NPL = -1;
115 static int hf_ucp_parm_GA = -1;
116 static int hf_ucp_parm_RP = -1;
117 static int hf_ucp_parm_LRP = -1;
118 static int hf_ucp_parm_PR = -1;
119 static int hf_ucp_parm_LPR = -1;
120 static int hf_ucp_parm_UM = -1;
121 static int hf_ucp_parm_LUM = -1;
122 static int hf_ucp_parm_RC = -1;
123 static int hf_ucp_parm_LRC = -1;
124 static int hf_ucp_parm_NRq = -1;
125 static int hf_ucp_parm_GAdC = -1;
126 static int hf_ucp_parm_A_D = -1;
127 static int hf_ucp_parm_CT = -1;
128 static int hf_ucp_parm_AAC = -1;
129 static int hf_ucp_parm_MNo = -1;
130 static int hf_ucp_parm_R_T = -1;
131 static int hf_ucp_parm_IVR5x = -1;
132 static int hf_ucp_parm_REQ_OT = -1;
133 static int hf_ucp_parm_SSTAT = -1;
134 static int hf_ucp_parm_LMN = -1;
135 static int hf_ucp_parm_NMESS = -1;
136 static int hf_ucp_parm_NMESS_str= -1;
137 static int hf_ucp_parm_NAdC = -1;
138 static int hf_ucp_parm_NT = -1;
139 static int hf_ucp_parm_NPID = -1;
140 static int hf_ucp_parm_LRq = -1;
141 static int hf_ucp_parm_LRAd = -1;
142 static int hf_ucp_parm_LPID = -1;
143 static int hf_ucp_parm_DD = -1;
144 static int hf_ucp_parm_DDT = -1;
145 static int hf_ucp_parm_STx = -1;
146 static int hf_ucp_parm_ST = -1;
147 static int hf_ucp_parm_SP = -1;
148 static int hf_ucp_parm_VP = -1;
149 static int hf_ucp_parm_RPID = -1;
150 static int hf_ucp_parm_SCTS = -1;
151 static int hf_ucp_parm_Dst = -1;
152 static int hf_ucp_parm_Rsn = -1;
153 static int hf_ucp_parm_DSCTS = -1;
154 static int hf_ucp_parm_MT = -1;
155 static int hf_ucp_parm_NB = -1;
156 static int hf_ucp_data_section = -1;
157 static int hf_ucp_parm_MMS = -1;
158 static int hf_ucp_parm_DCs = -1;
159 static int hf_ucp_parm_MCLs = -1;
160 static int hf_ucp_parm_RPI = -1;
161 static int hf_ucp_parm_CPg = -1;
162 static int hf_ucp_parm_RPLy = -1;
163 static int hf_ucp_parm_OTOA = -1;
164 static int hf_ucp_parm_HPLMN = -1;
165 static int hf_ucp_parm_RES4 = -1;
166 static int hf_ucp_parm_RES5 = -1;
167 static int hf_ucp_parm_OTON = -1;
168 static int hf_ucp_parm_ONPI = -1;
169 static int hf_ucp_parm_STYP0 = -1;
170 static int hf_ucp_parm_STYP1 = -1;
171 static int hf_ucp_parm_ACK = -1;
172 static int hf_ucp_parm_PWD = -1;
173 static int hf_ucp_parm_NPWD = -1;
174 static int hf_ucp_parm_VERS = -1;
175 static int hf_ucp_parm_LAdC = -1;
176 static int hf_ucp_parm_LTON = -1;
177 static int hf_ucp_parm_LNPI = -1;
178 static int hf_ucp_parm_OPID = -1;
179 static int hf_ucp_parm_RES1 = -1;
180 static int hf_ucp_parm_RES2 = -1;
181 static int hf_ucp_parm_MVP = -1;
182 static int hf_ucp_parm_EC = -1;
183 static int hf_ucp_parm_SM = -1;
185 static int hf_ucp_parm_XSer = -1;
186 static int hf_xser_service = -1;
188 /* Initialize the subtree pointers */
189 static gint ett_ucp = -1;
190 static gint ett_sub = -1;
191 static gint ett_XSer = -1;
194 * Value-arrays for certain field-contents
196 static const value_string vals_hdr_O_R[] = {
197 { 'O', "Operation" },
202 static const value_string vals_hdr_OT[] = { /* Operation type */
205 { 2, "Call input (multiple address)" },
206 { 3, "Call input (supplementary services included)" },
207 { 4, "Address list information" },
208 { 5, "Change address list" },
209 { 6, "Advice of accumulated charges" },
210 { 7, "Password management" },
211 { 8, "Legitimisation code management" },
212 { 9, "Standard text information" },
213 { 10, "Change standard text" },
214 { 11, "Request roaming information" },
215 { 12, "Change roaming information" },
216 { 13, "Roaming reset" },
217 { 14, "Message retrieval" },
218 { 15, "Request call barring" },
219 { 16, "Cancel call barring" },
220 { 17, "Request call diversion" },
221 { 18, "Cancel call diversion" },
222 { 19, "Request deferred delivery" },
223 { 20, "Cancel deferred delivery" },
224 { 21, "All features reset" },
225 { 22, "Call input (with specific character set)" },
226 { 23, "UCP version status request" },
227 { 24, "Mobile subscriber feature status request" },
228 { 30, "SMS message transfer" },
230 { 32, "(proprietary)" },
231 { 34, "(proprietary)" },
232 { 36, "(proprietary)" },
233 { 38, "(proprietary)" },
234 { 40, "(proprietary)" },
235 { 41, "(proprietary)" },
236 { 42, "(proprietary)" },
237 { 43, "(proprietary)" },
238 { 44, "(proprietary)" },
239 { 45, "(proprietary)" },
240 { 51, "Submit short message" },
241 { 52, "Deliver short message" },
242 { 53, "Deliver notification" },
243 { 54, "Modify message" },
244 { 55, "Inquiry message" },
245 { 56, "Delete message" },
246 { 57, "Inquiry response message" },
247 { 58, "Delete response message" },
248 { 60, "Session management" },
249 { 61, "List management" },
250 { 95, "(proprietary)" },
251 { 96, "(proprietary)" },
252 { 97, "(proprietary)" },
253 { 98, "(proprietary)" },
254 { 99, "(proprietary)" },
258 static const value_string vals_parm_EC[] = { /* Error code */
259 { 1, "Checksum error" },
260 { 2, "Syntax error" },
261 { 3, "Operation not supported by system" },
262 { 4, "Operation not allowed" },
263 { 5, "Call barring active" },
264 { 6, "AdC invalid" },
265 { 7, "Authentication failure" },
266 { 8, "Legitimisation code for all calls, failure" },
267 { 9, "GA not valid" },
268 { 10, "Repetition not allowed" },
269 { 11, "Legitimisation code for repetition, failure" },
270 { 12, "Priority call not allowed" },
271 { 13, "Legitimisation code for priority call, failure" },
272 { 14, "Urgent message not allowed" },
273 { 15, "Legitimisation code for urgent message, failure" },
274 { 16, "Reverse charging not alllowed" },
275 { 17, "Legitimisation code for rev. charging, failure" },
276 { 18, "Deferred delivery not allowed" },
277 { 19, "New AC not valid" },
278 { 20, "New legitimisation code not valid" },
279 { 21, "Standard text not valid" },
280 { 22, "Time period not valid" },
281 { 23, "Message type not supported by system" },
282 { 24, "Message too long" },
283 { 25, "Requested standard text not valid" },
284 { 26, "Message type not valid for the pager type" },
285 { 27, "Message not found in SMSC" },
286 { 28, "Invalid character set" },
287 { 30, "Subscriber hang-up" },
288 { 31, "Fax group not supported" },
289 { 32, "Fax message type not supported" },
290 { 33, "Address already in list (60-series)" },
291 { 34, "Address not in list (60-series)" },
292 { 35, "List full, cannot add address to list (60-series)" },
293 { 36, "RPID already in use" },
294 { 37, "Delivery in progress" },
295 { 38, "Message forwarded" },
296 { 50, "Low network status" },
297 { 51, "Legitimisation code for standard text, failure" },
298 { 53, "Operation partially successfull" },
299 { 54, "Operation not successfull" },
300 { 55, "System error" },
301 { 57, "AdC already a member of GAdC address list" },
302 { 58, "AdC not a member of GAdC address list" },
303 { 59, "Requested standard text list invalid" },
304 { 61, "Not controller of GAdC address list" },
305 { 62, "Standard text too large" },
306 { 63, "Not owner of standard text list" },
307 { 64, "Address list full" },
308 { 65, "GAdC invalid" },
309 { 66, "Operation restricted to mobile subscribers" },
310 { 68, "Invalid AdC type" },
311 { 69, "Cannot add AdC to GAdC address list" },
312 { 90, "(proprietary error code)" },
313 { 91, "(proprietary error code)" },
314 { 92, "(proprietary error code)" },
315 { 93, "(proprietary error code)" },
316 { 94, "(proprietary error code)" },
317 { 95, "(proprietary error code)" },
318 { 96, "(proprietary error code)" },
319 { 97, "(proprietary error code)" },
320 { 98, "(proprietary error code)" },
321 { 99, "(proprietary error code)" },
325 static const value_string vals_parm_NRq[] = {
326 { '0', "NAdC not used" },
327 { '1', "NAdC used" },
331 static const value_string vals_parm_NT[] = {
332 { '0', "Default value" },
333 { '1', "Delivery notification" },
334 { '2', "Non-delivery notification" },
335 { '3', "Delivery and Non-delivery notification" },
336 { '4', "Buffered message notification" },
337 { '5', "Buffered and Delivery notification" },
338 { '6', "Buffered and Non-delivery notification" },
339 { '7', "All notifications" },
343 static const value_string vals_parm_PID[] = {
344 { 100, "Mobile station" },
345 { 122, "Fax Group 3" },
347 { 138, "Menu over PSTN" },
348 { 139, "PC appl. over PSTN (E.164)" },
349 { 339, "PC appl. over X.25 (X.121)" },
350 { 439, "PC appl. over ISDN (E.164)" },
351 { 539, "PC appl. over TCP/IP" },
355 static const value_string vals_parm_LRq[] = {
356 { '0', "LRAd not used" },
357 { '1', "LRAd used" },
361 static const value_string vals_parm_DD[] = {
362 { '0', "DDT not used" },
367 static const value_string vals_parm_Dst[] = {
368 { '0', "delivered" },
369 { '1', "buffered (see Rsn)" },
370 { '2', "not delivered (see Rsn)" },
374 static const value_string vals_parm_Rsn[] = {
375 { 0, "Unknown subscriber" },
376 { 1, "Service temporary not available" },
377 { 2, "Service temporary not available" },
378 { 3, "Service temporary not available" },
379 { 4, "Service temporary not available" },
380 { 5, "Service temporary not available" },
381 { 6, "Service temporary not available" },
382 { 7, "Service temporary not available" },
383 { 8, "Service temporary not available" },
384 { 9, "Illegal error code" },
385 { 10, "Network time-out" },
386 { 100, "Facility not supported" },
387 { 101, "Unknown subscriber" },
388 { 102, "Facility not provided" },
389 { 103, "Call barred" },
390 { 104, "Operation barred" },
391 { 105, "SC congestion" },
392 { 106, "Facility not supported" },
393 { 107, "Absent subscriber" },
394 { 108, "Delivery fail" },
395 { 109, "Sc congestion" },
396 { 110, "Protocol error" },
397 { 111, "MS not equiped" },
398 { 112, "Unknown SC" },
399 { 113, "SC congestion" },
400 { 114, "Illegal MS" },
401 { 115, "MS nota subscriber" },
402 { 116, "Error in MS" },
403 { 117, "SMS lower layer not provisioned" },
404 { 118, "System fail" },
405 { 119, "PLMN system failure" },
406 { 120, "HLR system failure" },
407 { 121, "VLR system failure" },
408 { 122, "Previous VLR system failure" },
409 { 123, "Controlling MSC system failure" },
410 { 124, "VMSC system failure" },
411 { 125, "EIR system failure" },
412 { 126, "System failure" },
413 { 127, "Unexpected data value" },
414 { 200, "Error in address service centre" },
415 { 201, "Invalid absolute validity period" },
416 { 202, "Short message exceeds maximum" },
417 { 203, "Unable to unpack GSM message" },
418 { 204, "Unable to convert to IRA alphabet" },
419 { 205, "Invalid validity period format" },
420 { 206, "Invalid destination address" },
421 { 207, "Duplicate message submit" },
422 { 208, "Invalid message type indicator" },
426 static const value_string vals_parm_MT[] = {
427 { '2', "Numeric message" },
428 { '3', "Alphanumeric message" },
429 { '4', "Transparent data" },
433 static const value_string vals_parm_DCs[] = {
434 { '0', "default alphabet" },
435 { '1', "User defined data (8 bit)" },
439 static const value_string vals_parm_MCLs[] = {
440 { '0', "message class 0" },
441 { '1', "message class 1" },
442 { '2', "message class 2" },
443 { '3', "message class 3" },
447 static const value_string vals_parm_RPI[] = {
453 static const value_string vals_parm_ACK[] = {
459 static const value_string vals_parm_RP[] = {
460 { '1', "Repetition requested" },
464 static const value_string vals_parm_UM[] = {
465 { '1', "Urgent message" },
469 static const value_string vals_parm_RC[] = {
470 { '1', "Reverse charging request" },
474 static const value_string vals_parm_OTON[] = {
475 { '1', "International number" },
476 { '2', "National number" },
477 { '6', "Abbreviated number (short number alias)" },
481 static const value_string vals_parm_ONPI[] = {
482 { '1', "E.164 address" },
483 { '3', "X.121 address" },
484 { '5', "Private -TCP/IP or abbreviated number- address" },
488 static const value_string vals_parm_STYP0[] = {
489 { '1', "open session" },
491 { '3', "change password" },
492 { '4', "open provisioning session" },
494 { '6', "change provisioning password" },
498 static const value_string vals_parm_STYP1[] = {
499 { '1', "add item to mo-list" },
500 { '2', "remove item from mo-list" },
501 { '3', "verify item mo-list" },
502 { '4', "add item to mt-list" },
503 { '5', "remove item from mt-list" },
504 { '6', "verify item mt-list" },
508 static const value_string vals_parm_OPID[] = {
509 { 0, "Mobile station" },
510 { 39, "PC application" },
514 static const value_string vals_parm_BAS[] = {
519 static const value_string vals_parm_LAR[] = {
520 { '1', "Leg. code for all calls requested" },
524 static const value_string vals_parm_L1R[] = {
525 { '1', "Leg. code for priority 1 requested" },
529 static const value_string vals_parm_L3R[] = {
530 { '1', "Leg. code for priority 3 requested" },
534 static const value_string vals_parm_LCR[] = {
535 { '1', "Leg. code for reverse charging requested" },
539 static const value_string vals_parm_LUR[] = {
540 { '1', "Leg. code for urgent message requested" },
544 static const value_string vals_parm_LRR[] = {
545 { '1', "Leg. code for repitition requested" },
549 static const value_string vals_parm_RT[] = {
550 { '1', "Tone only" },
552 { '3', "Alphanumeric" },
553 { '4', "Transparent data" },
557 static const value_string vals_parm_PNC[] = {
559 { 'I', "Input PNC" },
563 static const value_string vals_parm_A_D[] = {
569 static const value_string vals_parm_R_T[] = {
570 { 'R', "Retrieval Ok" },
571 { 'T', "Retransmit on radio channel" },
575 static const value_string vals_parm_REQ_OT[] = {
576 { 'S', "Send used operation types" },
577 { 'N', "Don't send used operation types" },
581 static const value_string vals_parm_SSTAT[] = {
582 { '0', "All services" },
583 { '1', "All in the moment active servics" },
584 { '2', "Call diversion" },
585 { '3', "Roaming information status" },
586 { '4', "Call barring status" },
587 { '5', "Deferred delivery status" },
588 { '6', "Number of stored messages" },
592 static const value_string vals_xser_service[] = {
593 { 1, "GSM UDH information" },
594 { 2, "GSM DCS information" },
595 { 3, "[Message Type] TDMA information exchange" },
596 { 4, "[Message Reference] TDMA information exchange" },
597 { 5, "[Privacy Indicator] TDMA information exchange" },
598 { 6, "[Urgency Indicator] TDMA information exchange" },
599 { 7, "[Acknowledgement Request] TDMA information exchange" },
600 { 8, "[Messsage Updating] TDMA information exchange" },
601 { 9, "[Call Back Number] TDMA information exchange" },
602 { 10, "[Response Code] TDMA information exchange" },
603 { 11, "[Teleservice ID] TDMA information exchange" },
604 { 12, "Billing identifier" },
605 { 13, "Single shot indicator" },
610 * Checks whether the PDU looks a bit like UCP and checks the checksum
612 * \param tvb The buffer with PDU-data
613 * \param endpkt Returns pointer, indicating the end of the PDU
615 * \return The state of this PDU
616 * \retval 0 Definitely UCP
617 * \retval UCP_SHORTENED Packet may be there, but not complete
618 * \retval UCP_MALFORMED Hmmmm, not UCP after all...
619 * \retval UCP_INV_CHK Nice packet, but checksum doesn't add up...
622 check_ucp(tvbuff_t *tvb, int *endpkt)
629 length = tvb_find_guint8(tvb, offset, -1, UCP_ETX);
631 *endpkt = tvb_reported_length_remaining(tvb, offset);
632 return UCP_SHORTENED;
634 if (length > (int) tvb_reported_length(tvb)) {
636 return UCP_MALFORMED;
638 for (; offset < (guint) (length - 2); offset++)
639 checksum += tvb_get_guint8(tvb, offset);
641 tmp = tvb_get_guint8(tvb, offset++);
642 pkt_check = AHex2Bin(tmp);
643 tmp = tvb_get_guint8(tvb, offset++);
644 pkt_check = 16 * pkt_check + AHex2Bin(tmp);
645 *endpkt = offset + 1;
646 if (checksum == (guint) pkt_check)
653 * UCP equivalent of mktime() (3). Convert date to standard 'time_t' format
655 * \param datestr The UCP-formatted date to convert
657 * \return The date in standard 'time_t' format.
660 ucp_mktime(char *datestr)
664 r_time.tm_mday = 10 * (datestr[0] - '0') + (datestr[1] - '0');
665 r_time.tm_mon = (10 * (datestr[2] - '0') + (datestr[3] - '0')) - 1;
666 r_time.tm_year = 10 * (datestr[4] - '0') + (datestr[5] - '0');
667 if (r_time.tm_year < 90)
668 r_time.tm_year += 100;
669 r_time.tm_hour = 10 * (datestr[6] - '0') + (datestr[7] - '0');
670 r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0');
672 r_time.tm_sec = 10 * (datestr[10] - '0') + (datestr[11] - '0');
675 r_time.tm_isdst = -1;
676 return mktime(&r_time);
680 * Scanning routines to add standard types (byte, int, string, data)
681 * to the protocol-tree. Each field is seperated with a slash ('/').
683 * \param tree The protocol tree to add to
684 * \param tvb Buffer containing the data
685 * \param field The actual field, whose value needs displaying
686 * \param offset Location of field within the buffer, returns location
689 * \return For 'int'-types, the value of the field.
692 ucp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
696 int tmpoff = *offset;
699 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
702 strval[--idx] = '\0';
703 proto_tree_add_string(tree, field, tvb, *offset, idx, strval);
709 ucp_handle_byte(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
713 if ((intval = tvb_get_guint8(tvb, (*offset)++)) != '/') {
714 proto_tree_add_uint(tree, field, tvb, *offset - 1, 1, intval);
721 ucp_handle_int(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
725 int tmpoff = *offset;
728 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
731 strval[--idx] = '\0';
732 intval = atoi(strval);
733 proto_tree_add_uint(tree, field, tvb, *offset, idx, intval);
740 ucp_handle_time(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
745 int tmpoff = *offset;
748 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
751 strval[--idx] = '\0';
752 tval = ucp_mktime(strval);
755 proto_tree_add_time(tree, field, tvb, *offset, idx, &tmptime);
761 ucp_handle_data(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
763 int tmpoff = *offset;
765 while (tvb_get_guint8(tvb, tmpoff++) != '/')
767 if ((tmpoff - *offset) > 1)
768 proto_tree_add_item(tree, field, tvb, *offset,
769 tmpoff - *offset - 1, FALSE);
774 * Handle the data-field within the UCP-message, according the Message Type
776 * - 2 Numeric message
777 * - 3 Alphanumeric message
778 * - 4 Transparent (binary) data
779 * - 5 Standard text handling
780 * - 6 Alphanumeric message in specified character set
782 * \param tree The protocol tree to add to
783 * \param tvb Buffer containing the data
784 * \param field The actual field, whose value needs displaying
785 * \param offset Location of field within the buffer, returns location
789 ucp_handle_mt(proto_tree *tree, tvbuff_t *tvb, int *offset)
793 intval = ucp_handle_byte(tree, tvb, hf_ucp_parm_MT, offset);
795 case '1': /* Tone only, no data */
797 case '4': /* TMsg, no of bits */
798 ucp_handle_string(tree, tvb, hf_ucp_parm_NB, offset);
799 /* fall through here for the data piece */
802 ucp_handle_data(tree, tvb, hf_ucp_data_section, offset);
805 ucp_handle_byte(tree, tvb, hf_ucp_parm_PNC, offset);
806 ucp_handle_string(tree, tvb, hf_ucp_parm_LNo, offset);
807 ucp_handle_string(tree, tvb, hf_ucp_parm_LST, offset);
808 ucp_handle_string(tree, tvb, hf_ucp_parm_TNo, offset);
811 ucp_handle_data(tree, tvb, hf_ucp_data_section, offset);
812 ucp_handle_int(tree, tvb, hf_ucp_parm_CS, offset);
815 break; /* No data so ? */
820 * Handle the data within the 'Extended services' field. Each field having the
821 * format TTLLDD..., TT being the type of service, LL giving the length of the
822 * field, DD... containing the actual data
824 * \param tree The protocol tree to add to
825 * \param tvb Buffer containing the extended services data
828 ucp_handle_XSer(proto_tree *tree, tvbuff_t *tvb)
835 while ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
836 service = AHex2Bin(intval);
837 intval = tvb_get_guint8(tvb, offset++);
838 service = service * 16 + AHex2Bin(intval);
839 intval = tvb_get_guint8(tvb, offset++);
840 len = AHex2Bin(intval);
841 intval = tvb_get_guint8(tvb, offset++);
842 len = len * 16 + AHex2Bin(intval);
843 proto_tree_add_uint(tree, hf_xser_service, tvb, offset,
849 /* Next definitions are just a convenient shorthand to make the coding a
850 * bit more readable instead of summing up all these parameters.
852 #define UcpHandleString(field) ucp_handle_string(tree, tvb, (field), &offset)
854 #define UcpHandleByte(field) ucp_handle_byte(tree, tvb, (field), &offset)
856 #define UcpHandleInt(field) ucp_handle_int(tree, tvb, (field), &offset)
858 #define UcpHandleTime(field) ucp_handle_time(tree, tvb, (field), &offset)
860 #define UcpHandleData(field) ucp_handle_data(tree, tvb, (field), &offset)
863 * The next set of routines handle the different operation types,
864 * associated with UCP.
867 add_00O(proto_tree *tree, tvbuff_t *tvb)
871 UcpHandleString(hf_ucp_parm_AdC);
872 UcpHandleString(hf_ucp_parm_OAdC);
873 UcpHandleString(hf_ucp_parm_OAC);
877 add_00R(proto_tree *tree, tvbuff_t *tvb)
882 intval = UcpHandleByte(hf_ucp_parm_ACK);
885 UcpHandleByte(hf_ucp_parm_BAS);
886 UcpHandleByte(hf_ucp_parm_LAR);
887 UcpHandleByte(hf_ucp_parm_L1R);
888 UcpHandleByte(hf_ucp_parm_L3R);
889 UcpHandleByte(hf_ucp_parm_LCR);
890 UcpHandleByte(hf_ucp_parm_LUR);
891 UcpHandleByte(hf_ucp_parm_LRR);
892 UcpHandleByte(hf_ucp_parm_RT);
893 UcpHandleInt(hf_ucp_parm_NoN);
894 UcpHandleInt(hf_ucp_parm_NoA);
895 UcpHandleInt(hf_ucp_parm_NoB);
897 UcpHandleInt(hf_ucp_parm_EC);
898 UcpHandleString(hf_ucp_parm_SM);
903 add_01O(proto_tree *tree, tvbuff_t *tvb)
907 UcpHandleString(hf_ucp_parm_AdC);
908 UcpHandleString(hf_ucp_parm_OAdC);
909 UcpHandleString(hf_ucp_parm_OAC);
910 ucp_handle_mt(tree, tvb, &offset);
914 add_01R(proto_tree *tree, tvbuff_t *tvb)
919 intval = UcpHandleByte(hf_ucp_parm_ACK);
921 UcpHandleInt(hf_ucp_parm_EC);
922 UcpHandleString(hf_ucp_parm_SM);
926 add_02O(proto_tree *tree, tvbuff_t *tvb)
927 { /* Multiple address call input*/
932 intval = UcpHandleInt(hf_ucp_parm_NPL);
933 for (idx = 0; idx < intval; idx++)
934 UcpHandleString(hf_ucp_parm_AdC);
936 UcpHandleString(hf_ucp_parm_OAdC);
937 UcpHandleString(hf_ucp_parm_OAC);
938 ucp_handle_mt(tree, tvb, &offset);
941 #define add_02R(a, b) add_01R(a,b)
944 add_03O(proto_tree *tree, tvbuff_t *tvb)
945 { /* Call input with SS */
950 UcpHandleString(hf_ucp_parm_AdC);
951 UcpHandleString(hf_ucp_parm_OAdC);
952 UcpHandleString(hf_ucp_parm_OAC);
953 intval = UcpHandleInt(hf_ucp_parm_NPL);
954 for (idx = 0; idx < intval; idx++)
955 UcpHandleString(hf_ucp_parm_GA);
957 UcpHandleByte(hf_ucp_parm_RP);
958 UcpHandleString(hf_ucp_parm_LRP);
959 UcpHandleByte(hf_ucp_parm_PR);
960 UcpHandleString(hf_ucp_parm_LPR);
961 UcpHandleByte(hf_ucp_parm_UM);
962 UcpHandleString(hf_ucp_parm_LUM);
963 UcpHandleByte(hf_ucp_parm_RC);
964 UcpHandleString(hf_ucp_parm_LRC);
965 UcpHandleByte(hf_ucp_parm_DD);
966 UcpHandleTime(hf_ucp_parm_DDT);
967 ucp_handle_mt(tree, tvb, &offset);
970 #define add_03R(a, b) add_01R(a,b)
973 add_04O(proto_tree *tree, tvbuff_t *tvb)
974 { /* Address list information */
977 UcpHandleString(hf_ucp_parm_GAdC);
978 UcpHandleString(hf_ucp_parm_AC);
979 UcpHandleString(hf_ucp_parm_OAdC);
980 UcpHandleString(hf_ucp_parm_OAC);
984 add_04R(proto_tree *tree, tvbuff_t *tvb)
990 intval = UcpHandleByte(hf_ucp_parm_ACK);
992 intval = UcpHandleInt(hf_ucp_parm_NPL);
993 for (idx = 0; idx < intval; idx++)
994 UcpHandleString(hf_ucp_parm_AdC);
995 UcpHandleString(hf_ucp_parm_GAdC);
997 UcpHandleInt(hf_ucp_parm_EC);
998 UcpHandleString(hf_ucp_parm_SM);
1002 add_05O(proto_tree *tree, tvbuff_t *tvb)
1003 { /* Change address list */
1008 UcpHandleString(hf_ucp_parm_GAdC);
1009 UcpHandleString(hf_ucp_parm_AC);
1010 UcpHandleString(hf_ucp_parm_OAdC);
1011 UcpHandleString(hf_ucp_parm_OAC);
1012 intval = UcpHandleInt(hf_ucp_parm_NPL);
1013 for (idx = 0; idx < intval; idx++)
1014 UcpHandleString(hf_ucp_parm_AdC);
1015 UcpHandleByte(hf_ucp_parm_A_D);
1018 #define add_05R(a, b) add_01R(a, b)
1021 add_06O(proto_tree *tree, tvbuff_t *tvb)
1022 { /* Advice of accum. charges */
1025 UcpHandleString(hf_ucp_parm_AdC);
1026 UcpHandleString(hf_ucp_parm_AC);
1030 add_06R(proto_tree *tree, tvbuff_t *tvb)
1035 intval = UcpHandleByte(hf_ucp_parm_ACK);
1036 if (intval == 'A') {
1037 UcpHandleTime(hf_ucp_parm_CT);
1038 UcpHandleString(hf_ucp_parm_AAC);
1040 UcpHandleInt(hf_ucp_parm_EC);
1041 UcpHandleString(hf_ucp_parm_SM);
1045 add_07O(proto_tree *tree, tvbuff_t *tvb)
1046 { /* Password management */
1049 UcpHandleString(hf_ucp_parm_AdC);
1050 UcpHandleString(hf_ucp_parm_AC);
1051 UcpHandleString(hf_ucp_parm_NAC);
1054 #define add_07R(a, b) add_01R(a, b)
1057 add_08O(proto_tree *tree, tvbuff_t *tvb)
1058 { /* Leg. code management */
1061 UcpHandleString(hf_ucp_parm_AdC);
1062 UcpHandleString(hf_ucp_parm_AC);
1063 UcpHandleString(hf_ucp_parm_LAC);
1064 UcpHandleString(hf_ucp_parm_L1P);
1065 UcpHandleString(hf_ucp_parm_L3P);
1066 UcpHandleString(hf_ucp_parm_LRC);
1067 UcpHandleString(hf_ucp_parm_LUM);
1068 UcpHandleString(hf_ucp_parm_LRP);
1069 UcpHandleString(hf_ucp_parm_LST);
1072 #define add_08R(a, b) add_01R(a, b)
1075 add_09O(proto_tree *tree, tvbuff_t *tvb)
1076 { /* Standard text information */
1079 UcpHandleString(hf_ucp_parm_LNo);
1080 UcpHandleString(hf_ucp_parm_LST);
1084 add_09R(proto_tree *tree, tvbuff_t *tvb)
1090 intval = UcpHandleByte(hf_ucp_parm_ACK);
1091 if (intval == 'A') {
1092 intval = UcpHandleInt(hf_ucp_parm_NPL);
1093 for (idx = 0; idx < intval; idx++)
1094 UcpHandleString(hf_ucp_parm_LST);
1096 UcpHandleInt(hf_ucp_parm_EC);
1097 UcpHandleString(hf_ucp_parm_SM);
1101 add_10O(proto_tree *tree, tvbuff_t *tvb)
1102 { /* Change standard text */
1105 UcpHandleString(hf_ucp_parm_AdC);
1106 UcpHandleString(hf_ucp_parm_AC);
1107 UcpHandleString(hf_ucp_parm_LNo);
1108 UcpHandleString(hf_ucp_parm_TNo);
1109 UcpHandleData(hf_ucp_parm_STx);
1110 UcpHandleInt(hf_ucp_parm_CS);
1113 #define add_10R(a, b) add_01R(a, b)
1115 #define add_11O(a, b) add_06O(a, b) /* Request roaming info */
1118 add_11R(proto_tree *tree, tvbuff_t *tvb)
1124 intval = UcpHandleByte(hf_ucp_parm_ACK);
1125 if (intval == 'A') {
1126 intval = UcpHandleInt(hf_ucp_parm_NPL);
1127 for (idx = 0; idx < intval; idx++)
1128 UcpHandleString(hf_ucp_parm_GA);
1130 UcpHandleInt(hf_ucp_parm_EC);
1131 UcpHandleString(hf_ucp_parm_SM);
1135 add_12O(proto_tree *tree, tvbuff_t *tvb)
1136 { /* Change roaming */
1141 UcpHandleString(hf_ucp_parm_AdC);
1142 UcpHandleString(hf_ucp_parm_AC);
1143 intval = UcpHandleInt(hf_ucp_parm_NPL);
1144 for (idx = 0; idx < intval; idx++)
1145 UcpHandleString(hf_ucp_parm_GA);
1148 #define add_12R(a, b) add_01R(a, b)
1150 #define add_13O(a, b) add_06O(a, b) /* Roaming reset */
1152 #define add_13R(a, b) add_01R(a, b)
1155 add_14O(proto_tree *tree, tvbuff_t *tvb)
1156 { /* Message retrieval */
1159 UcpHandleString(hf_ucp_parm_AdC);
1160 UcpHandleString(hf_ucp_parm_AC);
1161 UcpHandleString(hf_ucp_parm_MNo);
1162 UcpHandleByte(hf_ucp_parm_R_T);
1166 add_14R(proto_tree *tree, tvbuff_t *tvb)
1172 intval = UcpHandleByte(hf_ucp_parm_ACK);
1173 if (intval == 'A') {
1174 intval = UcpHandleInt(hf_ucp_parm_NPL);
1176 * Spec is unclear here. Is 'SM' part of the Msg:s field or not?
1177 * For now, assume it is part of it...
1179 for (idx = 0; idx < intval; idx++)
1180 UcpHandleData(hf_ucp_data_section);
1182 UcpHandleInt(hf_ucp_parm_EC);
1183 UcpHandleString(hf_ucp_parm_SM);
1188 add_15O(proto_tree *tree, tvbuff_t *tvb)
1189 { /* Request call barring */
1192 UcpHandleString(hf_ucp_parm_AdC);
1193 UcpHandleString(hf_ucp_parm_AC);
1194 UcpHandleTime(hf_ucp_parm_ST);
1195 UcpHandleTime(hf_ucp_parm_SP);
1198 #define add_15R(a, b) add_01R(a, b)
1200 #define add_16O(a, b) add_06O(a, b) /* Cancel call barring */
1202 #define add_16R(a, b) add_01R(a, b)
1205 add_17O(proto_tree *tree, tvbuff_t *tvb)
1206 { /* Request call diversion */
1209 UcpHandleString(hf_ucp_parm_AdC);
1210 UcpHandleString(hf_ucp_parm_AC);
1211 UcpHandleString(hf_ucp_parm_DAdC);
1212 UcpHandleTime(hf_ucp_parm_ST);
1213 UcpHandleTime(hf_ucp_parm_SP);
1216 #define add_17R(a, b) add_01R(a, b)
1218 #define add_18O(a, b) add_06O(a, b) /* Cancel call diversion */
1220 #define add_18R(a, b) add_01R(a, b)
1223 add_19O(proto_tree *tree, tvbuff_t *tvb)
1224 { /* Request deferred delivery*/
1227 UcpHandleString(hf_ucp_parm_AdC);
1228 UcpHandleString(hf_ucp_parm_AC);
1229 UcpHandleTime(hf_ucp_parm_ST);
1230 UcpHandleTime(hf_ucp_parm_SP);
1233 #define add_19R(a, b) add_01R(a, b)
1235 #define add_20O(a, b) add_06O(a, b) /* Cancel deferred delivery */
1237 #define add_20R(a, b) add_01R(a, b)
1239 #define add_21O(a, b) add_06O(a, b) /* All features reset */
1241 #define add_21R(a, b) add_01R(a, b)
1244 add_22O(proto_tree *tree, tvbuff_t *tvb)
1245 { /* Call input w. add. CS */
1248 UcpHandleString(hf_ucp_parm_AdC);
1249 UcpHandleString(hf_ucp_parm_OAdC);
1250 UcpHandleString(hf_ucp_parm_OAC);
1251 UcpHandleData(hf_ucp_data_section);
1252 UcpHandleInt(hf_ucp_parm_CS);
1255 #define add_22R(a, b) add_01R(a, b)
1258 add_23O(proto_tree *tree, tvbuff_t *tvb)
1259 { /* UCP version status */
1262 UcpHandleString(hf_ucp_parm_IVR5x);
1263 UcpHandleByte(hf_ucp_parm_REQ_OT);
1267 add_23R(proto_tree *tree, tvbuff_t *tvb)
1273 intval = UcpHandleByte(hf_ucp_parm_ACK);
1274 if (intval == 'A') {
1275 UcpHandleByte(hf_ucp_parm_IVR5x);
1276 intval = UcpHandleInt(hf_ucp_parm_NPL);
1277 for (idx = 0; idx < intval; idx++)
1278 UcpHandleInt(hf_ucp_hdr_OT);
1280 UcpHandleInt(hf_ucp_parm_EC);
1281 UcpHandleString(hf_ucp_parm_SM);
1285 add_24O(proto_tree *tree, tvbuff_t *tvb)
1286 { /* Mobile subs. feature stat*/
1289 UcpHandleString(hf_ucp_parm_AdC);
1290 UcpHandleString(hf_ucp_parm_AC);
1291 UcpHandleByte(hf_ucp_parm_SSTAT);
1295 add_24R(proto_tree *tree, tvbuff_t *tvb)
1301 intval = UcpHandleByte(hf_ucp_parm_ACK);
1302 if (intval == 'A') {
1303 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1304 proto_tree_add_text(tree, tvb, offset - 1, 1,
1305 "GA roaming definitions");
1306 if (intval == 'N') {
1307 proto_tree_add_text(tree, tvb, offset -1, 1,
1308 "Not subscribed/not allowed");
1312 intval = UcpHandleInt(hf_ucp_parm_NPL);
1313 for (idx = 0; idx < intval; idx++)
1314 UcpHandleData(hf_ucp_data_section);
1317 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1318 proto_tree_add_text(tree, tvb, offset - 1, 1,
1319 "Call barring definitions");
1320 if (intval == 'N') {
1321 proto_tree_add_text(tree, tvb, offset -1, 1,
1322 "Not subscribed/not allowed");
1326 intval = UcpHandleInt(hf_ucp_parm_NPL);
1327 for (idx = 0; idx < intval; idx++)
1328 UcpHandleData(hf_ucp_data_section);
1331 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1332 proto_tree_add_text(tree, tvb, offset - 1, 1,
1333 "Deferred delivery definitions");
1334 if (intval == 'N') {
1335 proto_tree_add_text(tree, tvb, offset -1, 1,
1336 "Not subscribed/not allowed");
1340 intval = UcpHandleInt(hf_ucp_parm_NPL);
1341 for (idx = 0; idx < intval; idx++)
1342 UcpHandleData(hf_ucp_data_section);
1345 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1346 proto_tree_add_text(tree, tvb, offset - 1, 1,
1347 "Diversion definitions");
1348 if (intval == 'N') {
1349 proto_tree_add_text(tree, tvb, offset -1, 1,
1350 "Not subscribed/not allowed");
1354 intval = UcpHandleInt(hf_ucp_parm_NPL);
1355 for (idx = 0; idx < intval; idx++)
1356 UcpHandleData(hf_ucp_data_section);
1359 UcpHandleInt(hf_ucp_parm_LMN);
1360 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1361 if (intval == 'N') {
1362 proto_tree_add_string(tree, hf_ucp_parm_NMESS_str, tvb,
1363 offset -1, 1, "Not subscribed/not allowed");
1367 intval = UcpHandleInt(hf_ucp_parm_NMESS);
1371 UcpHandleInt(hf_ucp_parm_EC);
1372 UcpHandleString(hf_ucp_parm_SM);
1376 add_30O(proto_tree *tree, tvbuff_t *tvb)
1377 { /* SMS message transfer */
1380 UcpHandleString(hf_ucp_parm_AdC);
1381 UcpHandleString(hf_ucp_parm_OAdC);
1382 UcpHandleString(hf_ucp_parm_AC);
1383 UcpHandleByte(hf_ucp_parm_NRq);
1384 UcpHandleString(hf_ucp_parm_NAdC);
1385 UcpHandleInt(hf_ucp_parm_NPID);
1386 UcpHandleByte(hf_ucp_parm_DD);
1387 UcpHandleTime(hf_ucp_parm_DDT);
1388 UcpHandleTime(hf_ucp_parm_VP);
1389 UcpHandleData(hf_ucp_data_section);
1393 add_30R(proto_tree *tree, tvbuff_t *tvb)
1398 intval = UcpHandleByte(hf_ucp_parm_ACK);
1400 UcpHandleTime(hf_ucp_parm_MVP);
1402 UcpHandleInt(hf_ucp_parm_EC);
1403 UcpHandleString(hf_ucp_parm_SM);
1407 add_31O(proto_tree *tree, tvbuff_t *tvb)
1411 UcpHandleString(hf_ucp_parm_AdC);
1412 UcpHandleInt(hf_ucp_parm_PID);
1415 #define add_31R(a, b) add_01R(a, b)
1418 add_5xO(proto_tree *tree, tvbuff_t *tvb)
1419 { /* 50-series operations */
1426 UcpHandleString(hf_ucp_parm_AdC);
1427 UcpHandleString(hf_ucp_parm_OAdC);
1428 UcpHandleString(hf_ucp_parm_AC);
1429 UcpHandleByte(hf_ucp_parm_NRq);
1430 UcpHandleString(hf_ucp_parm_NAdC);
1431 UcpHandleByte(hf_ucp_parm_NT);
1432 UcpHandleInt(hf_ucp_parm_NPID);
1433 UcpHandleByte(hf_ucp_parm_LRq);
1434 UcpHandleString(hf_ucp_parm_LRAd);
1435 UcpHandleInt(hf_ucp_parm_LPID);
1436 UcpHandleByte(hf_ucp_parm_DD);
1437 UcpHandleTime(hf_ucp_parm_DDT);
1438 UcpHandleTime(hf_ucp_parm_VP);
1439 UcpHandleString(hf_ucp_parm_RPID);
1440 UcpHandleTime(hf_ucp_parm_SCTS);
1441 UcpHandleByte(hf_ucp_parm_Dst);
1442 UcpHandleInt(hf_ucp_parm_Rsn);
1443 UcpHandleTime(hf_ucp_parm_DSCTS);
1444 UcpHandleByte(hf_ucp_parm_MT);
1445 UcpHandleString(hf_ucp_parm_NB);
1446 UcpHandleData(hf_ucp_data_section);
1447 UcpHandleByte(hf_ucp_parm_MMS);
1448 UcpHandleByte(hf_ucp_parm_PR);
1449 UcpHandleByte(hf_ucp_parm_DCs);
1450 UcpHandleByte(hf_ucp_parm_MCLs);
1451 UcpHandleByte(hf_ucp_parm_RPI);
1452 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1453 proto_tree_add_string(tree, hf_ucp_parm_CPg, tvb, offset - 1,1,
1454 "(reserved for Code Page)");
1457 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1458 proto_tree_add_string(tree, hf_ucp_parm_RPLy, tvb, offset - 1,1,
1459 "(reserved for Reply type)");
1462 UcpHandleString(hf_ucp_parm_OTOA);
1463 UcpHandleString(hf_ucp_parm_HPLMN);
1464 tmpoff = offset; /* Extra services */
1465 while (tvb_get_guint8(tvb, tmpoff++) != '/')
1467 if ((tmpoff - offset) > 1) {
1468 int len = tmpoff - offset - 1;
1470 ti = proto_tree_add_item(tree, hf_ucp_parm_XSer,tvb,offset,len,FALSE);
1471 tmptvb = tvb_new_subset(tvb, offset, len + 1, len + 1);
1472 proto_item_add_subtree(ti, ett_XSer);
1473 ucp_handle_XSer(ti, tmptvb);
1476 UcpHandleData(hf_ucp_parm_RES4);
1477 UcpHandleData(hf_ucp_parm_RES5);
1480 #define add_5xR(a, b) add_30R(a, b)
1483 add_6xO(proto_tree *tree, tvbuff_t *tvb, guint8 OT)
1484 { /* 60-series operations */
1487 UcpHandleString(hf_ucp_parm_OAdC);
1488 UcpHandleByte(hf_ucp_parm_OTON);
1489 UcpHandleByte(hf_ucp_parm_ONPI);
1491 UcpHandleByte(hf_ucp_parm_STYP0);
1493 UcpHandleByte(hf_ucp_parm_STYP1);
1495 UcpHandleData(hf_ucp_parm_PWD);
1496 UcpHandleData(hf_ucp_parm_NPWD);
1497 UcpHandleString(hf_ucp_parm_VERS);
1498 UcpHandleString(hf_ucp_parm_LAdC);
1499 UcpHandleByte(hf_ucp_parm_LTON);
1500 UcpHandleByte(hf_ucp_parm_LNPI);
1501 UcpHandleInt(hf_ucp_parm_OPID);
1502 UcpHandleData(hf_ucp_parm_RES1);
1503 UcpHandleData(hf_ucp_parm_RES2);
1506 #define add_6xR(a, b) add_01R(a, b)
1509 * End of convenient shorthands
1511 #undef UcpHandleString
1512 #undef UcpHandleByte
1514 #undef UcpHandleTime
1515 #undef UcpHandleData
1517 /* Code to actually dissect the packets */
1519 * Overlapping data for these functions
1521 static int result, endpkt;
1524 * The heuristic dissector
1527 dissect_ucp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1529 guint8 O_R; /* Request or response */
1531 /* This runs atop TCP, so we are guaranteed that there is at least one
1532 byte in the tvbuff. */
1533 if (tvb_get_guint8(tvb, 0) != UCP_STX)
1536 result = check_ucp(tvb, &endpkt);
1538 if (result == UCP_MALFORMED)
1540 if (endpkt < UCP_OT_OFFSET + 1)
1542 * Might be shortened packet but don't handle anyway.
1547 * Try getting the operation-type and whether it's a request/response
1549 O_R = tvb_get_guint8(tvb, UCP_O_R_OFFSET);
1550 if (match_strval(O_R, vals_hdr_O_R) == NULL)
1553 * Ok, looks like a valid packet, go dissect.
1555 dissect_ucp(tvb, pinfo, tree);
1560 * The actual dissector
1563 dissect_ucp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1565 int offset = 0; /* Offset in packet within tvbuff */
1566 int tmpoff; /* Local offset value (per field) */
1567 guint8 O_R; /* Request or response */
1568 guint8 OT; /* Operation type */
1572 /* Set up structures needed to add the protocol subtree and manage it */
1575 proto_tree *ucp_tree;
1576 proto_tree *sub_tree;
1579 O_R = tvb_get_guint8(tvb, UCP_O_R_OFFSET);
1581 * So do an atoi() on the operation type
1583 OT = tvb_get_guint8(tvb, UCP_OT_OFFSET) - '0';
1584 OT = 10 * OT + (tvb_get_guint8(tvb, UCP_OT_OFFSET + 1) - '0');
1586 /* Make entries in Protocol column and Info column on summary display */
1587 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1588 col_set_str(pinfo->cinfo, COL_PROTOCOL, "UCP");
1590 if (check_col(pinfo->cinfo, COL_INFO)) {
1591 col_clear(pinfo->cinfo, COL_INFO);
1592 col_append_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
1593 val_to_str(OT, vals_hdr_OT, "unknown operation"),
1594 match_strval(O_R, vals_hdr_O_R));
1595 if (result == UCP_SHORTENED)
1596 col_append_str(pinfo->cinfo, COL_INFO, " [short packet]");
1597 else if (result == UCP_INV_CHK)
1598 col_append_str(pinfo->cinfo, COL_INFO, " [checksum invalid]");
1601 /* In the interest of speed, if "tree" is NULL, don't do any work not
1602 necessary to generate protocol tree items. */
1605 /* create display subtree for the protocol */
1606 ti = proto_tree_add_item(tree, proto_ucp, tvb, 0, -1, FALSE);
1608 ucp_tree = proto_item_add_subtree(ti, ett_ucp);
1610 * Process the packet here.
1611 * Transaction number
1613 offset++; /* Skip <stx> */
1615 intval = tvb_get_guint8(tvb, tmpoff++) - '0';
1616 intval = 10 * intval + (tvb_get_guint8(tvb, tmpoff++) - '0');
1617 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_TRN, tvb, offset,
1618 UCP_TRN_LEN, intval);
1621 offset++; /* Skip '/' */
1624 for (i = 0; i < UCP_LEN_LEN; i++) { /* Length */
1625 intval = 10 * intval +
1626 (tvb_get_guint8(tvb, tmpoff++) - '0');
1628 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_LEN, tvb, offset,
1629 UCP_LEN_LEN, intval);
1632 offset++; /* Operation/Response */
1633 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_O_R, tvb, offset++,
1636 offset++; /* Operation type */
1637 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_OT, tvb, offset,
1639 offset += UCP_OT_LEN;
1641 * Variable part starts here. Don't dissect if not complete.
1643 if (result == UCP_SHORTENED)
1645 tmp_tvb = tvb_new_subset(tvb, offset, -1, -1);
1646 sub_ti = proto_tree_add_item(ucp_tree, hf_ucp_oper_section, tvb,
1647 offset, endpkt - offset, FALSE);
1648 sub_tree = proto_item_add_subtree(sub_ti, ett_sub);
1652 O_R == 'O' ? add_00O(sub_tree,tmp_tvb) : add_00R(sub_tree,tmp_tvb);
1655 O_R == 'O' ? add_01O(sub_tree,tmp_tvb) : add_01R(sub_tree,tmp_tvb);
1658 O_R == 'O' ? add_02O(sub_tree,tmp_tvb) : add_02R(sub_tree,tmp_tvb);
1661 O_R == 'O' ? add_03O(sub_tree,tmp_tvb) : add_03R(sub_tree,tmp_tvb);
1664 O_R == 'O' ? add_04O(sub_tree,tmp_tvb) : add_04R(sub_tree,tmp_tvb);
1667 O_R == 'O' ? add_05O(sub_tree,tmp_tvb) : add_05R(sub_tree,tmp_tvb);
1670 O_R == 'O' ? add_06O(sub_tree,tmp_tvb) : add_06R(sub_tree,tmp_tvb);
1673 O_R == 'O' ? add_07O(sub_tree,tmp_tvb) : add_07R(sub_tree,tmp_tvb);
1676 O_R == 'O' ? add_08O(sub_tree,tmp_tvb) : add_08R(sub_tree,tmp_tvb);
1679 O_R == 'O' ? add_09O(sub_tree,tmp_tvb) : add_09R(sub_tree,tmp_tvb);
1682 O_R == 'O' ? add_10O(sub_tree,tmp_tvb) : add_10R(sub_tree,tmp_tvb);
1685 O_R == 'O' ? add_11O(sub_tree,tmp_tvb) : add_11R(sub_tree,tmp_tvb);
1688 O_R == 'O' ? add_12O(sub_tree,tmp_tvb) : add_12R(sub_tree,tmp_tvb);
1691 O_R == 'O' ? add_13O(sub_tree,tmp_tvb) : add_13R(sub_tree,tmp_tvb);
1694 O_R == 'O' ? add_14O(sub_tree,tmp_tvb) : add_14R(sub_tree,tmp_tvb);
1697 O_R == 'O' ? add_15O(sub_tree,tmp_tvb) : add_15R(sub_tree,tmp_tvb);
1700 O_R == 'O' ? add_16O(sub_tree,tmp_tvb) : add_16R(sub_tree,tmp_tvb);
1703 O_R == 'O' ? add_17O(sub_tree,tmp_tvb) : add_17R(sub_tree,tmp_tvb);
1706 O_R == 'O' ? add_18O(sub_tree,tmp_tvb) : add_18R(sub_tree,tmp_tvb);
1709 O_R == 'O' ? add_19O(sub_tree,tmp_tvb) : add_19R(sub_tree,tmp_tvb);
1712 O_R == 'O' ? add_20O(sub_tree,tmp_tvb) : add_20R(sub_tree,tmp_tvb);
1715 O_R == 'O' ? add_21O(sub_tree,tmp_tvb) : add_21R(sub_tree,tmp_tvb);
1718 O_R == 'O' ? add_22O(sub_tree,tmp_tvb) : add_22R(sub_tree,tmp_tvb);
1721 O_R == 'O' ? add_23O(sub_tree,tmp_tvb) : add_23R(sub_tree,tmp_tvb);
1724 O_R == 'O' ? add_24O(sub_tree,tmp_tvb) : add_24R(sub_tree,tmp_tvb);
1727 O_R == 'O' ? add_30O(sub_tree,tmp_tvb) : add_30R(sub_tree,tmp_tvb);
1730 O_R == 'O' ? add_31O(sub_tree,tmp_tvb) : add_31R(sub_tree,tmp_tvb);
1732 case 51: case 52: case 53: case 54: case 55: case 56: case 57:
1734 O_R == 'O' ? add_5xO(sub_tree,tmp_tvb) : add_5xR(sub_tree,tmp_tvb);
1737 O_R == 'O' ? add_6xO(sub_tree,tmp_tvb,OT) : add_6xR(sub_tree,tmp_tvb);
1746 /* Register the protocol with Ethereal */
1748 proto_register_ucp(void)
1751 /* Setup list of fields */
1752 static hf_register_info hf[] = {
1754 { "Transaction Reference Number", "ucp.hdr.TRN",
1755 FT_UINT8, BASE_DEC, NULL, 0x00,
1756 "Transaction number for this command, used in windowing.",
1761 { "Length", "ucp.hdr.LEN",
1762 FT_UINT16, BASE_DEC, NULL, 0x00,
1763 "Total number of characters between <stx>...<etx>.",
1768 { "Type", "ucp.hdr.O_R",
1769 FT_UINT8, BASE_DEC, VALS(vals_hdr_O_R), 0x00,
1770 "Your basic 'is a request or response'.",
1775 { "Operation", "ucp.hdr.OT",
1776 FT_UINT8, BASE_DEC, VALS(vals_hdr_OT), 0x00,
1777 "The operation that is requested with this message.",
1781 { &hf_ucp_oper_section,
1782 { "Data", "ucp.parm",
1783 FT_NONE, BASE_DEC, NULL, 0x00,
1784 "The actual content of the operation.",
1789 { "AdC", "ucp.parm.AdC",
1790 FT_STRING, BASE_NONE, NULL, 0x00,
1791 "Address code recipient.",
1795 { &hf_ucp_parm_OAdC,
1796 { "OAdC", "ucp.parm.OAdC",
1797 FT_STRING, BASE_NONE, NULL, 0x00,
1798 "Address code originator.",
1802 { &hf_ucp_parm_DAdC,
1803 { "DAdC", "ucp.parm.DAdC",
1804 FT_STRING, BASE_NONE, NULL, 0x00,
1805 "Diverted address code.",
1810 { "AC", "ucp.parm.AC",
1811 FT_STRING, BASE_NONE, NULL, 0x00,
1812 "Authentication code.",
1817 { "OAC", "ucp.parm.OAC",
1818 FT_STRING, BASE_NONE, NULL, 0x00,
1819 "Authentication code, originator.",
1824 { "NAC", "ucp.parm.NAC",
1825 FT_STRING, BASE_NONE, NULL, 0x00,
1826 "New authentication code.",
1831 { "BAS", "ucp.parm.BAS",
1832 FT_UINT8, BASE_DEC, VALS(vals_parm_BAS), 0x00,
1833 "Barring status flag.",
1838 { "LAR", "ucp.parm.LAR",
1839 FT_UINT8, BASE_DEC, VALS(vals_parm_LAR), 0x00,
1840 "Leg. code for all calls flag.",
1845 { "LAC", "ucp.parm.LAC",
1846 FT_STRING, BASE_NONE, NULL, 0x00,
1847 "New leg. code for all calls.",
1852 { "L1R", "ucp.parm.L1R",
1853 FT_UINT8, BASE_DEC, VALS(vals_parm_L1R), 0x00,
1854 "Leg. code for priority 1 flag.",
1859 { "L1P", "ucp.parm.L1P",
1860 FT_STRING, BASE_NONE, NULL, 0x00,
1861 "New leg. code for level 1 priority.",
1866 { "L3R", "ucp.parm.L3R",
1867 FT_UINT8, BASE_DEC, VALS(vals_parm_L3R), 0x00,
1868 "Leg. code for priority 3 flag.",
1873 { "L3P", "ucp.parm.L3P",
1874 FT_STRING, BASE_NONE, NULL, 0x00,
1875 "New leg. code for level 3 priority.",
1880 { "LCR", "ucp.parm.LCR",
1881 FT_UINT8, BASE_DEC, VALS(vals_parm_LCR), 0x00,
1882 "Leg. code for reverse charging flag.",
1887 { "LUR", "ucp.parm.LUR",
1888 FT_UINT8, BASE_DEC, VALS(vals_parm_LUR), 0x00,
1889 "Leg. code for urgent message flag.",
1894 { "LRR", "ucp.parm.LRR",
1895 FT_UINT8, BASE_DEC, VALS(vals_parm_LRR), 0x00,
1896 "Leg. code for repitition flag.",
1901 { "RT", "ucp.parm.RT",
1902 FT_UINT8, BASE_DEC, VALS(vals_parm_RT), 0x00,
1908 { "NoN", "ucp.parm.NoN",
1909 FT_UINT16, BASE_DEC, NULL, 0x00,
1910 "Maximum number of numerical characters accepted.",
1915 { "NoA", "ucp.parm.NoA",
1916 FT_UINT16, BASE_DEC, NULL, 0x00,
1917 "Maximum number of alphanumerical characters accepted.",
1922 { "NoB", "ucp.parm.NoB",
1923 FT_UINT16, BASE_DEC, NULL, 0x00,
1924 "Maximum number of data bits accepted.",
1929 { "PNC", "ucp.parm.PNC",
1930 FT_UINT8, BASE_DEC, VALS(vals_parm_PNC), 0x00,
1931 "Paging network controller.",
1936 { "LNo", "ucp.parm.LNo",
1937 FT_STRING, BASE_NONE, NULL, 0x00,
1938 "Standard text list number requested by calling party.",
1943 { "LST", "ucp.parm.LST",
1944 FT_STRING, BASE_NONE, NULL, 0x00,
1945 "Legitimisation code for standard text.",
1950 { "TNo", "ucp.parm.TNo",
1951 FT_STRING, BASE_NONE, NULL, 0x00,
1952 "Standard text number requested by calling party.",
1957 { "CS", "ucp.parm.CS",
1958 FT_UINT8, BASE_DEC, NULL, 0x00,
1959 "Additional character set number.",
1964 { "PID", "ucp.parm.PID",
1965 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
1971 { "NPL", "ucp.parm.NPL",
1972 FT_UINT16, BASE_DEC, NULL, 0x00,
1973 "Number of parameters in the following list.",
1978 { "GA", "ucp.parm.GA",
1979 FT_STRING, BASE_NONE, NULL, 0x00,
1980 "GA?? haven't got a clue.",
1985 { "RP", "ucp.parm.RP",
1986 FT_UINT8, BASE_DEC, VALS(vals_parm_RP), 0x00,
1987 "Repitition requested.",
1992 { "LRP", "ucp.parm.LRP",
1993 FT_STRING, BASE_DEC, NULL, 0x00,
1994 "Legitimisation code for repitition.",
1999 { "PR", "ucp.parm.PR",
2000 FT_UINT8, BASE_DEC, NULL, 0x00,
2001 "Priority requested.",
2006 { "LPR", "ucp.parm.LPR",
2007 FT_STRING, BASE_DEC, NULL, 0x00,
2008 "Legitimisation code for priority requested.",
2013 { "UM", "ucp.parm.UM",
2014 FT_UINT8, BASE_DEC, VALS(vals_parm_UM), 0x00,
2015 "Urgent message indicator.",
2020 { "LUM", "ucp.parm.LUM",
2021 FT_STRING, BASE_DEC, NULL, 0x00,
2022 "Legitimisation code for urgent message.",
2027 { "RC", "ucp.parm.RC",
2028 FT_UINT8, BASE_DEC, VALS(vals_parm_RC), 0x00,
2029 "Reverse charging request.",
2034 { "LRC", "ucp.parm.LRC",
2035 FT_STRING, BASE_DEC, NULL, 0x00,
2036 "Legitimisation code for reverse charging.",
2041 { "NRq", "ucp.parm.NRq",
2042 FT_UINT8, BASE_DEC, VALS(vals_parm_NRq), 0x00,
2043 "Notification request.",
2047 { &hf_ucp_parm_GAdC,
2048 { "GAdC", "ucp.parm.GAdC",
2049 FT_STRING, BASE_NONE, NULL, 0x00,
2050 "Group address code.",
2055 { "A_D", "ucp.parm.A_D",
2056 FT_UINT8, BASE_DEC, VALS(vals_parm_A_D), 0x00,
2057 "Add to/delete from fixed subscriber address list record.",
2062 { "CT", "ucp.parm.CT",
2063 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2064 "Accumulated charges timestamp.",
2069 { "AAC", "ucp.parm.AAC",
2070 FT_STRING, BASE_NONE, NULL, 0x00,
2071 "Accumulated charges.",
2076 { "MNo", "ucp.parm.MNo",
2077 FT_STRING, BASE_NONE, NULL, 0x00,
2083 { "R_T", "ucp.parm.R_T",
2084 FT_UINT8, BASE_DEC, VALS(vals_parm_R_T), 0x00,
2089 { &hf_ucp_parm_NAdC,
2090 { "NAdC", "ucp.parm.NAdC",
2091 FT_STRING, BASE_NONE, NULL, 0x00,
2092 "Notification address.",
2097 { "NT", "ucp.parm.NT",
2098 FT_UINT8, BASE_DEC, VALS(vals_parm_NT), 0x00,
2099 "Notification type.",
2103 { &hf_ucp_parm_IVR5x,
2104 { "IVR5x", "ucp.parm.IVR5x",
2105 FT_STRING, BASE_NONE, NULL, 0x00,
2106 "UCP release number supported/accepted.",
2110 { &hf_ucp_parm_REQ_OT,
2111 { "REQ_OT", "ucp.parm.REQ_OT",
2112 FT_UINT8, BASE_DEC, VALS(vals_parm_REQ_OT), 0x00,
2113 "UCP release number supported/accepted.",
2117 { &hf_ucp_parm_SSTAT,
2118 { "SSTAT", "ucp.parm.SSTAT",
2119 FT_UINT8, BASE_DEC, VALS(vals_parm_SSTAT), 0x00,
2120 "Supplementary services for which status is requested.",
2125 { "LMN", "ucp.parm.LMN",
2126 FT_UINT8, BASE_DEC, NULL, 0x00,
2127 "Last message number.",
2131 { &hf_ucp_parm_NMESS,
2132 { "NMESS", "ucp.parm.NMESS",
2133 FT_UINT8, BASE_DEC, NULL, 0x00,
2134 "Number of stored messages.",
2138 { &hf_ucp_parm_NMESS_str,
2139 { "NMESS_str", "ucp.parm.NMESS_str",
2140 FT_STRING, BASE_NONE, NULL, 0x00,
2141 "Number of stored messages.",
2145 { &hf_ucp_parm_NPID,
2146 { "NPID", "ucp.parm.NPID",
2147 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
2148 "Notification PID value.",
2153 { "LRq", "ucp.parm.LRq",
2154 FT_UINT8, BASE_DEC, VALS(vals_parm_LRq), 0x00,
2155 "Last resort address request.",
2159 { &hf_ucp_parm_LRAd,
2160 { "LRAd", "ucp.parm.LRAd",
2161 FT_STRING, BASE_NONE, NULL, 0x00,
2162 "Last resort address.",
2166 { &hf_ucp_parm_LPID,
2167 { "LPID", "ucp.parm.LPID",
2168 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
2169 "Last resort PID value.",
2174 { "DD", "ucp.parm.DD",
2175 FT_UINT8, BASE_DEC, VALS(vals_parm_DD), 0x00,
2176 "Deferred delivery requested.",
2181 { "DDT", "ucp.parm.DDT",
2182 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2183 "Deferred delivery time.",
2188 { "STx", "ucp.parm.STx",
2189 FT_NONE, BASE_NONE, NULL, 0x00,
2195 { "ST", "ucp.parm.ST",
2196 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2202 { "SP", "ucp.parm.SP",
2203 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2209 { "VP", "ucp.parm.VP",
2210 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2215 { &hf_ucp_parm_RPID,
2216 { "RPID", "ucp.parm.RPID",
2217 FT_STRING, BASE_NONE, NULL, 0x00,
2222 { &hf_ucp_parm_SCTS,
2223 { "SCTS", "ucp.parm.SCTS",
2224 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2225 "Service Centre timestamp.",
2230 { "Dst", "ucp.parm.Dst",
2231 FT_UINT8, BASE_DEC, VALS(vals_parm_Dst), 0x00,
2237 { "Rsn", "ucp.parm.Rsn",
2238 FT_UINT16, BASE_DEC, VALS(vals_parm_Rsn), 0x00,
2243 { &hf_ucp_parm_DSCTS,
2244 { "DSCTS", "ucp.parm.DSCTS",
2245 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2246 "Delivery timestamp.",
2251 { "MT", "ucp.parm.MT",
2252 FT_UINT8, BASE_DEC, VALS(vals_parm_MT), 0x00,
2258 { " NB", "ucp.parm.NB",
2259 FT_STRING, BASE_NONE, NULL, 0x00,
2260 "No. of bits in Transparent Data (TD) message.",
2264 { &hf_ucp_data_section,
2265 { " Data", "ucp.message",
2266 FT_NONE, BASE_NONE, NULL, 0x00,
2267 "The actual message or data.",
2272 { "MMS", "ucp.parm.MMS",
2273 FT_UINT8, BASE_DEC, NULL, 0x00,
2274 "More messages to send.",
2279 { "DCs", "ucp.parm.DCs",
2280 FT_UINT8, BASE_DEC, VALS(vals_parm_DCs), 0x00,
2281 "Data coding scheme (deprecated).",
2285 { &hf_ucp_parm_MCLs,
2286 { "MCLs", "ucp.parm.MCLs",
2287 FT_UINT8, BASE_DEC, VALS(vals_parm_MCLs), 0x00,
2293 { "RPI", "ucp.parm.RPI",
2294 FT_UINT8, BASE_DEC, VALS(vals_parm_RPI), 0x00,
2300 { "CPg", "ucp.parm.CPg",
2301 FT_STRING, BASE_NONE, NULL, 0x00,
2302 "Reserved for Code Page.",
2306 { &hf_ucp_parm_RPLy,
2307 { "RPLy", "ucp.parm.RPLy",
2308 FT_STRING, BASE_NONE, NULL, 0x00,
2309 "Reserved for Reply type.",
2313 { &hf_ucp_parm_OTOA,
2314 { "OTOA", "ucp.parm.OTOA",
2315 FT_STRING, BASE_NONE, NULL, 0x00,
2316 "Originator Type Of Address.",
2320 { &hf_ucp_parm_HPLMN,
2321 { "HPLMN", "ucp.parm.HPLMN",
2322 FT_STRING, BASE_NONE, NULL, 0x00,
2323 "Home PLMN address.",
2327 { &hf_ucp_parm_XSer,
2328 { "Extra services:", "ucp.parm.XSer",
2329 FT_NONE, BASE_DEC, NULL, 0x00,
2334 { &hf_ucp_parm_RES4,
2335 { "RES4", "ucp.parm.RES4",
2336 FT_STRING, BASE_NONE, NULL, 0x00,
2337 "Reserved for future use.",
2341 { &hf_ucp_parm_RES5,
2342 { "RES5", "ucp.parm.RES5",
2343 FT_STRING, BASE_NONE, NULL, 0x00,
2344 "Reserved for future use.",
2348 { &hf_ucp_parm_OTON,
2349 { "OTON", "ucp.parm.OTON",
2350 FT_UINT8, BASE_DEC, VALS(vals_parm_OTON), 0x00,
2351 "Originator type of number.",
2355 { &hf_ucp_parm_ONPI,
2356 { "ONPI", "ucp.parm.ONPI",
2357 FT_UINT8, BASE_DEC, VALS(vals_parm_ONPI), 0x00,
2358 "Originator numbering plan id.",
2362 { &hf_ucp_parm_STYP0,
2363 { "STYP0", "ucp.parm.STYP0",
2364 FT_UINT8, BASE_DEC, VALS(vals_parm_STYP0), 0x00,
2365 "Subtype of operation.",
2369 { &hf_ucp_parm_STYP1,
2370 { "STYP1", "ucp.parm.STYP1",
2371 FT_UINT8, BASE_DEC, VALS(vals_parm_STYP1), 0x00,
2372 "Subtype of operation.",
2377 { "PWD", "ucp.parm.PWD",
2378 FT_NONE, BASE_DEC, NULL, 0x00,
2379 "Current password.",
2383 { &hf_ucp_parm_NPWD,
2384 { "NPWD", "ucp.parm.NPWD",
2385 FT_NONE, BASE_DEC, NULL, 0x00,
2390 { &hf_ucp_parm_VERS,
2391 { "VERS", "ucp.parm.VERS",
2392 FT_STRING, BASE_NONE, NULL, 0x00,
2397 { &hf_ucp_parm_LAdC,
2398 { "LAdC", "ucp.parm.LAdC",
2399 FT_STRING, BASE_NONE, NULL, 0x00,
2400 "Address for VSMSC list operation.",
2404 { &hf_ucp_parm_LTON,
2405 { "LTON", "ucp.parm.LTON",
2406 FT_UINT8, BASE_DEC, NULL, 0x00,
2407 "Type of number list address.",
2411 { &hf_ucp_parm_LNPI,
2412 { "LNPI", "ucp.parm.LNPI",
2413 FT_UINT8, BASE_DEC, NULL, 0x00,
2414 "Numbering plan id. list address.",
2418 { &hf_ucp_parm_OPID,
2419 { "OPID", "ucp.parm.OPID",
2420 FT_UINT8, BASE_DEC, VALS(vals_parm_OPID), 0x00,
2421 "Originator protocol identifier.",
2425 { &hf_ucp_parm_RES1,
2426 { "RES1", "ucp.parm.RES1",
2427 FT_STRING, BASE_NONE, NULL, 0x00,
2428 "Reserved for future use.",
2432 { &hf_ucp_parm_RES2,
2433 { "RES2", "ucp.parm.RES2",
2434 FT_STRING, BASE_NONE, NULL, 0x00,
2435 "Reserved for future use.",
2440 { "(N)Ack", "ucp.parm.ACK",
2441 FT_UINT8, BASE_DEC, VALS(vals_parm_ACK), 0x00,
2442 "Positive or negative acknowledge of the operation.",
2447 { "MVP", "ucp.parm.MVP",
2448 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2449 "Mofified validity period.",
2454 { "Error code", "ucp.parm.EC",
2455 FT_UINT8, BASE_DEC, VALS(vals_parm_EC), 0x00,
2456 "The result of the requested operation.",
2461 { "SM", "ucp.parm.SM",
2462 FT_STRING, BASE_NONE, NULL, 0x00,
2468 { "Type of service", "ucp.xser.service",
2469 FT_UINT8, BASE_HEX, VALS(vals_xser_service), 0x00,
2470 "The type of service specified.",
2475 /* Setup protocol subtree array */
2476 static gint *ett[] = {
2481 /* Register the protocol name and description */
2482 proto_ucp = proto_register_protocol("Universal Computer Protocol",
2485 /* Required function calls to register header fields and subtrees used */
2486 proto_register_field_array(proto_ucp, hf, array_length(hf));
2487 proto_register_subtree_array(ett, array_length(ett));
2491 * If dissector uses sub-dissector registration add a registration routine.
2492 * This format is required because a script is used to find these routines and
2493 * create the code that calls these routines.
2496 proto_reg_handoff_ucp(void)
2498 dissector_handle_t ucp_handle;
2501 * UCP can be spoken on any port so, when not on a specific port, try this
2502 * one whenever TCP is spoken.
2504 heur_dissector_add("tcp", dissect_ucp_heur, proto_ucp);
2507 * Also register as one that can be selected by a TCP port number.
2509 ucp_handle = create_dissector_handle(dissect_ucp, proto_ucp);
2510 dissector_add_handle("tcp.port", ucp_handle);