2 * Routines for Universal Computer Protocol dissection
3 * Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
5 * $Id: packet-ucp.c,v 1.22 2004/03/05 10:47:53 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_AMsg = -1;
110 static int hf_ucp_parm_LNo = -1;
111 static int hf_ucp_parm_LST = -1;
112 static int hf_ucp_parm_TNo = -1;
113 static int hf_ucp_parm_CS = -1;
114 static int hf_ucp_parm_PID = -1;
115 static int hf_ucp_parm_NPL = -1;
116 static int hf_ucp_parm_GA = -1;
117 static int hf_ucp_parm_RP = -1;
118 static int hf_ucp_parm_LRP = -1;
119 static int hf_ucp_parm_PR = -1;
120 static int hf_ucp_parm_LPR = -1;
121 static int hf_ucp_parm_UM = -1;
122 static int hf_ucp_parm_LUM = -1;
123 static int hf_ucp_parm_RC = -1;
124 static int hf_ucp_parm_LRC = -1;
125 static int hf_ucp_parm_NRq = -1;
126 static int hf_ucp_parm_GAdC = -1;
127 static int hf_ucp_parm_A_D = -1;
128 static int hf_ucp_parm_CT = -1;
129 static int hf_ucp_parm_AAC = -1;
130 static int hf_ucp_parm_MNo = -1;
131 static int hf_ucp_parm_R_T = -1;
132 static int hf_ucp_parm_IVR5x = -1;
133 static int hf_ucp_parm_REQ_OT = -1;
134 static int hf_ucp_parm_SSTAT = -1;
135 static int hf_ucp_parm_LMN = -1;
136 static int hf_ucp_parm_NMESS = -1;
137 static int hf_ucp_parm_NMESS_str= -1;
138 static int hf_ucp_parm_NAdC = -1;
139 static int hf_ucp_parm_NT = -1;
140 static int hf_ucp_parm_NPID = -1;
141 static int hf_ucp_parm_LRq = -1;
142 static int hf_ucp_parm_LRAd = -1;
143 static int hf_ucp_parm_LPID = -1;
144 static int hf_ucp_parm_DD = -1;
145 static int hf_ucp_parm_DDT = -1;
146 static int hf_ucp_parm_STx = -1;
147 static int hf_ucp_parm_ST = -1;
148 static int hf_ucp_parm_SP = -1;
149 static int hf_ucp_parm_VP = -1;
150 static int hf_ucp_parm_RPID = -1;
151 static int hf_ucp_parm_SCTS = -1;
152 static int hf_ucp_parm_Dst = -1;
153 static int hf_ucp_parm_Rsn = -1;
154 static int hf_ucp_parm_DSCTS = -1;
155 static int hf_ucp_parm_MT = -1;
156 static int hf_ucp_parm_NB = -1;
157 static int hf_ucp_data_section = -1;
158 static int hf_ucp_parm_MMS = -1;
159 static int hf_ucp_parm_DCs = -1;
160 static int hf_ucp_parm_MCLs = -1;
161 static int hf_ucp_parm_RPI = -1;
162 static int hf_ucp_parm_CPg = -1;
163 static int hf_ucp_parm_RPLy = -1;
164 static int hf_ucp_parm_OTOA = -1;
165 static int hf_ucp_parm_HPLMN = -1;
166 static int hf_ucp_parm_RES4 = -1;
167 static int hf_ucp_parm_RES5 = -1;
168 static int hf_ucp_parm_OTON = -1;
169 static int hf_ucp_parm_ONPI = -1;
170 static int hf_ucp_parm_STYP0 = -1;
171 static int hf_ucp_parm_STYP1 = -1;
172 static int hf_ucp_parm_ACK = -1;
173 static int hf_ucp_parm_PWD = -1;
174 static int hf_ucp_parm_NPWD = -1;
175 static int hf_ucp_parm_VERS = -1;
176 static int hf_ucp_parm_LAdC = -1;
177 static int hf_ucp_parm_LTON = -1;
178 static int hf_ucp_parm_LNPI = -1;
179 static int hf_ucp_parm_OPID = -1;
180 static int hf_ucp_parm_RES1 = -1;
181 static int hf_ucp_parm_RES2 = -1;
182 static int hf_ucp_parm_MVP = -1;
183 static int hf_ucp_parm_EC = -1;
184 static int hf_ucp_parm_SM = -1;
186 static int hf_ucp_parm_XSer = -1;
187 static int hf_xser_service = -1;
189 /* Initialize the subtree pointers */
190 static gint ett_ucp = -1;
191 static gint ett_sub = -1;
192 static gint ett_XSer = -1;
195 * Value-arrays for certain field-contents
197 static const value_string vals_hdr_O_R[] = {
198 { 'O', "Operation" },
203 static const value_string vals_hdr_OT[] = { /* Operation type */
206 { 2, "Call input (multiple address)" },
207 { 3, "Call input (supplementary services included)" },
208 { 4, "Address list information" },
209 { 5, "Change address list" },
210 { 6, "Advice of accumulated charges" },
211 { 7, "Password management" },
212 { 8, "Legitimisation code management" },
213 { 9, "Standard text information" },
214 { 10, "Change standard text" },
215 { 11, "Request roaming information" },
216 { 12, "Change roaming information" },
217 { 13, "Roaming reset" },
218 { 14, "Message retrieval" },
219 { 15, "Request call barring" },
220 { 16, "Cancel call barring" },
221 { 17, "Request call diversion" },
222 { 18, "Cancel call diversion" },
223 { 19, "Request deferred delivery" },
224 { 20, "Cancel deferred delivery" },
225 { 21, "All features reset" },
226 { 22, "Call input (with specific character set)" },
227 { 23, "UCP version status request" },
228 { 24, "Mobile subscriber feature status request" },
229 { 30, "SMS message transfer" },
231 { 32, "(proprietary)" },
232 { 34, "(proprietary)" },
233 { 36, "(proprietary)" },
234 { 38, "(proprietary)" },
235 { 40, "(proprietary)" },
236 { 41, "(proprietary)" },
237 { 42, "(proprietary)" },
238 { 43, "(proprietary)" },
239 { 44, "(proprietary)" },
240 { 45, "(proprietary)" },
241 { 51, "Submit short message" },
242 { 52, "Deliver short message" },
243 { 53, "Deliver notification" },
244 { 54, "Modify message" },
245 { 55, "Inquiry message" },
246 { 56, "Delete message" },
247 { 57, "Inquiry response message" },
248 { 58, "Delete response message" },
249 { 60, "Session management" },
250 { 61, "List management" },
251 { 95, "(proprietary)" },
252 { 96, "(proprietary)" },
253 { 97, "(proprietary)" },
254 { 98, "(proprietary)" },
255 { 99, "(proprietary)" },
259 static const value_string vals_parm_EC[] = { /* Error code */
260 { 1, "Checksum error" },
261 { 2, "Syntax error" },
262 { 3, "Operation not supported by system" },
263 { 4, "Operation not allowed" },
264 { 5, "Call barring active" },
265 { 6, "AdC invalid" },
266 { 7, "Authentication failure" },
267 { 8, "Legitimisation code for all calls, failure" },
268 { 9, "GA not valid" },
269 { 10, "Repetition not allowed" },
270 { 11, "Legitimisation code for repetition, failure" },
271 { 12, "Priority call not allowed" },
272 { 13, "Legitimisation code for priority call, failure" },
273 { 14, "Urgent message not allowed" },
274 { 15, "Legitimisation code for urgent message, failure" },
275 { 16, "Reverse charging not alllowed" },
276 { 17, "Legitimisation code for rev. charging, failure" },
277 { 18, "Deferred delivery not allowed" },
278 { 19, "New AC not valid" },
279 { 20, "New legitimisation code not valid" },
280 { 21, "Standard text not valid" },
281 { 22, "Time period not valid" },
282 { 23, "Message type not supported by system" },
283 { 24, "Message too long" },
284 { 25, "Requested standard text not valid" },
285 { 26, "Message type not valid for the pager type" },
286 { 27, "Message not found in SMSC" },
287 { 28, "Invalid character set" },
288 { 30, "Subscriber hang-up" },
289 { 31, "Fax group not supported" },
290 { 32, "Fax message type not supported" },
291 { 33, "Address already in list (60-series)" },
292 { 34, "Address not in list (60-series)" },
293 { 35, "List full, cannot add address to list (60-series)" },
294 { 36, "RPID already in use" },
295 { 37, "Delivery in progress" },
296 { 38, "Message forwarded" },
297 { 50, "Low network status" },
298 { 51, "Legitimisation code for standard text, failure" },
299 { 53, "Operation partially successfull" },
300 { 54, "Operation not successfull" },
301 { 55, "System error" },
302 { 57, "AdC already a member of GAdC address list" },
303 { 58, "AdC not a member of GAdC address list" },
304 { 59, "Requested standard text list invalid" },
305 { 61, "Not controller of GAdC address list" },
306 { 62, "Standard text too large" },
307 { 63, "Not owner of standard text list" },
308 { 64, "Address list full" },
309 { 65, "GAdC invalid" },
310 { 66, "Operation restricted to mobile subscribers" },
311 { 68, "Invalid AdC type" },
312 { 69, "Cannot add AdC to GAdC address list" },
313 { 90, "(proprietary error code)" },
314 { 91, "(proprietary error code)" },
315 { 92, "(proprietary error code)" },
316 { 93, "(proprietary error code)" },
317 { 94, "(proprietary error code)" },
318 { 95, "(proprietary error code)" },
319 { 96, "(proprietary error code)" },
320 { 97, "(proprietary error code)" },
321 { 98, "(proprietary error code)" },
322 { 99, "(proprietary error code)" },
326 static const value_string vals_parm_NRq[] = {
327 { '0', "NAdC not used" },
328 { '1', "NAdC used" },
332 static const value_string vals_parm_NT[] = {
333 { '0', "Default value" },
334 { '1', "Delivery notification" },
335 { '2', "Non-delivery notification" },
336 { '3', "Delivery and Non-delivery notification" },
337 { '4', "Buffered message notification" },
338 { '5', "Buffered and Delivery notification" },
339 { '6', "Buffered and Non-delivery notification" },
340 { '7', "All notifications" },
344 static const value_string vals_parm_PID[] = {
345 { 100, "Mobile station" },
346 { 122, "Fax Group 3" },
348 { 138, "Menu over PSTN" },
349 { 139, "PC appl. over PSTN (E.164)" },
350 { 339, "PC appl. over X.25 (X.121)" },
351 { 439, "PC appl. over ISDN (E.164)" },
352 { 539, "PC appl. over TCP/IP" },
356 static const value_string vals_parm_LRq[] = {
357 { '0', "LRAd not used" },
358 { '1', "LRAd used" },
362 static const value_string vals_parm_DD[] = {
363 { '0', "DDT not used" },
368 static const value_string vals_parm_Dst[] = {
369 { '0', "delivered" },
370 { '1', "buffered (see Rsn)" },
371 { '2', "not delivered (see Rsn)" },
375 static const value_string vals_parm_Rsn[] = {
376 { 0, "Unknown subscriber" },
377 { 1, "Service temporary not available" },
378 { 2, "Service temporary not available" },
379 { 3, "Service temporary not available" },
380 { 4, "Service temporary not available" },
381 { 5, "Service temporary not available" },
382 { 6, "Service temporary not available" },
383 { 7, "Service temporary not available" },
384 { 8, "Service temporary not available" },
385 { 9, "Illegal error code" },
386 { 10, "Network time-out" },
387 { 100, "Facility not supported" },
388 { 101, "Unknown subscriber" },
389 { 102, "Facility not provided" },
390 { 103, "Call barred" },
391 { 104, "Operation barred" },
392 { 105, "SC congestion" },
393 { 106, "Facility not supported" },
394 { 107, "Absent subscriber" },
395 { 108, "Delivery fail" },
396 { 109, "Sc congestion" },
397 { 110, "Protocol error" },
398 { 111, "MS not equiped" },
399 { 112, "Unknown SC" },
400 { 113, "SC congestion" },
401 { 114, "Illegal MS" },
402 { 115, "MS nota subscriber" },
403 { 116, "Error in MS" },
404 { 117, "SMS lower layer not provisioned" },
405 { 118, "System fail" },
406 { 119, "PLMN system failure" },
407 { 120, "HLR system failure" },
408 { 121, "VLR system failure" },
409 { 122, "Previous VLR system failure" },
410 { 123, "Controlling MSC system failure" },
411 { 124, "VMSC system failure" },
412 { 125, "EIR system failure" },
413 { 126, "System failure" },
414 { 127, "Unexpected data value" },
415 { 200, "Error in address service centre" },
416 { 201, "Invalid absolute validity period" },
417 { 202, "Short message exceeds maximum" },
418 { 203, "Unable to unpack GSM message" },
419 { 204, "Unable to convert to IRA alphabet" },
420 { 205, "Invalid validity period format" },
421 { 206, "Invalid destination address" },
422 { 207, "Duplicate message submit" },
423 { 208, "Invalid message type indicator" },
427 static const value_string vals_parm_MT[] = {
428 { '2', "Numeric message" },
429 { '3', "Alphanumeric message" },
430 { '4', "Transparent data" },
434 static const value_string vals_parm_DCs[] = {
435 { '0', "default alphabet" },
436 { '1', "User defined data (8 bit)" },
440 static const value_string vals_parm_MCLs[] = {
441 { '0', "message class 0" },
442 { '1', "message class 1" },
443 { '2', "message class 2" },
444 { '3', "message class 3" },
448 static const value_string vals_parm_RPI[] = {
454 static const value_string vals_parm_ACK[] = {
460 static const value_string vals_parm_RP[] = {
461 { '1', "Repetition requested" },
465 static const value_string vals_parm_UM[] = {
466 { '1', "Urgent message" },
470 static const value_string vals_parm_RC[] = {
471 { '1', "Reverse charging request" },
475 static const value_string vals_parm_OTON[] = {
476 { '1', "International number" },
477 { '2', "National number" },
478 { '6', "Abbreviated number (short number alias)" },
482 static const value_string vals_parm_ONPI[] = {
483 { '1', "E.164 address" },
484 { '3', "X.121 address" },
485 { '5', "Private -TCP/IP or abbreviated number- address" },
489 static const value_string vals_parm_STYP0[] = {
490 { '1', "open session" },
492 { '3', "change password" },
493 { '4', "open provisioning session" },
495 { '6', "change provisioning password" },
499 static const value_string vals_parm_STYP1[] = {
500 { '1', "add item to mo-list" },
501 { '2', "remove item from mo-list" },
502 { '3', "verify item mo-list" },
503 { '4', "add item to mt-list" },
504 { '5', "remove item from mt-list" },
505 { '6', "verify item mt-list" },
509 static const value_string vals_parm_OPID[] = {
510 { 0, "Mobile station" },
511 { 39, "PC application" },
515 static const value_string vals_parm_BAS[] = {
520 static const value_string vals_parm_LAR[] = {
521 { '1', "Leg. code for all calls requested" },
525 static const value_string vals_parm_L1R[] = {
526 { '1', "Leg. code for priority 1 requested" },
530 static const value_string vals_parm_L3R[] = {
531 { '1', "Leg. code for priority 3 requested" },
535 static const value_string vals_parm_LCR[] = {
536 { '1', "Leg. code for reverse charging requested" },
540 static const value_string vals_parm_LUR[] = {
541 { '1', "Leg. code for urgent message requested" },
545 static const value_string vals_parm_LRR[] = {
546 { '1', "Leg. code for repitition requested" },
550 static const value_string vals_parm_RT[] = {
551 { '1', "Tone only" },
553 { '3', "Alphanumeric" },
554 { '4', "Transparent data" },
558 static const value_string vals_parm_PNC[] = {
560 { 'I', "Input PNC" },
564 static const value_string vals_parm_A_D[] = {
570 static const value_string vals_parm_R_T[] = {
571 { 'R', "Retrieval Ok" },
572 { 'T', "Retransmit on radio channel" },
576 static const value_string vals_parm_REQ_OT[] = {
577 { 'S', "Send used operation types" },
578 { 'N', "Don't send used operation types" },
582 static const value_string vals_parm_SSTAT[] = {
583 { '0', "All services" },
584 { '1', "All in the moment active servics" },
585 { '2', "Call diversion" },
586 { '3', "Roaming information status" },
587 { '4', "Call barring status" },
588 { '5', "Deferred delivery status" },
589 { '6', "Number of stored messages" },
593 static const value_string vals_xser_service[] = {
594 { 1, "GSM UDH information" },
595 { 2, "GSM DCS information" },
596 { 3, "[Message Type] TDMA information exchange" },
597 { 4, "[Message Reference] TDMA information exchange" },
598 { 5, "[Privacy Indicator] TDMA information exchange" },
599 { 6, "[Urgency Indicator] TDMA information exchange" },
600 { 7, "[Acknowledgement Request] TDMA information exchange" },
601 { 8, "[Messsage Updating] TDMA information exchange" },
602 { 9, "[Call Back Number] TDMA information exchange" },
603 { 10, "[Response Code] TDMA information exchange" },
604 { 11, "[Teleservice ID] TDMA information exchange" },
605 { 12, "Billing identifier" },
606 { 13, "Single shot indicator" },
611 * Checks whether the PDU looks a bit like UCP and checks the checksum
613 * \param tvb The buffer with PDU-data
614 * \param endpkt Returns pointer, indicating the end of the PDU
616 * \return The state of this PDU
617 * \retval 0 Definitely UCP
618 * \retval UCP_SHORTENED Packet may be there, but not complete
619 * \retval UCP_MALFORMED Hmmmm, not UCP after all...
620 * \retval UCP_INV_CHK Nice packet, but checksum doesn't add up...
623 check_ucp(tvbuff_t *tvb, int *endpkt)
630 length = tvb_find_guint8(tvb, offset, -1, UCP_ETX);
632 *endpkt = tvb_reported_length_remaining(tvb, offset);
633 return UCP_SHORTENED;
635 if (length > (int) tvb_reported_length(tvb)) {
637 return UCP_MALFORMED;
639 for (; offset < (guint) (length - 2); offset++)
640 checksum += tvb_get_guint8(tvb, offset);
642 tmp = tvb_get_guint8(tvb, offset++);
643 pkt_check = AHex2Bin(tmp);
644 tmp = tvb_get_guint8(tvb, offset++);
645 pkt_check = 16 * pkt_check + AHex2Bin(tmp);
646 *endpkt = offset + 1;
647 if (checksum == (guint) pkt_check)
654 * UCP equivalent of mktime() (3). Convert date to standard 'time_t' format
656 * \param datestr The UCP-formatted date to convert
658 * \return The date in standard 'time_t' format.
661 ucp_mktime(char *datestr)
665 r_time.tm_mday = 10 * (datestr[0] - '0') + (datestr[1] - '0');
666 r_time.tm_mon = (10 * (datestr[2] - '0') + (datestr[3] - '0')) - 1;
667 r_time.tm_year = 10 * (datestr[4] - '0') + (datestr[5] - '0');
668 if (r_time.tm_year < 90)
669 r_time.tm_year += 100;
670 r_time.tm_hour = 10 * (datestr[6] - '0') + (datestr[7] - '0');
671 r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0');
673 r_time.tm_sec = 10 * (datestr[10] - '0') + (datestr[11] - '0');
676 r_time.tm_isdst = -1;
677 return mktime(&r_time);
681 * Scanning routines to add standard types (byte, int, string, data)
682 * to the protocol-tree. Each field is seperated with a slash ('/').
684 * \param tree The protocol tree to add to
685 * \param tvb Buffer containing the data
686 * \param field The actual field, whose value needs displaying
687 * \param offset Location of field within the buffer, returns location
690 * \return For 'int'-types, the value of the field.
693 ucp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
697 int tmpoff = *offset;
700 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
703 strval[--idx] = '\0';
704 proto_tree_add_string(tree, field, tvb, *offset, idx, strval);
710 ucp_handle_IRAstring(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
712 char strval[BUFSIZ + 1],
716 int tmpoff = *offset;
718 while (((byte = tvb_get_guint8(tvb, tmpoff++)) != '/') &&
721 if (byte >= '0' && byte <= '9')
723 *p_dst = (byte - '0') * 16;
727 *p_dst = (byte - 'A' + 10) * 16;
729 if ((byte = tvb_get_guint8(tvb, tmpoff++)) == '/')
733 if (byte >= '0' && byte <= '9')
735 *p_dst++ += byte - '0';
739 *p_dst++ += byte - 'A' + 10;
747 * Data clipped, eat rest of field
749 while ((tvb_get_guint8(tvb, tmpoff++)) != '/')
752 if ((tmpoff - *offset) > 1)
753 proto_tree_add_string(tree, field, tvb, *offset,
754 tmpoff - *offset - 1, strval);
759 ucp_handle_byte(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
763 if ((intval = tvb_get_guint8(tvb, (*offset)++)) != '/') {
764 proto_tree_add_uint(tree, field, tvb, *offset - 1, 1, intval);
771 ucp_handle_int(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
775 int tmpoff = *offset;
778 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
781 strval[--idx] = '\0';
782 intval = atoi(strval);
783 proto_tree_add_uint(tree, field, tvb, *offset, idx, intval);
790 ucp_handle_time(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
795 int tmpoff = *offset;
798 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
801 strval[--idx] = '\0';
802 tval = ucp_mktime(strval);
805 proto_tree_add_time(tree, field, tvb, *offset, idx, &tmptime);
811 ucp_handle_data(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
813 int tmpoff = *offset;
815 while (tvb_get_guint8(tvb, tmpoff++) != '/')
817 if ((tmpoff - *offset) > 1)
818 proto_tree_add_item(tree, field, tvb, *offset,
819 tmpoff - *offset - 1, FALSE);
824 * Handle the data-field within the UCP-message, according the Message Type
826 * - 2 Numeric message
827 * - 3 Alphanumeric message
828 * - 4 Transparent (binary) data
829 * - 5 Standard text handling
830 * - 6 Alphanumeric message in specified character set
832 * \param tree The protocol tree to add to
833 * \param tvb Buffer containing the data
834 * \param field The actual field, whose value needs displaying
835 * \param offset Location of field within the buffer, returns location
839 ucp_handle_mt(proto_tree *tree, tvbuff_t *tvb, int *offset)
843 intval = ucp_handle_byte(tree, tvb, hf_ucp_parm_MT, offset);
845 case '1': /* Tone only, no data */
847 case '4': /* TMsg, no of bits */
848 ucp_handle_string(tree, tvb, hf_ucp_parm_NB, offset);
849 /* fall through here for the data piece */
851 ucp_handle_data(tree, tvb, hf_ucp_data_section, offset);
854 ucp_handle_IRAstring(tree, tvb, hf_ucp_parm_AMsg, offset);
857 ucp_handle_byte(tree, tvb, hf_ucp_parm_PNC, offset);
858 ucp_handle_string(tree, tvb, hf_ucp_parm_LNo, offset);
859 ucp_handle_string(tree, tvb, hf_ucp_parm_LST, offset);
860 ucp_handle_string(tree, tvb, hf_ucp_parm_TNo, offset);
863 ucp_handle_data(tree, tvb, hf_ucp_data_section, offset);
864 ucp_handle_int(tree, tvb, hf_ucp_parm_CS, offset);
867 break; /* No data so ? */
872 * Handle the data within the 'Extended services' field. Each field having the
873 * format TTLLDD..., TT being the type of service, LL giving the length of the
874 * field, DD... containing the actual data
876 * \param tree The protocol tree to add to
877 * \param tvb Buffer containing the extended services data
880 ucp_handle_XSer(proto_tree *tree, tvbuff_t *tvb)
887 while ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
888 service = AHex2Bin(intval);
889 intval = tvb_get_guint8(tvb, offset++);
890 service = service * 16 + AHex2Bin(intval);
891 intval = tvb_get_guint8(tvb, offset++);
892 len = AHex2Bin(intval);
893 intval = tvb_get_guint8(tvb, offset++);
894 len = len * 16 + AHex2Bin(intval);
895 proto_tree_add_uint(tree, hf_xser_service, tvb, offset,
901 /* Next definitions are just a convenient shorthand to make the coding a
902 * bit more readable instead of summing up all these parameters.
904 #define UcpHandleString(field) ucp_handle_string(tree, tvb, (field), &offset)
906 #define UcpHandleIRAString(field) \
907 ucp_handle_IRAstring(tree, tvb, (field), &offset)
909 #define UcpHandleByte(field) ucp_handle_byte(tree, tvb, (field), &offset)
911 #define UcpHandleInt(field) ucp_handle_int(tree, tvb, (field), &offset)
913 #define UcpHandleTime(field) ucp_handle_time(tree, tvb, (field), &offset)
915 #define UcpHandleData(field) ucp_handle_data(tree, tvb, (field), &offset)
918 * The next set of routines handle the different operation types,
919 * associated with UCP.
922 add_00O(proto_tree *tree, tvbuff_t *tvb)
926 UcpHandleString(hf_ucp_parm_AdC);
927 UcpHandleString(hf_ucp_parm_OAdC);
928 UcpHandleString(hf_ucp_parm_OAC);
932 add_00R(proto_tree *tree, tvbuff_t *tvb)
937 intval = UcpHandleByte(hf_ucp_parm_ACK);
940 UcpHandleByte(hf_ucp_parm_BAS);
941 UcpHandleByte(hf_ucp_parm_LAR);
942 UcpHandleByte(hf_ucp_parm_L1R);
943 UcpHandleByte(hf_ucp_parm_L3R);
944 UcpHandleByte(hf_ucp_parm_LCR);
945 UcpHandleByte(hf_ucp_parm_LUR);
946 UcpHandleByte(hf_ucp_parm_LRR);
947 UcpHandleByte(hf_ucp_parm_RT);
948 UcpHandleInt(hf_ucp_parm_NoN);
949 UcpHandleInt(hf_ucp_parm_NoA);
950 UcpHandleInt(hf_ucp_parm_NoB);
952 UcpHandleInt(hf_ucp_parm_EC);
953 UcpHandleString(hf_ucp_parm_SM);
958 add_01O(proto_tree *tree, tvbuff_t *tvb)
962 UcpHandleString(hf_ucp_parm_AdC);
963 UcpHandleString(hf_ucp_parm_OAdC);
964 UcpHandleString(hf_ucp_parm_OAC);
965 ucp_handle_mt(tree, tvb, &offset);
969 add_01R(proto_tree *tree, tvbuff_t *tvb)
974 intval = UcpHandleByte(hf_ucp_parm_ACK);
976 UcpHandleInt(hf_ucp_parm_EC);
977 UcpHandleString(hf_ucp_parm_SM);
981 add_02O(proto_tree *tree, tvbuff_t *tvb)
982 { /* Multiple address call input*/
987 intval = UcpHandleInt(hf_ucp_parm_NPL);
988 for (idx = 0; idx < intval; idx++)
989 UcpHandleString(hf_ucp_parm_AdC);
991 UcpHandleString(hf_ucp_parm_OAdC);
992 UcpHandleString(hf_ucp_parm_OAC);
993 ucp_handle_mt(tree, tvb, &offset);
996 #define add_02R(a, b) add_01R(a,b)
999 add_03O(proto_tree *tree, tvbuff_t *tvb)
1000 { /* Call input with SS */
1005 UcpHandleString(hf_ucp_parm_AdC);
1006 UcpHandleString(hf_ucp_parm_OAdC);
1007 UcpHandleString(hf_ucp_parm_OAC);
1008 intval = UcpHandleInt(hf_ucp_parm_NPL);
1009 for (idx = 0; idx < intval; idx++)
1010 UcpHandleString(hf_ucp_parm_GA);
1012 UcpHandleByte(hf_ucp_parm_RP);
1013 UcpHandleString(hf_ucp_parm_LRP);
1014 UcpHandleByte(hf_ucp_parm_PR);
1015 UcpHandleString(hf_ucp_parm_LPR);
1016 UcpHandleByte(hf_ucp_parm_UM);
1017 UcpHandleString(hf_ucp_parm_LUM);
1018 UcpHandleByte(hf_ucp_parm_RC);
1019 UcpHandleString(hf_ucp_parm_LRC);
1020 UcpHandleByte(hf_ucp_parm_DD);
1021 UcpHandleTime(hf_ucp_parm_DDT);
1022 ucp_handle_mt(tree, tvb, &offset);
1025 #define add_03R(a, b) add_01R(a,b)
1028 add_04O(proto_tree *tree, tvbuff_t *tvb)
1029 { /* Address list information */
1032 UcpHandleString(hf_ucp_parm_GAdC);
1033 UcpHandleString(hf_ucp_parm_AC);
1034 UcpHandleString(hf_ucp_parm_OAdC);
1035 UcpHandleString(hf_ucp_parm_OAC);
1039 add_04R(proto_tree *tree, tvbuff_t *tvb)
1045 intval = UcpHandleByte(hf_ucp_parm_ACK);
1046 if (intval == 'A') {
1047 intval = UcpHandleInt(hf_ucp_parm_NPL);
1048 for (idx = 0; idx < intval; idx++)
1049 UcpHandleString(hf_ucp_parm_AdC);
1050 UcpHandleString(hf_ucp_parm_GAdC);
1052 UcpHandleInt(hf_ucp_parm_EC);
1053 UcpHandleString(hf_ucp_parm_SM);
1057 add_05O(proto_tree *tree, tvbuff_t *tvb)
1058 { /* Change address list */
1063 UcpHandleString(hf_ucp_parm_GAdC);
1064 UcpHandleString(hf_ucp_parm_AC);
1065 UcpHandleString(hf_ucp_parm_OAdC);
1066 UcpHandleString(hf_ucp_parm_OAC);
1067 intval = UcpHandleInt(hf_ucp_parm_NPL);
1068 for (idx = 0; idx < intval; idx++)
1069 UcpHandleString(hf_ucp_parm_AdC);
1070 UcpHandleByte(hf_ucp_parm_A_D);
1073 #define add_05R(a, b) add_01R(a, b)
1076 add_06O(proto_tree *tree, tvbuff_t *tvb)
1077 { /* Advice of accum. charges */
1080 UcpHandleString(hf_ucp_parm_AdC);
1081 UcpHandleString(hf_ucp_parm_AC);
1085 add_06R(proto_tree *tree, tvbuff_t *tvb)
1090 intval = UcpHandleByte(hf_ucp_parm_ACK);
1091 if (intval == 'A') {
1092 UcpHandleTime(hf_ucp_parm_CT);
1093 UcpHandleString(hf_ucp_parm_AAC);
1095 UcpHandleInt(hf_ucp_parm_EC);
1096 UcpHandleString(hf_ucp_parm_SM);
1100 add_07O(proto_tree *tree, tvbuff_t *tvb)
1101 { /* Password management */
1104 UcpHandleString(hf_ucp_parm_AdC);
1105 UcpHandleString(hf_ucp_parm_AC);
1106 UcpHandleString(hf_ucp_parm_NAC);
1109 #define add_07R(a, b) add_01R(a, b)
1112 add_08O(proto_tree *tree, tvbuff_t *tvb)
1113 { /* Leg. code management */
1116 UcpHandleString(hf_ucp_parm_AdC);
1117 UcpHandleString(hf_ucp_parm_AC);
1118 UcpHandleString(hf_ucp_parm_LAC);
1119 UcpHandleString(hf_ucp_parm_L1P);
1120 UcpHandleString(hf_ucp_parm_L3P);
1121 UcpHandleString(hf_ucp_parm_LRC);
1122 UcpHandleString(hf_ucp_parm_LUM);
1123 UcpHandleString(hf_ucp_parm_LRP);
1124 UcpHandleString(hf_ucp_parm_LST);
1127 #define add_08R(a, b) add_01R(a, b)
1130 add_09O(proto_tree *tree, tvbuff_t *tvb)
1131 { /* Standard text information */
1134 UcpHandleString(hf_ucp_parm_LNo);
1135 UcpHandleString(hf_ucp_parm_LST);
1139 add_09R(proto_tree *tree, tvbuff_t *tvb)
1145 intval = UcpHandleByte(hf_ucp_parm_ACK);
1146 if (intval == 'A') {
1147 intval = UcpHandleInt(hf_ucp_parm_NPL);
1148 for (idx = 0; idx < intval; idx++)
1149 UcpHandleString(hf_ucp_parm_LST);
1151 UcpHandleInt(hf_ucp_parm_EC);
1152 UcpHandleString(hf_ucp_parm_SM);
1156 add_10O(proto_tree *tree, tvbuff_t *tvb)
1157 { /* Change standard text */
1160 UcpHandleString(hf_ucp_parm_AdC);
1161 UcpHandleString(hf_ucp_parm_AC);
1162 UcpHandleString(hf_ucp_parm_LNo);
1163 UcpHandleString(hf_ucp_parm_TNo);
1164 UcpHandleData(hf_ucp_parm_STx);
1165 UcpHandleInt(hf_ucp_parm_CS);
1168 #define add_10R(a, b) add_01R(a, b)
1170 #define add_11O(a, b) add_06O(a, b) /* Request roaming info */
1173 add_11R(proto_tree *tree, tvbuff_t *tvb)
1179 intval = UcpHandleByte(hf_ucp_parm_ACK);
1180 if (intval == 'A') {
1181 intval = UcpHandleInt(hf_ucp_parm_NPL);
1182 for (idx = 0; idx < intval; idx++)
1183 UcpHandleString(hf_ucp_parm_GA);
1185 UcpHandleInt(hf_ucp_parm_EC);
1186 UcpHandleString(hf_ucp_parm_SM);
1190 add_12O(proto_tree *tree, tvbuff_t *tvb)
1191 { /* Change roaming */
1196 UcpHandleString(hf_ucp_parm_AdC);
1197 UcpHandleString(hf_ucp_parm_AC);
1198 intval = UcpHandleInt(hf_ucp_parm_NPL);
1199 for (idx = 0; idx < intval; idx++)
1200 UcpHandleString(hf_ucp_parm_GA);
1203 #define add_12R(a, b) add_01R(a, b)
1205 #define add_13O(a, b) add_06O(a, b) /* Roaming reset */
1207 #define add_13R(a, b) add_01R(a, b)
1210 add_14O(proto_tree *tree, tvbuff_t *tvb)
1211 { /* Message retrieval */
1214 UcpHandleString(hf_ucp_parm_AdC);
1215 UcpHandleString(hf_ucp_parm_AC);
1216 UcpHandleString(hf_ucp_parm_MNo);
1217 UcpHandleByte(hf_ucp_parm_R_T);
1221 add_14R(proto_tree *tree, tvbuff_t *tvb)
1227 intval = UcpHandleByte(hf_ucp_parm_ACK);
1228 if (intval == 'A') {
1229 intval = UcpHandleInt(hf_ucp_parm_NPL);
1231 * Spec is unclear here. Is 'SM' part of the Msg:s field or not?
1232 * For now, assume it is part of it...
1234 for (idx = 0; idx < intval; idx++)
1235 UcpHandleData(hf_ucp_data_section);
1237 UcpHandleInt(hf_ucp_parm_EC);
1238 UcpHandleString(hf_ucp_parm_SM);
1243 add_15O(proto_tree *tree, tvbuff_t *tvb)
1244 { /* Request call barring */
1247 UcpHandleString(hf_ucp_parm_AdC);
1248 UcpHandleString(hf_ucp_parm_AC);
1249 UcpHandleTime(hf_ucp_parm_ST);
1250 UcpHandleTime(hf_ucp_parm_SP);
1253 #define add_15R(a, b) add_01R(a, b)
1255 #define add_16O(a, b) add_06O(a, b) /* Cancel call barring */
1257 #define add_16R(a, b) add_01R(a, b)
1260 add_17O(proto_tree *tree, tvbuff_t *tvb)
1261 { /* Request call diversion */
1264 UcpHandleString(hf_ucp_parm_AdC);
1265 UcpHandleString(hf_ucp_parm_AC);
1266 UcpHandleString(hf_ucp_parm_DAdC);
1267 UcpHandleTime(hf_ucp_parm_ST);
1268 UcpHandleTime(hf_ucp_parm_SP);
1271 #define add_17R(a, b) add_01R(a, b)
1273 #define add_18O(a, b) add_06O(a, b) /* Cancel call diversion */
1275 #define add_18R(a, b) add_01R(a, b)
1278 add_19O(proto_tree *tree, tvbuff_t *tvb)
1279 { /* Request deferred delivery*/
1282 UcpHandleString(hf_ucp_parm_AdC);
1283 UcpHandleString(hf_ucp_parm_AC);
1284 UcpHandleTime(hf_ucp_parm_ST);
1285 UcpHandleTime(hf_ucp_parm_SP);
1288 #define add_19R(a, b) add_01R(a, b)
1290 #define add_20O(a, b) add_06O(a, b) /* Cancel deferred delivery */
1292 #define add_20R(a, b) add_01R(a, b)
1294 #define add_21O(a, b) add_06O(a, b) /* All features reset */
1296 #define add_21R(a, b) add_01R(a, b)
1299 add_22O(proto_tree *tree, tvbuff_t *tvb)
1300 { /* Call input w. add. CS */
1303 UcpHandleString(hf_ucp_parm_AdC);
1304 UcpHandleString(hf_ucp_parm_OAdC);
1305 UcpHandleString(hf_ucp_parm_OAC);
1306 UcpHandleData(hf_ucp_data_section);
1307 UcpHandleInt(hf_ucp_parm_CS);
1310 #define add_22R(a, b) add_01R(a, b)
1313 add_23O(proto_tree *tree, tvbuff_t *tvb)
1314 { /* UCP version status */
1317 UcpHandleString(hf_ucp_parm_IVR5x);
1318 UcpHandleByte(hf_ucp_parm_REQ_OT);
1322 add_23R(proto_tree *tree, tvbuff_t *tvb)
1328 intval = UcpHandleByte(hf_ucp_parm_ACK);
1329 if (intval == 'A') {
1330 UcpHandleByte(hf_ucp_parm_IVR5x);
1331 intval = UcpHandleInt(hf_ucp_parm_NPL);
1332 for (idx = 0; idx < intval; idx++)
1333 UcpHandleInt(hf_ucp_hdr_OT);
1335 UcpHandleInt(hf_ucp_parm_EC);
1336 UcpHandleString(hf_ucp_parm_SM);
1340 add_24O(proto_tree *tree, tvbuff_t *tvb)
1341 { /* Mobile subs. feature stat*/
1344 UcpHandleString(hf_ucp_parm_AdC);
1345 UcpHandleString(hf_ucp_parm_AC);
1346 UcpHandleByte(hf_ucp_parm_SSTAT);
1350 add_24R(proto_tree *tree, tvbuff_t *tvb)
1356 intval = UcpHandleByte(hf_ucp_parm_ACK);
1357 if (intval == 'A') {
1358 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1359 proto_tree_add_text(tree, tvb, offset - 1, 1,
1360 "GA roaming definitions");
1361 if (intval == 'N') {
1362 proto_tree_add_text(tree, tvb, offset -1, 1,
1363 "Not subscribed/not allowed");
1367 intval = UcpHandleInt(hf_ucp_parm_NPL);
1368 for (idx = 0; idx < intval; idx++)
1369 UcpHandleData(hf_ucp_data_section);
1372 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1373 proto_tree_add_text(tree, tvb, offset - 1, 1,
1374 "Call barring definitions");
1375 if (intval == 'N') {
1376 proto_tree_add_text(tree, tvb, offset -1, 1,
1377 "Not subscribed/not allowed");
1381 intval = UcpHandleInt(hf_ucp_parm_NPL);
1382 for (idx = 0; idx < intval; idx++)
1383 UcpHandleData(hf_ucp_data_section);
1386 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1387 proto_tree_add_text(tree, tvb, offset - 1, 1,
1388 "Deferred delivery definitions");
1389 if (intval == 'N') {
1390 proto_tree_add_text(tree, tvb, offset -1, 1,
1391 "Not subscribed/not allowed");
1395 intval = UcpHandleInt(hf_ucp_parm_NPL);
1396 for (idx = 0; idx < intval; idx++)
1397 UcpHandleData(hf_ucp_data_section);
1400 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1401 proto_tree_add_text(tree, tvb, offset - 1, 1,
1402 "Diversion definitions");
1403 if (intval == 'N') {
1404 proto_tree_add_text(tree, tvb, offset -1, 1,
1405 "Not subscribed/not allowed");
1409 intval = UcpHandleInt(hf_ucp_parm_NPL);
1410 for (idx = 0; idx < intval; idx++)
1411 UcpHandleData(hf_ucp_data_section);
1414 UcpHandleInt(hf_ucp_parm_LMN);
1415 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1416 if (intval == 'N') {
1417 proto_tree_add_string(tree, hf_ucp_parm_NMESS_str, tvb,
1418 offset -1, 1, "Not subscribed/not allowed");
1422 intval = UcpHandleInt(hf_ucp_parm_NMESS);
1426 UcpHandleInt(hf_ucp_parm_EC);
1427 UcpHandleString(hf_ucp_parm_SM);
1431 add_30O(proto_tree *tree, tvbuff_t *tvb)
1432 { /* SMS message transfer */
1435 UcpHandleString(hf_ucp_parm_AdC);
1436 UcpHandleString(hf_ucp_parm_OAdC);
1437 UcpHandleString(hf_ucp_parm_AC);
1438 UcpHandleByte(hf_ucp_parm_NRq);
1439 UcpHandleString(hf_ucp_parm_NAdC);
1440 UcpHandleInt(hf_ucp_parm_NPID);
1441 UcpHandleByte(hf_ucp_parm_DD);
1442 UcpHandleTime(hf_ucp_parm_DDT);
1443 UcpHandleTime(hf_ucp_parm_VP);
1444 UcpHandleData(hf_ucp_data_section);
1448 add_30R(proto_tree *tree, tvbuff_t *tvb)
1453 intval = UcpHandleByte(hf_ucp_parm_ACK);
1455 UcpHandleTime(hf_ucp_parm_MVP);
1457 UcpHandleInt(hf_ucp_parm_EC);
1458 UcpHandleString(hf_ucp_parm_SM);
1462 add_31O(proto_tree *tree, tvbuff_t *tvb)
1466 UcpHandleString(hf_ucp_parm_AdC);
1467 UcpHandleInt(hf_ucp_parm_PID);
1470 #define add_31R(a, b) add_01R(a, b)
1473 add_5xO(proto_tree *tree, tvbuff_t *tvb)
1474 { /* 50-series operations */
1481 UcpHandleString(hf_ucp_parm_AdC);
1482 UcpHandleString(hf_ucp_parm_OAdC);
1483 UcpHandleString(hf_ucp_parm_AC);
1484 UcpHandleByte(hf_ucp_parm_NRq);
1485 UcpHandleString(hf_ucp_parm_NAdC);
1486 UcpHandleByte(hf_ucp_parm_NT);
1487 UcpHandleInt(hf_ucp_parm_NPID);
1488 UcpHandleByte(hf_ucp_parm_LRq);
1489 UcpHandleString(hf_ucp_parm_LRAd);
1490 UcpHandleInt(hf_ucp_parm_LPID);
1491 UcpHandleByte(hf_ucp_parm_DD);
1492 UcpHandleTime(hf_ucp_parm_DDT);
1493 UcpHandleTime(hf_ucp_parm_VP);
1494 UcpHandleString(hf_ucp_parm_RPID);
1495 UcpHandleTime(hf_ucp_parm_SCTS);
1496 UcpHandleByte(hf_ucp_parm_Dst);
1497 UcpHandleInt(hf_ucp_parm_Rsn);
1498 UcpHandleTime(hf_ucp_parm_DSCTS);
1499 intval = UcpHandleByte(hf_ucp_parm_MT);
1500 UcpHandleString(hf_ucp_parm_NB);
1502 UcpHandleData(hf_ucp_data_section);
1504 UcpHandleIRAString(hf_ucp_parm_AMsg);
1505 UcpHandleByte(hf_ucp_parm_MMS);
1506 UcpHandleByte(hf_ucp_parm_PR);
1507 UcpHandleByte(hf_ucp_parm_DCs);
1508 UcpHandleByte(hf_ucp_parm_MCLs);
1509 UcpHandleByte(hf_ucp_parm_RPI);
1510 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1511 proto_tree_add_string(tree, hf_ucp_parm_CPg, tvb, offset - 1,1,
1512 "(reserved for Code Page)");
1515 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1516 proto_tree_add_string(tree, hf_ucp_parm_RPLy, tvb, offset - 1,1,
1517 "(reserved for Reply type)");
1520 UcpHandleString(hf_ucp_parm_OTOA);
1521 UcpHandleString(hf_ucp_parm_HPLMN);
1522 tmpoff = offset; /* Extra services */
1523 while (tvb_get_guint8(tvb, tmpoff++) != '/')
1525 if ((tmpoff - offset) > 1) {
1526 int len = tmpoff - offset - 1;
1528 ti = proto_tree_add_item(tree, hf_ucp_parm_XSer,tvb,offset,len,FALSE);
1529 tmptvb = tvb_new_subset(tvb, offset, len + 1, len + 1);
1530 proto_item_add_subtree(ti, ett_XSer);
1531 ucp_handle_XSer(ti, tmptvb);
1534 UcpHandleData(hf_ucp_parm_RES4);
1535 UcpHandleData(hf_ucp_parm_RES5);
1538 #define add_5xR(a, b) add_30R(a, b)
1541 add_6xO(proto_tree *tree, tvbuff_t *tvb, guint8 OT)
1542 { /* 60-series operations */
1545 UcpHandleString(hf_ucp_parm_OAdC);
1546 UcpHandleByte(hf_ucp_parm_OTON);
1547 UcpHandleByte(hf_ucp_parm_ONPI);
1549 UcpHandleByte(hf_ucp_parm_STYP0);
1551 UcpHandleByte(hf_ucp_parm_STYP1);
1553 UcpHandleIRAString(hf_ucp_parm_PWD);
1554 UcpHandleIRAString(hf_ucp_parm_NPWD);
1555 UcpHandleString(hf_ucp_parm_VERS);
1556 UcpHandleString(hf_ucp_parm_LAdC);
1557 UcpHandleByte(hf_ucp_parm_LTON);
1558 UcpHandleByte(hf_ucp_parm_LNPI);
1559 UcpHandleInt(hf_ucp_parm_OPID);
1560 UcpHandleData(hf_ucp_parm_RES1);
1561 UcpHandleData(hf_ucp_parm_RES2);
1564 #define add_6xR(a, b) add_01R(a, b)
1567 * End of convenient shorthands
1569 #undef UcpHandleString
1570 #undef UcpHandleIRAString
1571 #undef UcpHandleByte
1573 #undef UcpHandleTime
1574 #undef UcpHandleData
1576 /* Code to actually dissect the packets */
1578 * Overlapping data for these functions
1580 static int result, endpkt;
1583 * The heuristic dissector
1586 dissect_ucp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1588 guint8 O_R; /* Request or response */
1590 /* This runs atop TCP, so we are guaranteed that there is at least one
1591 byte in the tvbuff. */
1592 if (tvb_get_guint8(tvb, 0) != UCP_STX)
1595 result = check_ucp(tvb, &endpkt);
1597 if (result == UCP_MALFORMED)
1599 if (endpkt < UCP_OT_OFFSET + 1)
1601 * Might be shortened packet but don't handle anyway.
1606 * Try getting the operation-type and whether it's a request/response
1608 O_R = tvb_get_guint8(tvb, UCP_O_R_OFFSET);
1609 if (match_strval(O_R, vals_hdr_O_R) == NULL)
1612 * Ok, looks like a valid packet, go dissect.
1614 dissect_ucp(tvb, pinfo, tree);
1619 * The actual dissector
1622 dissect_ucp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1624 int offset = 0; /* Offset in packet within tvbuff */
1625 int tmpoff; /* Local offset value (per field) */
1626 guint8 O_R; /* Request or response */
1627 guint8 OT; /* Operation type */
1631 /* Set up structures needed to add the protocol subtree and manage it */
1634 proto_tree *ucp_tree;
1635 proto_tree *sub_tree;
1638 O_R = tvb_get_guint8(tvb, UCP_O_R_OFFSET);
1640 * So do an atoi() on the operation type
1642 OT = tvb_get_guint8(tvb, UCP_OT_OFFSET) - '0';
1643 OT = 10 * OT + (tvb_get_guint8(tvb, UCP_OT_OFFSET + 1) - '0');
1645 /* Make entries in Protocol column and Info column on summary display */
1646 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1647 col_set_str(pinfo->cinfo, COL_PROTOCOL, "UCP");
1649 if (check_col(pinfo->cinfo, COL_INFO)) {
1650 col_clear(pinfo->cinfo, COL_INFO);
1651 col_append_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
1652 val_to_str(OT, vals_hdr_OT, "unknown operation"),
1653 match_strval(O_R, vals_hdr_O_R));
1654 if (result == UCP_SHORTENED)
1655 col_append_str(pinfo->cinfo, COL_INFO, " [short packet]");
1656 else if (result == UCP_INV_CHK)
1657 col_append_str(pinfo->cinfo, COL_INFO, " [checksum invalid]");
1660 /* In the interest of speed, if "tree" is NULL, don't do any work not
1661 necessary to generate protocol tree items. */
1664 /* create display subtree for the protocol */
1665 ti = proto_tree_add_item(tree, proto_ucp, tvb, 0, -1, FALSE);
1667 ucp_tree = proto_item_add_subtree(ti, ett_ucp);
1669 * Process the packet here.
1670 * Transaction number
1672 offset++; /* Skip <stx> */
1674 intval = tvb_get_guint8(tvb, tmpoff++) - '0';
1675 intval = 10 * intval + (tvb_get_guint8(tvb, tmpoff++) - '0');
1676 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_TRN, tvb, offset,
1677 UCP_TRN_LEN, intval);
1680 offset++; /* Skip '/' */
1683 for (i = 0; i < UCP_LEN_LEN; i++) { /* Length */
1684 intval = 10 * intval +
1685 (tvb_get_guint8(tvb, tmpoff++) - '0');
1687 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_LEN, tvb, offset,
1688 UCP_LEN_LEN, intval);
1691 offset++; /* Operation/Response */
1692 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_O_R, tvb, offset++,
1695 offset++; /* Operation type */
1696 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_OT, tvb, offset,
1698 offset += UCP_OT_LEN;
1700 * Variable part starts here. Don't dissect if not complete.
1702 if (result == UCP_SHORTENED)
1704 tmp_tvb = tvb_new_subset(tvb, offset, -1, -1);
1705 sub_ti = proto_tree_add_item(ucp_tree, hf_ucp_oper_section, tvb,
1706 offset, endpkt - offset, FALSE);
1707 sub_tree = proto_item_add_subtree(sub_ti, ett_sub);
1711 O_R == 'O' ? add_00O(sub_tree,tmp_tvb) : add_00R(sub_tree,tmp_tvb);
1714 O_R == 'O' ? add_01O(sub_tree,tmp_tvb) : add_01R(sub_tree,tmp_tvb);
1717 O_R == 'O' ? add_02O(sub_tree,tmp_tvb) : add_02R(sub_tree,tmp_tvb);
1720 O_R == 'O' ? add_03O(sub_tree,tmp_tvb) : add_03R(sub_tree,tmp_tvb);
1723 O_R == 'O' ? add_04O(sub_tree,tmp_tvb) : add_04R(sub_tree,tmp_tvb);
1726 O_R == 'O' ? add_05O(sub_tree,tmp_tvb) : add_05R(sub_tree,tmp_tvb);
1729 O_R == 'O' ? add_06O(sub_tree,tmp_tvb) : add_06R(sub_tree,tmp_tvb);
1732 O_R == 'O' ? add_07O(sub_tree,tmp_tvb) : add_07R(sub_tree,tmp_tvb);
1735 O_R == 'O' ? add_08O(sub_tree,tmp_tvb) : add_08R(sub_tree,tmp_tvb);
1738 O_R == 'O' ? add_09O(sub_tree,tmp_tvb) : add_09R(sub_tree,tmp_tvb);
1741 O_R == 'O' ? add_10O(sub_tree,tmp_tvb) : add_10R(sub_tree,tmp_tvb);
1744 O_R == 'O' ? add_11O(sub_tree,tmp_tvb) : add_11R(sub_tree,tmp_tvb);
1747 O_R == 'O' ? add_12O(sub_tree,tmp_tvb) : add_12R(sub_tree,tmp_tvb);
1750 O_R == 'O' ? add_13O(sub_tree,tmp_tvb) : add_13R(sub_tree,tmp_tvb);
1753 O_R == 'O' ? add_14O(sub_tree,tmp_tvb) : add_14R(sub_tree,tmp_tvb);
1756 O_R == 'O' ? add_15O(sub_tree,tmp_tvb) : add_15R(sub_tree,tmp_tvb);
1759 O_R == 'O' ? add_16O(sub_tree,tmp_tvb) : add_16R(sub_tree,tmp_tvb);
1762 O_R == 'O' ? add_17O(sub_tree,tmp_tvb) : add_17R(sub_tree,tmp_tvb);
1765 O_R == 'O' ? add_18O(sub_tree,tmp_tvb) : add_18R(sub_tree,tmp_tvb);
1768 O_R == 'O' ? add_19O(sub_tree,tmp_tvb) : add_19R(sub_tree,tmp_tvb);
1771 O_R == 'O' ? add_20O(sub_tree,tmp_tvb) : add_20R(sub_tree,tmp_tvb);
1774 O_R == 'O' ? add_21O(sub_tree,tmp_tvb) : add_21R(sub_tree,tmp_tvb);
1777 O_R == 'O' ? add_22O(sub_tree,tmp_tvb) : add_22R(sub_tree,tmp_tvb);
1780 O_R == 'O' ? add_23O(sub_tree,tmp_tvb) : add_23R(sub_tree,tmp_tvb);
1783 O_R == 'O' ? add_24O(sub_tree,tmp_tvb) : add_24R(sub_tree,tmp_tvb);
1786 O_R == 'O' ? add_30O(sub_tree,tmp_tvb) : add_30R(sub_tree,tmp_tvb);
1789 O_R == 'O' ? add_31O(sub_tree,tmp_tvb) : add_31R(sub_tree,tmp_tvb);
1791 case 51: case 52: case 53: case 54: case 55: case 56: case 57:
1793 O_R == 'O' ? add_5xO(sub_tree,tmp_tvb) : add_5xR(sub_tree,tmp_tvb);
1796 O_R == 'O' ? add_6xO(sub_tree,tmp_tvb,OT) : add_6xR(sub_tree,tmp_tvb);
1805 /* Register the protocol with Ethereal */
1807 proto_register_ucp(void)
1810 /* Setup list of fields */
1811 static hf_register_info hf[] = {
1813 { "Transaction Reference Number", "ucp.hdr.TRN",
1814 FT_UINT8, BASE_DEC, NULL, 0x00,
1815 "Transaction number for this command, used in windowing.",
1820 { "Length", "ucp.hdr.LEN",
1821 FT_UINT16, BASE_DEC, NULL, 0x00,
1822 "Total number of characters between <stx>...<etx>.",
1827 { "Type", "ucp.hdr.O_R",
1828 FT_UINT8, BASE_DEC, VALS(vals_hdr_O_R), 0x00,
1829 "Your basic 'is a request or response'.",
1834 { "Operation", "ucp.hdr.OT",
1835 FT_UINT8, BASE_DEC, VALS(vals_hdr_OT), 0x00,
1836 "The operation that is requested with this message.",
1840 { &hf_ucp_oper_section,
1841 { "Data", "ucp.parm",
1842 FT_NONE, BASE_DEC, NULL, 0x00,
1843 "The actual content of the operation.",
1848 { "AdC", "ucp.parm.AdC",
1849 FT_STRING, BASE_NONE, NULL, 0x00,
1850 "Address code recipient.",
1854 { &hf_ucp_parm_OAdC,
1855 { "OAdC", "ucp.parm.OAdC",
1856 FT_STRING, BASE_NONE, NULL, 0x00,
1857 "Address code originator.",
1861 { &hf_ucp_parm_DAdC,
1862 { "DAdC", "ucp.parm.DAdC",
1863 FT_STRING, BASE_NONE, NULL, 0x00,
1864 "Diverted address code.",
1869 { "AC", "ucp.parm.AC",
1870 FT_STRING, BASE_NONE, NULL, 0x00,
1871 "Authentication code.",
1876 { "OAC", "ucp.parm.OAC",
1877 FT_STRING, BASE_NONE, NULL, 0x00,
1878 "Authentication code, originator.",
1883 { "NAC", "ucp.parm.NAC",
1884 FT_STRING, BASE_NONE, NULL, 0x00,
1885 "New authentication code.",
1890 { "BAS", "ucp.parm.BAS",
1891 FT_UINT8, BASE_DEC, VALS(vals_parm_BAS), 0x00,
1892 "Barring status flag.",
1897 { "LAR", "ucp.parm.LAR",
1898 FT_UINT8, BASE_DEC, VALS(vals_parm_LAR), 0x00,
1899 "Leg. code for all calls flag.",
1904 { "LAC", "ucp.parm.LAC",
1905 FT_STRING, BASE_NONE, NULL, 0x00,
1906 "New leg. code for all calls.",
1911 { "L1R", "ucp.parm.L1R",
1912 FT_UINT8, BASE_DEC, VALS(vals_parm_L1R), 0x00,
1913 "Leg. code for priority 1 flag.",
1918 { "L1P", "ucp.parm.L1P",
1919 FT_STRING, BASE_NONE, NULL, 0x00,
1920 "New leg. code for level 1 priority.",
1925 { "L3R", "ucp.parm.L3R",
1926 FT_UINT8, BASE_DEC, VALS(vals_parm_L3R), 0x00,
1927 "Leg. code for priority 3 flag.",
1932 { "L3P", "ucp.parm.L3P",
1933 FT_STRING, BASE_NONE, NULL, 0x00,
1934 "New leg. code for level 3 priority.",
1939 { "LCR", "ucp.parm.LCR",
1940 FT_UINT8, BASE_DEC, VALS(vals_parm_LCR), 0x00,
1941 "Leg. code for reverse charging flag.",
1946 { "LUR", "ucp.parm.LUR",
1947 FT_UINT8, BASE_DEC, VALS(vals_parm_LUR), 0x00,
1948 "Leg. code for urgent message flag.",
1953 { "LRR", "ucp.parm.LRR",
1954 FT_UINT8, BASE_DEC, VALS(vals_parm_LRR), 0x00,
1955 "Leg. code for repitition flag.",
1960 { "RT", "ucp.parm.RT",
1961 FT_UINT8, BASE_DEC, VALS(vals_parm_RT), 0x00,
1967 { "NoN", "ucp.parm.NoN",
1968 FT_UINT16, BASE_DEC, NULL, 0x00,
1969 "Maximum number of numerical characters accepted.",
1974 { "NoA", "ucp.parm.NoA",
1975 FT_UINT16, BASE_DEC, NULL, 0x00,
1976 "Maximum number of alphanumerical characters accepted.",
1981 { "NoB", "ucp.parm.NoB",
1982 FT_UINT16, BASE_DEC, NULL, 0x00,
1983 "Maximum number of data bits accepted.",
1988 { "PNC", "ucp.parm.PNC",
1989 FT_UINT8, BASE_DEC, VALS(vals_parm_PNC), 0x00,
1990 "Paging network controller.",
1994 { &hf_ucp_parm_AMsg,
1995 { "AMsg", "ucp.parm.AMsg",
1996 FT_STRING, BASE_NONE, NULL, 0x00,
1997 "The alphanumeric message that is being sent.",
2002 { "LNo", "ucp.parm.LNo",
2003 FT_STRING, BASE_NONE, NULL, 0x00,
2004 "Standard text list number requested by calling party.",
2009 { "LST", "ucp.parm.LST",
2010 FT_STRING, BASE_NONE, NULL, 0x00,
2011 "Legitimisation code for standard text.",
2016 { "TNo", "ucp.parm.TNo",
2017 FT_STRING, BASE_NONE, NULL, 0x00,
2018 "Standard text number requested by calling party.",
2023 { "CS", "ucp.parm.CS",
2024 FT_UINT8, BASE_DEC, NULL, 0x00,
2025 "Additional character set number.",
2030 { "PID", "ucp.parm.PID",
2031 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
2037 { "NPL", "ucp.parm.NPL",
2038 FT_UINT16, BASE_DEC, NULL, 0x00,
2039 "Number of parameters in the following list.",
2044 { "GA", "ucp.parm.GA",
2045 FT_STRING, BASE_NONE, NULL, 0x00,
2046 "GA?? haven't got a clue.",
2051 { "RP", "ucp.parm.RP",
2052 FT_UINT8, BASE_DEC, VALS(vals_parm_RP), 0x00,
2053 "Repitition requested.",
2058 { "LRP", "ucp.parm.LRP",
2059 FT_STRING, BASE_DEC, NULL, 0x00,
2060 "Legitimisation code for repitition.",
2065 { "PR", "ucp.parm.PR",
2066 FT_UINT8, BASE_DEC, NULL, 0x00,
2067 "Priority requested.",
2072 { "LPR", "ucp.parm.LPR",
2073 FT_STRING, BASE_DEC, NULL, 0x00,
2074 "Legitimisation code for priority requested.",
2079 { "UM", "ucp.parm.UM",
2080 FT_UINT8, BASE_DEC, VALS(vals_parm_UM), 0x00,
2081 "Urgent message indicator.",
2086 { "LUM", "ucp.parm.LUM",
2087 FT_STRING, BASE_DEC, NULL, 0x00,
2088 "Legitimisation code for urgent message.",
2093 { "RC", "ucp.parm.RC",
2094 FT_UINT8, BASE_DEC, VALS(vals_parm_RC), 0x00,
2095 "Reverse charging request.",
2100 { "LRC", "ucp.parm.LRC",
2101 FT_STRING, BASE_DEC, NULL, 0x00,
2102 "Legitimisation code for reverse charging.",
2107 { "NRq", "ucp.parm.NRq",
2108 FT_UINT8, BASE_DEC, VALS(vals_parm_NRq), 0x00,
2109 "Notification request.",
2113 { &hf_ucp_parm_GAdC,
2114 { "GAdC", "ucp.parm.GAdC",
2115 FT_STRING, BASE_NONE, NULL, 0x00,
2116 "Group address code.",
2121 { "A_D", "ucp.parm.A_D",
2122 FT_UINT8, BASE_DEC, VALS(vals_parm_A_D), 0x00,
2123 "Add to/delete from fixed subscriber address list record.",
2128 { "CT", "ucp.parm.CT",
2129 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2130 "Accumulated charges timestamp.",
2135 { "AAC", "ucp.parm.AAC",
2136 FT_STRING, BASE_NONE, NULL, 0x00,
2137 "Accumulated charges.",
2142 { "MNo", "ucp.parm.MNo",
2143 FT_STRING, BASE_NONE, NULL, 0x00,
2149 { "R_T", "ucp.parm.R_T",
2150 FT_UINT8, BASE_DEC, VALS(vals_parm_R_T), 0x00,
2155 { &hf_ucp_parm_NAdC,
2156 { "NAdC", "ucp.parm.NAdC",
2157 FT_STRING, BASE_NONE, NULL, 0x00,
2158 "Notification address.",
2163 { "NT", "ucp.parm.NT",
2164 FT_UINT8, BASE_DEC, VALS(vals_parm_NT), 0x00,
2165 "Notification type.",
2169 { &hf_ucp_parm_IVR5x,
2170 { "IVR5x", "ucp.parm.IVR5x",
2171 FT_STRING, BASE_NONE, NULL, 0x00,
2172 "UCP release number supported/accepted.",
2176 { &hf_ucp_parm_REQ_OT,
2177 { "REQ_OT", "ucp.parm.REQ_OT",
2178 FT_UINT8, BASE_DEC, VALS(vals_parm_REQ_OT), 0x00,
2179 "UCP release number supported/accepted.",
2183 { &hf_ucp_parm_SSTAT,
2184 { "SSTAT", "ucp.parm.SSTAT",
2185 FT_UINT8, BASE_DEC, VALS(vals_parm_SSTAT), 0x00,
2186 "Supplementary services for which status is requested.",
2191 { "LMN", "ucp.parm.LMN",
2192 FT_UINT8, BASE_DEC, NULL, 0x00,
2193 "Last message number.",
2197 { &hf_ucp_parm_NMESS,
2198 { "NMESS", "ucp.parm.NMESS",
2199 FT_UINT8, BASE_DEC, NULL, 0x00,
2200 "Number of stored messages.",
2204 { &hf_ucp_parm_NMESS_str,
2205 { "NMESS_str", "ucp.parm.NMESS_str",
2206 FT_STRING, BASE_NONE, NULL, 0x00,
2207 "Number of stored messages.",
2211 { &hf_ucp_parm_NPID,
2212 { "NPID", "ucp.parm.NPID",
2213 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
2214 "Notification PID value.",
2219 { "LRq", "ucp.parm.LRq",
2220 FT_UINT8, BASE_DEC, VALS(vals_parm_LRq), 0x00,
2221 "Last resort address request.",
2225 { &hf_ucp_parm_LRAd,
2226 { "LRAd", "ucp.parm.LRAd",
2227 FT_STRING, BASE_NONE, NULL, 0x00,
2228 "Last resort address.",
2232 { &hf_ucp_parm_LPID,
2233 { "LPID", "ucp.parm.LPID",
2234 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
2235 "Last resort PID value.",
2240 { "DD", "ucp.parm.DD",
2241 FT_UINT8, BASE_DEC, VALS(vals_parm_DD), 0x00,
2242 "Deferred delivery requested.",
2247 { "DDT", "ucp.parm.DDT",
2248 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2249 "Deferred delivery time.",
2254 { "STx", "ucp.parm.STx",
2255 FT_NONE, BASE_NONE, NULL, 0x00,
2261 { "ST", "ucp.parm.ST",
2262 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2268 { "SP", "ucp.parm.SP",
2269 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2275 { "VP", "ucp.parm.VP",
2276 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2281 { &hf_ucp_parm_RPID,
2282 { "RPID", "ucp.parm.RPID",
2283 FT_STRING, BASE_NONE, NULL, 0x00,
2288 { &hf_ucp_parm_SCTS,
2289 { "SCTS", "ucp.parm.SCTS",
2290 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2291 "Service Centre timestamp.",
2296 { "Dst", "ucp.parm.Dst",
2297 FT_UINT8, BASE_DEC, VALS(vals_parm_Dst), 0x00,
2303 { "Rsn", "ucp.parm.Rsn",
2304 FT_UINT16, BASE_DEC, VALS(vals_parm_Rsn), 0x00,
2309 { &hf_ucp_parm_DSCTS,
2310 { "DSCTS", "ucp.parm.DSCTS",
2311 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2312 "Delivery timestamp.",
2317 { "MT", "ucp.parm.MT",
2318 FT_UINT8, BASE_DEC, VALS(vals_parm_MT), 0x00,
2324 { " NB", "ucp.parm.NB",
2325 FT_STRING, BASE_NONE, NULL, 0x00,
2326 "No. of bits in Transparent Data (TD) message.",
2330 { &hf_ucp_data_section,
2331 { " Data", "ucp.message",
2332 FT_NONE, BASE_NONE, NULL, 0x00,
2333 "The actual message or data.",
2338 { "MMS", "ucp.parm.MMS",
2339 FT_UINT8, BASE_DEC, NULL, 0x00,
2340 "More messages to send.",
2345 { "DCs", "ucp.parm.DCs",
2346 FT_UINT8, BASE_DEC, VALS(vals_parm_DCs), 0x00,
2347 "Data coding scheme (deprecated).",
2351 { &hf_ucp_parm_MCLs,
2352 { "MCLs", "ucp.parm.MCLs",
2353 FT_UINT8, BASE_DEC, VALS(vals_parm_MCLs), 0x00,
2359 { "RPI", "ucp.parm.RPI",
2360 FT_UINT8, BASE_DEC, VALS(vals_parm_RPI), 0x00,
2366 { "CPg", "ucp.parm.CPg",
2367 FT_STRING, BASE_NONE, NULL, 0x00,
2368 "Reserved for Code Page.",
2372 { &hf_ucp_parm_RPLy,
2373 { "RPLy", "ucp.parm.RPLy",
2374 FT_STRING, BASE_NONE, NULL, 0x00,
2375 "Reserved for Reply type.",
2379 { &hf_ucp_parm_OTOA,
2380 { "OTOA", "ucp.parm.OTOA",
2381 FT_STRING, BASE_NONE, NULL, 0x00,
2382 "Originator Type Of Address.",
2386 { &hf_ucp_parm_HPLMN,
2387 { "HPLMN", "ucp.parm.HPLMN",
2388 FT_STRING, BASE_NONE, NULL, 0x00,
2389 "Home PLMN address.",
2393 { &hf_ucp_parm_XSer,
2394 { "Extra services:", "ucp.parm.XSer",
2395 FT_NONE, BASE_DEC, NULL, 0x00,
2400 { &hf_ucp_parm_RES4,
2401 { "RES4", "ucp.parm.RES4",
2402 FT_STRING, BASE_NONE, NULL, 0x00,
2403 "Reserved for future use.",
2407 { &hf_ucp_parm_RES5,
2408 { "RES5", "ucp.parm.RES5",
2409 FT_STRING, BASE_NONE, NULL, 0x00,
2410 "Reserved for future use.",
2414 { &hf_ucp_parm_OTON,
2415 { "OTON", "ucp.parm.OTON",
2416 FT_UINT8, BASE_DEC, VALS(vals_parm_OTON), 0x00,
2417 "Originator type of number.",
2421 { &hf_ucp_parm_ONPI,
2422 { "ONPI", "ucp.parm.ONPI",
2423 FT_UINT8, BASE_DEC, VALS(vals_parm_ONPI), 0x00,
2424 "Originator numbering plan id.",
2428 { &hf_ucp_parm_STYP0,
2429 { "STYP0", "ucp.parm.STYP0",
2430 FT_UINT8, BASE_DEC, VALS(vals_parm_STYP0), 0x00,
2431 "Subtype of operation.",
2435 { &hf_ucp_parm_STYP1,
2436 { "STYP1", "ucp.parm.STYP1",
2437 FT_UINT8, BASE_DEC, VALS(vals_parm_STYP1), 0x00,
2438 "Subtype of operation.",
2443 { "PWD", "ucp.parm.PWD",
2444 FT_STRING, BASE_NONE, NULL, 0x00,
2445 "Current password.",
2449 { &hf_ucp_parm_NPWD,
2450 { "NPWD", "ucp.parm.NPWD",
2451 FT_STRING, BASE_NONE, NULL, 0x00,
2456 { &hf_ucp_parm_VERS,
2457 { "VERS", "ucp.parm.VERS",
2458 FT_STRING, BASE_NONE, NULL, 0x00,
2463 { &hf_ucp_parm_LAdC,
2464 { "LAdC", "ucp.parm.LAdC",
2465 FT_STRING, BASE_NONE, NULL, 0x00,
2466 "Address for VSMSC list operation.",
2470 { &hf_ucp_parm_LTON,
2471 { "LTON", "ucp.parm.LTON",
2472 FT_UINT8, BASE_DEC, NULL, 0x00,
2473 "Type of number list address.",
2477 { &hf_ucp_parm_LNPI,
2478 { "LNPI", "ucp.parm.LNPI",
2479 FT_UINT8, BASE_DEC, NULL, 0x00,
2480 "Numbering plan id. list address.",
2484 { &hf_ucp_parm_OPID,
2485 { "OPID", "ucp.parm.OPID",
2486 FT_UINT8, BASE_DEC, VALS(vals_parm_OPID), 0x00,
2487 "Originator protocol identifier.",
2491 { &hf_ucp_parm_RES1,
2492 { "RES1", "ucp.parm.RES1",
2493 FT_STRING, BASE_NONE, NULL, 0x00,
2494 "Reserved for future use.",
2498 { &hf_ucp_parm_RES2,
2499 { "RES2", "ucp.parm.RES2",
2500 FT_STRING, BASE_NONE, NULL, 0x00,
2501 "Reserved for future use.",
2506 { "(N)Ack", "ucp.parm.ACK",
2507 FT_UINT8, BASE_DEC, VALS(vals_parm_ACK), 0x00,
2508 "Positive or negative acknowledge of the operation.",
2513 { "MVP", "ucp.parm.MVP",
2514 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2515 "Mofified validity period.",
2520 { "Error code", "ucp.parm.EC",
2521 FT_UINT8, BASE_DEC, VALS(vals_parm_EC), 0x00,
2522 "The result of the requested operation.",
2527 { "SM", "ucp.parm.SM",
2528 FT_STRING, BASE_NONE, NULL, 0x00,
2534 { "Type of service", "ucp.xser.service",
2535 FT_UINT8, BASE_HEX, VALS(vals_xser_service), 0x00,
2536 "The type of service specified.",
2541 /* Setup protocol subtree array */
2542 static gint *ett[] = {
2547 /* Register the protocol name and description */
2548 proto_ucp = proto_register_protocol("Universal Computer Protocol",
2551 /* Required function calls to register header fields and subtrees used */
2552 proto_register_field_array(proto_ucp, hf, array_length(hf));
2553 proto_register_subtree_array(ett, array_length(ett));
2557 * If dissector uses sub-dissector registration add a registration routine.
2558 * This format is required because a script is used to find these routines and
2559 * create the code that calls these routines.
2562 proto_reg_handoff_ucp(void)
2564 dissector_handle_t ucp_handle;
2567 * UCP can be spoken on any port so, when not on a specific port, try this
2568 * one whenever TCP is spoken.
2570 heur_dissector_add("tcp", dissect_ucp_heur, proto_ucp);
2573 * Also register as one that can be selected by a TCP port number.
2575 ucp_handle = create_dissector_handle(dissect_ucp, proto_ucp);
2576 dissector_add_handle("tcp.port", ucp_handle);