2 * Routines for Universal Computer Protocol dissection
3 * Copyright 2001, Tom Uijldert <tom.uijldert@cmg.nl>
5 * $Id: packet-ucp.c,v 1.8 2001/12/10 00:25: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)
43 #ifdef HAVE_SYS_TYPES_H
44 # include <sys/types.h>
47 #ifdef HAVE_NETINET_IN_H
48 # include <netinet/in.h>
53 #ifdef NEED_SNPRINTF_H
54 # include "snprintf.h"
58 /* #include "packet-ucp.h" */ /* We autoregister */
61 static void dissect_ucp(tvbuff_t *, packet_info *, proto_tree *);
64 * Convert ASCII-hex character to binary equivalent. No checks, assume
65 * is valid hex character.
67 #define AHex2Bin(n) (((n) & 0x40) ? ((n) & 0x0F) + 9 : ((n) & 0x0F))
69 #define UCP_STX 0x02 /* Start of UCP PDU */
70 #define UCP_ETX 0x03 /* End of UCP PDU */
72 #define UCP_MALFORMED -1 /* Not a valid PDU */
73 #define UCP_SHORTENED -2 /* May be valid but short */
74 #define UCP_INV_CHK -3 /* Checksum doesn't add up */
76 #define UCP_O_R_OFFSET 10 /* Location of O/R field*/
77 #define UCP_OT_OFFSET 12 /* Location of OT field */
79 #define UCP_TRN_LEN 2 /* Length of TRN-field */
80 #define UCP_LEN_LEN 5 /* Length of LEN-field */
81 #define UCP_O_R_LEN 1 /* Length of O/R-field */
82 #define UCP_OT_LEN 2 /* Length of OT-field */
85 * Initialize the protocol and registered fields
87 * Header (fixed) section
89 static int proto_ucp = -1;
91 static int hf_ucp_hdr_TRN = -1;
92 static int hf_ucp_hdr_LEN = -1;
93 static int hf_ucp_hdr_O_R = -1;
94 static int hf_ucp_hdr_OT = -1;
97 * Data (variable) section
99 static int hf_ucp_oper_section = -1;
100 static int hf_ucp_parm_AdC = -1;
101 static int hf_ucp_parm_OAdC = -1;
102 static int hf_ucp_parm_DAdC = -1;
103 static int hf_ucp_parm_AC = -1;
104 static int hf_ucp_parm_OAC = -1;
105 static int hf_ucp_parm_BAS = -1;
106 static int hf_ucp_parm_LAR = -1;
107 static int hf_ucp_parm_LAC = -1;
108 static int hf_ucp_parm_L1R = -1;
109 static int hf_ucp_parm_L1P = -1;
110 static int hf_ucp_parm_L3R = -1;
111 static int hf_ucp_parm_L3P = -1;
112 static int hf_ucp_parm_LCR = -1;
113 static int hf_ucp_parm_LUR = -1;
114 static int hf_ucp_parm_LRR = -1;
115 static int hf_ucp_parm_RT = -1;
116 static int hf_ucp_parm_NoN = -1;
117 static int hf_ucp_parm_NoA = -1;
118 static int hf_ucp_parm_NoB = -1;
119 static int hf_ucp_parm_NAC = -1;
120 static int hf_ucp_parm_PNC = -1;
121 static int hf_ucp_parm_LNo = -1;
122 static int hf_ucp_parm_LST = -1;
123 static int hf_ucp_parm_TNo = -1;
124 static int hf_ucp_parm_CS = -1;
125 static int hf_ucp_parm_PID = -1;
126 static int hf_ucp_parm_NPL = -1;
127 static int hf_ucp_parm_GA = -1;
128 static int hf_ucp_parm_RP = -1;
129 static int hf_ucp_parm_LRP = -1;
130 static int hf_ucp_parm_PR = -1;
131 static int hf_ucp_parm_LPR = -1;
132 static int hf_ucp_parm_UM = -1;
133 static int hf_ucp_parm_LUM = -1;
134 static int hf_ucp_parm_RC = -1;
135 static int hf_ucp_parm_LRC = -1;
136 static int hf_ucp_parm_NRq = -1;
137 static int hf_ucp_parm_GAdC = -1;
138 static int hf_ucp_parm_A_D = -1;
139 static int hf_ucp_parm_CT = -1;
140 static int hf_ucp_parm_AAC = -1;
141 static int hf_ucp_parm_MNo = -1;
142 static int hf_ucp_parm_R_T = -1;
143 static int hf_ucp_parm_IVR5x = -1;
144 static int hf_ucp_parm_REQ_OT = -1;
145 static int hf_ucp_parm_SSTAT = -1;
146 static int hf_ucp_parm_LMN = -1;
147 static int hf_ucp_parm_NMESS = -1;
148 static int hf_ucp_parm_NMESS_str= -1;
149 static int hf_ucp_parm_NAdC = -1;
150 static int hf_ucp_parm_NT = -1;
151 static int hf_ucp_parm_NPID = -1;
152 static int hf_ucp_parm_LRq = -1;
153 static int hf_ucp_parm_LRAd = -1;
154 static int hf_ucp_parm_LPID = -1;
155 static int hf_ucp_parm_DD = -1;
156 static int hf_ucp_parm_DDT = -1;
157 static int hf_ucp_parm_STx = -1;
158 static int hf_ucp_parm_ST = -1;
159 static int hf_ucp_parm_SP = -1;
160 static int hf_ucp_parm_VP = -1;
161 static int hf_ucp_parm_RPID = -1;
162 static int hf_ucp_parm_SCTS = -1;
163 static int hf_ucp_parm_Dst = -1;
164 static int hf_ucp_parm_Rsn = -1;
165 static int hf_ucp_parm_DSCTS = -1;
166 static int hf_ucp_parm_MT = -1;
167 static int hf_ucp_parm_NB = -1;
168 static int hf_ucp_data_section = -1;
169 static int hf_ucp_parm_MMS = -1;
170 static int hf_ucp_parm_DCs = -1;
171 static int hf_ucp_parm_MCLs = -1;
172 static int hf_ucp_parm_RPI = -1;
173 static int hf_ucp_parm_CPg = -1;
174 static int hf_ucp_parm_RPLy = -1;
175 static int hf_ucp_parm_OTOA = -1;
176 static int hf_ucp_parm_HPLMN = -1;
177 static int hf_ucp_parm_RES4 = -1;
178 static int hf_ucp_parm_RES5 = -1;
179 static int hf_ucp_parm_OTON = -1;
180 static int hf_ucp_parm_ONPI = -1;
181 static int hf_ucp_parm_STYP0 = -1;
182 static int hf_ucp_parm_STYP1 = -1;
183 static int hf_ucp_parm_ACK = -1;
184 static int hf_ucp_parm_PWD = -1;
185 static int hf_ucp_parm_NPWD = -1;
186 static int hf_ucp_parm_VERS = -1;
187 static int hf_ucp_parm_LAdC = -1;
188 static int hf_ucp_parm_LTON = -1;
189 static int hf_ucp_parm_LNPI = -1;
190 static int hf_ucp_parm_OPID = -1;
191 static int hf_ucp_parm_RES1 = -1;
192 static int hf_ucp_parm_RES2 = -1;
193 static int hf_ucp_parm_MVP = -1;
194 static int hf_ucp_parm_EC = -1;
195 static int hf_ucp_parm_SM = -1;
197 static int hf_ucp_parm_XSer = -1;
198 static int hf_xser_service = -1;
200 /* Initialize the subtree pointers */
201 static gint ett_ucp = -1;
202 static gint ett_XSer = -1;
205 * Value-arrays for certain field-contents
207 static const value_string vals_hdr_O_R[] = {
208 { 'O', "Operation" },
213 static const value_string vals_hdr_OT[] = { /* Operation type */
216 { 2, "Call input (multiple address)" },
217 { 3, "Call input (supplementary services included)" },
218 { 4, "Address list information" },
219 { 5, "Change address list" },
220 { 6, "Advice of accumulated charges" },
221 { 7, "Password management" },
222 { 8, "Legitimisation code management" },
223 { 9, "Standard text information" },
224 { 10, "Change standard text" },
225 { 11, "Request roaming information" },
226 { 12, "Change roaming information" },
227 { 13, "Roaming reset" },
228 { 14, "Message retrieval" },
229 { 15, "Request call barring" },
230 { 16, "Cancel call barring" },
231 { 17, "Request call diversion" },
232 { 18, "Cancel call diversion" },
233 { 19, "Request deferred delivery" },
234 { 20, "Cancel deferred delivery" },
235 { 21, "All features reset" },
236 { 22, "Call input (with specific character set)" },
237 { 23, "UCP version status request" },
238 { 24, "Mobile subscriber feature status request" },
239 { 30, "SMS message transfer" },
241 { 32, "(proprietary)" },
242 { 34, "(proprietary)" },
243 { 36, "(proprietary)" },
244 { 38, "(proprietary)" },
245 { 40, "(proprietary)" },
246 { 41, "(proprietary)" },
247 { 42, "(proprietary)" },
248 { 43, "(proprietary)" },
249 { 44, "(proprietary)" },
250 { 45, "(proprietary)" },
251 { 51, "Submit short message" },
252 { 52, "Deliver short message" },
253 { 53, "Deliver notification" },
254 { 54, "Modify message" },
255 { 55, "Inquiry message" },
256 { 56, "Delete message" },
257 { 57, "Inquiry response message" },
258 { 58, "Delete response message" },
259 { 60, "Session management" },
260 { 61, "List management" },
261 { 95, "(proprietary)" },
262 { 96, "(proprietary)" },
263 { 97, "(proprietary)" },
264 { 98, "(proprietary)" },
265 { 99, "(proprietary)" },
269 static const value_string vals_parm_EC[] = { /* Error code */
270 { 1, "Checksum error" },
271 { 2, "Syntax error" },
272 { 3, "Operation not supported by system" },
273 { 4, "Operation not allowed" },
274 { 5, "Call barring active" },
275 { 6, "AdC invalid" },
276 { 7, "Authentication failure" },
277 { 8, "Legitimisation code for all calls, failure" },
278 { 9, "GA not valid" },
279 { 10, "Repetition not allowed" },
280 { 11, "Legitimisation code for repetition, failure" },
281 { 12, "Priority call not allowed" },
282 { 13, "Legitimisation code for priority call, failure" },
283 { 14, "Urgent message not allowed" },
284 { 15, "Legitimisation code for urgent message, failure" },
285 { 16, "Reverse charging not alllowed" },
286 { 17, "Legitimisation code for rev. charging, failure" },
287 { 18, "Deferred delivery not allowed" },
288 { 19, "New AC not valid" },
289 { 20, "New legitimisation code not valid" },
290 { 21, "Standard text not valid" },
291 { 22, "Time period not valid" },
292 { 23, "Message type not supported by system" },
293 { 24, "Message too long" },
294 { 25, "Requested standard text not valid" },
295 { 26, "Message type not valid for the pager type" },
296 { 27, "Message not found in SMSC" },
297 { 28, "Invalid character set" },
298 { 30, "Subscriber hang-up" },
299 { 31, "Fax group not supported" },
300 { 32, "Fax message type not supported" },
301 { 33, "Address already in list (60-series)" },
302 { 34, "Address not in list (60-series)" },
303 { 35, "List full, cannot add address to list (60-series)" },
304 { 36, "RPID already in use" },
305 { 37, "Delivery in progress" },
306 { 38, "Message forwarded" },
307 { 50, "Low network status" },
308 { 51, "Legitimisation code for standard text, failure" },
309 { 53, "Operation partially successfull" },
310 { 54, "Operation not successfull" },
311 { 55, "System error" },
312 { 57, "AdC already a member of GAdC address list" },
313 { 58, "AdC not a member of GAdC address list" },
314 { 59, "Requested standard text list invalid" },
315 { 61, "Not controller of GAdC address list" },
316 { 62, "Standard text too large" },
317 { 63, "Not owner of standard text list" },
318 { 64, "Address list full" },
319 { 65, "GAdC invalid" },
320 { 66, "Operation restricted to mobile subscribers" },
321 { 68, "Invalid AdC type" },
322 { 69, "Cannot add AdC to GAdC address list" },
323 { 90, "(proprietary error code)" },
324 { 91, "(proprietary error code)" },
325 { 92, "(proprietary error code)" },
326 { 93, "(proprietary error code)" },
327 { 94, "(proprietary error code)" },
328 { 95, "(proprietary error code)" },
329 { 96, "(proprietary error code)" },
330 { 97, "(proprietary error code)" },
331 { 98, "(proprietary error code)" },
332 { 99, "(proprietary error code)" },
336 static const value_string vals_parm_NRq[] = {
337 { '0', "NAdC not used" },
338 { '1', "NAdC used" },
342 static const value_string vals_parm_NT[] = {
343 { '0', "Default value" },
344 { '1', "Delivery notification" },
345 { '2', "Non-delivery notification" },
346 { '3', "Delivery and Non-delivery notification" },
347 { '4', "Buffered message notification" },
348 { '5', "Buffered and Delivery notification" },
349 { '6', "Buffered and Non-delivery notification" },
350 { '7', "All notifications" },
354 static const value_string vals_parm_PID[] = {
355 { 100, "Mobile station" },
356 { 122, "Fax Group 3" },
358 { 138, "Menu over PSTN" },
359 { 139, "PC appl. over PSTN (E.164)" },
360 { 339, "PC appl. over X.25 (X.121)" },
361 { 439, "PC appl. over ISDN (E.164)" },
362 { 539, "PC appl. over TCP/IP" },
366 static const value_string vals_parm_LRq[] = {
367 { '0', "LRAd not used" },
368 { '1', "LRAd used" },
372 static const value_string vals_parm_DD[] = {
373 { '0', "DDT not used" },
378 static const value_string vals_parm_Dst[] = {
379 { '0', "delivered" },
380 { '1', "buffered (see Rsn)" },
381 { '2', "not delivered (see Rsn)" },
385 static const value_string vals_parm_Rsn[] = {
386 { 0, "Unknown subscriber" },
387 { 1, "Service temporary not available" },
388 { 2, "Service temporary not available" },
389 { 3, "Service temporary not available" },
390 { 4, "Service temporary not available" },
391 { 5, "Service temporary not available" },
392 { 6, "Service temporary not available" },
393 { 7, "Service temporary not available" },
394 { 8, "Service temporary not available" },
395 { 9, "Illegal error code" },
396 { 10, "Network time-out" },
397 { 100, "Facility not supported" },
398 { 101, "Unknown subscriber" },
399 { 102, "Facility not provided" },
400 { 103, "Call barred" },
401 { 104, "Operation barred" },
402 { 105, "SC congestion" },
403 { 106, "Facility not supported" },
404 { 107, "Absent subscriber" },
405 { 108, "Delivery fail" },
406 { 109, "Sc congestion" },
407 { 110, "Protocol error" },
408 { 111, "MS not equiped" },
409 { 112, "Unknown SC" },
410 { 113, "SC congestion" },
411 { 114, "Illegal MS" },
412 { 115, "MS nota subscriber" },
413 { 116, "Error in MS" },
414 { 117, "SMS lower layer not provisioned" },
415 { 118, "System fail" },
416 { 119, "PLMN system failure" },
417 { 120, "HLR system failure" },
418 { 121, "VLR system failure" },
419 { 122, "Previous VLR system failure" },
420 { 123, "Controlling MSC system failure" },
421 { 124, "VMSC system failure" },
422 { 125, "EIR system failure" },
423 { 126, "System failure" },
424 { 127, "Unexpected data value" },
425 { 200, "Error in address service centre" },
426 { 201, "Invalid absolute validity period" },
427 { 202, "Short message exceeds maximum" },
428 { 203, "Unable to unpack GSM message" },
429 { 204, "Unable to convert to IRA alphabet" },
430 { 205, "Invalid validity period format" },
431 { 206, "Invalid destination address" },
432 { 207, "Duplicate message submit" },
433 { 208, "Invalid message type indicator" },
437 static const value_string vals_parm_MT[] = {
438 { '2', "Numeric message" },
439 { '3', "Alphanumeric message" },
440 { '4', "Transparent data" },
444 static const value_string vals_parm_DCs[] = {
445 { '0', "default alphabet" },
446 { '1', "User defined data (8 bit)" },
450 static const value_string vals_parm_MCLs[] = {
451 { '0', "message class 0" },
452 { '1', "message class 1" },
453 { '2', "message class 2" },
454 { '3', "message class 3" },
458 static const value_string vals_parm_RPI[] = {
464 static const value_string vals_parm_ACK[] = {
470 static const value_string vals_parm_RP[] = {
471 { '1', "Repetition requested" },
475 static const value_string vals_parm_UM[] = {
476 { '1', "Urgent message" },
480 static const value_string vals_parm_RC[] = {
481 { '1', "Reverse charging request" },
485 static const value_string vals_parm_OTON[] = {
486 { '1', "International number" },
487 { '2', "National number" },
488 { '6', "Abbreviated number (short number alias)" },
492 static const value_string vals_parm_ONPI[] = {
493 { '1', "E.164 address" },
494 { '3', "X.121 address" },
495 { '5', "Private -TCP/IP or abbreviated number- address" },
499 static const value_string vals_parm_STYP0[] = {
500 { '1', "open session" },
502 { '3', "change password" },
503 { '4', "open provisioning session" },
505 { '6', "change provisioning password" },
509 static const value_string vals_parm_STYP1[] = {
510 { '1', "add item to mo-list" },
511 { '2', "remove item from mo-list" },
512 { '3', "verify item mo-list" },
513 { '4', "add item to mt-list" },
514 { '5', "remove item from mt-list" },
515 { '6', "verify item mt-list" },
519 static const value_string vals_parm_OPID[] = {
520 { 0, "Mobile station" },
521 { 39, "PC application" },
525 static const value_string vals_parm_BAS[] = {
530 static const value_string vals_parm_LAR[] = {
531 { '1', "Leg. code for all calls requested" },
535 static const value_string vals_parm_L1R[] = {
536 { '1', "Leg. code for priority 1 requested" },
540 static const value_string vals_parm_L3R[] = {
541 { '1', "Leg. code for priority 3 requested" },
545 static const value_string vals_parm_LCR[] = {
546 { '1', "Leg. code for reverse charging requested" },
550 static const value_string vals_parm_LUR[] = {
551 { '1', "Leg. code for urgent message requested" },
555 static const value_string vals_parm_LRR[] = {
556 { '1', "Leg. code for repitition requested" },
560 static const value_string vals_parm_RT[] = {
561 { '1', "Tone only" },
563 { '3', "Alphanumeric" },
564 { '4', "Transparent data" },
568 static const value_string vals_parm_PNC[] = {
570 { 'I', "Input PNC" },
574 static const value_string vals_parm_A_D[] = {
580 static const value_string vals_parm_R_T[] = {
581 { 'R', "Retrieval Ok" },
582 { 'T', "Retransmit on radio channel" },
586 static const value_string vals_parm_REQ_OT[] = {
587 { 'S', "Send used operation types" },
588 { 'N', "Don't send used operation types" },
592 static const value_string vals_parm_SSTAT[] = {
593 { '0', "All services" },
594 { '1', "All in the moment active servics" },
595 { '2', "Call diversion" },
596 { '3', "Roaming information status" },
597 { '4', "Call barring status" },
598 { '5', "Deferred delivery status" },
599 { '6', "Number of stored messages" },
603 static const value_string vals_xser_service[] = {
604 { 1, "GSM UDH information" },
605 { 2, "GSM DCS information" },
606 { 3, "[Message Type] TDMA information exchange" },
607 { 4, "[Message Reference] TDMA information exchange" },
608 { 5, "[Privacy Indicator] TDMA information exchange" },
609 { 6, "[Urgency Indicator] TDMA information exchange" },
610 { 7, "[Acknowledgement Request] TDMA information exchange" },
611 { 8, "[Messsage Updating] TDMA information exchange" },
612 { 9, "[Call Back Number] TDMA information exchange" },
613 { 10, "[Response Code] TDMA information exchange" },
614 { 11, "[Teleservice ID] TDMA information exchange" },
615 { 12, "Billing identifier" },
616 { 13, "Single shot indicator" },
621 * Checks whether the PDU looks a bit like UCP and checks the checksum
623 * \param tvb The buffer with PDU-data
624 * \param endpkt Returns pointer, indicating the end of the PDU
626 * \return The state of this PDU
627 * \retval 0 Definitely UCP
628 * \retval UCP_SHORTENED Packet may be there, but not complete
629 * \retval UCP_MALFORMED Hmmmm, not UCP after all...
630 * \retval UCP_INV_CHK Nice packet, but checksum doesn't add up...
633 check_ucp(tvbuff_t *tvb, int *endpkt)
640 length = tvb_find_guint8(tvb, offset, -1, UCP_ETX);
642 *endpkt = tvb_reported_length_remaining(tvb, offset);
643 return UCP_SHORTENED;
645 if (length > (int) tvb_reported_length(tvb)) {
647 return UCP_MALFORMED;
649 for (; offset < (guint) (length - 2); offset++)
650 checksum += tvb_get_guint8(tvb, offset);
652 tmp = tvb_get_guint8(tvb, offset++);
653 pkt_check = AHex2Bin(tmp);
654 tmp = tvb_get_guint8(tvb, offset++);
655 pkt_check = 16 * pkt_check + AHex2Bin(tmp);
656 *endpkt = offset + 1;
657 if (checksum == (guint) pkt_check)
664 * UCP equivalent of mktime() (3). Convert date to standard 'time_t' format
666 * \param datestr The UCP-formatted date to convert
668 * \return The date in standard 'time_t' format.
671 ucp_mktime(char *datestr)
675 r_time.tm_mday = 10 * (datestr[0] - '0') + (datestr[1] - '0');
676 r_time.tm_mon = (10 * (datestr[2] - '0') + (datestr[3] - '0')) - 1;
677 r_time.tm_year = 10 * (datestr[4] - '0') + (datestr[5] - '0');
678 if (r_time.tm_year < 90)
679 r_time.tm_year += 100;
680 r_time.tm_hour = 10 * (datestr[6] - '0') + (datestr[7] - '0');
681 r_time.tm_min = 10 * (datestr[8] - '0') + (datestr[9] - '0');
683 r_time.tm_sec = 10 * (datestr[10] - '0') + (datestr[11] - '0');
684 return mktime(&r_time);
688 * Scanning routines to add standard types (byte, int, string, data)
689 * to the protocol-tree. Each field is seperated with a slash ('/').
691 * \param tree The protocol tree to add to
692 * \param tvb Buffer containing the data
693 * \param field The actual field, whose value needs displaying
694 * \param offset Location of field within the buffer, returns location
697 * \return For 'int'-types, the value of the field.
700 ucp_handle_string(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
704 int tmpoff = *offset;
707 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
710 strval[--idx] = '\0';
711 proto_tree_add_string(tree, field, tvb, *offset, idx, strval);
717 ucp_handle_byte(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
721 if ((intval = tvb_get_guint8(tvb, (*offset)++)) != '/') {
722 proto_tree_add_uint(tree, field, tvb, *offset - 1, 1, intval);
729 ucp_handle_int(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
733 int tmpoff = *offset;
736 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
739 strval[--idx] = '\0';
740 intval = atoi(strval);
741 proto_tree_add_uint(tree, field, tvb, *offset, idx, intval);
748 ucp_handle_time(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
753 int tmpoff = *offset;
756 while ((strval[idx++] = tvb_get_guint8(tvb, tmpoff++)) != '/')
759 strval[--idx] = '\0';
760 tval = ucp_mktime(strval);
763 proto_tree_add_time(tree, field, tvb, *offset, idx, &tmptime);
769 ucp_handle_data(proto_tree *tree, tvbuff_t *tvb, int field, int *offset)
771 int tmpoff = *offset;
773 while (tvb_get_guint8(tvb, tmpoff++) != '/')
775 if ((tmpoff - *offset) > 1)
776 proto_tree_add_item(tree, field, tvb, *offset,
777 tmpoff - *offset - 1, FALSE);
782 * Handle the data-field within the UCP-message, according the Message Type
784 * - 2 Numeric message
785 * - 3 Alphanumeric message
786 * - 4 Transparent (binary) data
787 * - 5 Standard text handling
788 * - 6 Alphanumeric message in specified character set
790 * \param tree The protocol tree to add to
791 * \param tvb Buffer containing the data
792 * \param field The actual field, whose value needs displaying
793 * \param offset Location of field within the buffer, returns location
797 ucp_handle_mt(proto_tree *tree, tvbuff_t *tvb, int *offset)
803 intval = ucp_handle_byte(tree, tvb, hf_ucp_parm_MT, offset);
805 case '1': /* Tone only, no data */
807 case '4': /* TMsg, no of bits */
808 ucp_handle_string(tree, tvb, hf_ucp_parm_NB, offset);
809 /* fall through here for the data piece */
812 ucp_handle_data(tree, tvb, hf_ucp_data_section, offset);
815 ucp_handle_byte(tree, tvb, hf_ucp_parm_PNC, offset);
816 ucp_handle_string(tree, tvb, hf_ucp_parm_LNo, offset);
817 ucp_handle_string(tree, tvb, hf_ucp_parm_LST, offset);
818 ucp_handle_string(tree, tvb, hf_ucp_parm_TNo, offset);
821 ucp_handle_data(tree, tvb, hf_ucp_data_section, offset);
822 ucp_handle_int(tree, tvb, hf_ucp_parm_CS, offset);
825 break; /* No data so ? */
830 * Handle the data within the 'Extended services' field. Each field having the
831 * format TTLLDD..., TT being the type of service, LL giving the length of the
832 * field, DD... containing the actual data
834 * \param tree The protocol tree to add to
835 * \param tvb Buffer containing the extended services data
838 ucp_handle_XSer(proto_tree *tree, tvbuff_t *tvb)
845 while ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
846 service = AHex2Bin(intval);
847 intval = tvb_get_guint8(tvb, offset++);
848 service = service * 16 + AHex2Bin(intval);
849 intval = tvb_get_guint8(tvb, offset++);
850 len = AHex2Bin(intval);
851 intval = tvb_get_guint8(tvb, offset++);
852 len = len * 16 + AHex2Bin(intval);
853 proto_tree_add_uint(tree, hf_xser_service, tvb, offset,
859 /* Next definitions are just a convenient shorthand to make the coding a
860 * bit more readable instead of summing up all these parameters.
862 #define UcpHandleString(field) ucp_handle_string(tree, tvb, (field), &offset)
864 #define UcpHandleByte(field) ucp_handle_byte(tree, tvb, (field), &offset)
866 #define UcpHandleInt(field) ucp_handle_int(tree, tvb, (field), &offset)
868 #define UcpHandleTime(field) ucp_handle_time(tree, tvb, (field), &offset)
870 #define UcpHandleData(field) ucp_handle_data(tree, tvb, (field), &offset)
873 * The next set of routines handle the different operation types,
874 * associated with UCP.
877 add_00O(proto_tree *tree, tvbuff_t *tvb)
881 UcpHandleString(hf_ucp_parm_AdC);
882 UcpHandleString(hf_ucp_parm_OAdC);
883 UcpHandleString(hf_ucp_parm_OAC);
887 add_00R(proto_tree *tree, tvbuff_t *tvb)
892 intval = UcpHandleByte(hf_ucp_parm_ACK);
895 UcpHandleByte(hf_ucp_parm_BAS);
896 UcpHandleByte(hf_ucp_parm_LAR);
897 UcpHandleByte(hf_ucp_parm_L1R);
898 UcpHandleByte(hf_ucp_parm_L3R);
899 UcpHandleByte(hf_ucp_parm_LCR);
900 UcpHandleByte(hf_ucp_parm_LUR);
901 UcpHandleByte(hf_ucp_parm_LRR);
902 UcpHandleByte(hf_ucp_parm_RT);
903 UcpHandleInt(hf_ucp_parm_NoN);
904 UcpHandleInt(hf_ucp_parm_NoA);
905 UcpHandleInt(hf_ucp_parm_NoB);
907 UcpHandleInt(hf_ucp_parm_EC);
908 UcpHandleString(hf_ucp_parm_SM);
913 add_01O(proto_tree *tree, tvbuff_t *tvb)
917 UcpHandleString(hf_ucp_parm_AdC);
918 UcpHandleString(hf_ucp_parm_OAdC);
919 UcpHandleString(hf_ucp_parm_OAC);
920 ucp_handle_mt(tree, tvb, &offset);
924 add_01R(proto_tree *tree, tvbuff_t *tvb)
929 intval = UcpHandleByte(hf_ucp_parm_ACK);
931 UcpHandleInt(hf_ucp_parm_EC);
932 UcpHandleString(hf_ucp_parm_SM);
936 add_02O(proto_tree *tree, tvbuff_t *tvb)
937 { /* Multiple address call input*/
942 intval = UcpHandleInt(hf_ucp_parm_NPL);
943 for (idx = 0; idx < intval; idx++)
944 UcpHandleString(hf_ucp_parm_AdC);
946 UcpHandleString(hf_ucp_parm_OAdC);
947 UcpHandleString(hf_ucp_parm_OAC);
948 ucp_handle_mt(tree, tvb, &offset);
951 #define add_02R(a, b) add_01R(a,b)
954 add_03O(proto_tree *tree, tvbuff_t *tvb)
955 { /* Call input with SS */
960 UcpHandleString(hf_ucp_parm_AdC);
961 UcpHandleString(hf_ucp_parm_OAdC);
962 UcpHandleString(hf_ucp_parm_OAC);
963 intval = UcpHandleInt(hf_ucp_parm_NPL);
964 for (idx = 0; idx < intval; idx++)
965 UcpHandleString(hf_ucp_parm_GA);
967 UcpHandleByte(hf_ucp_parm_RP);
968 UcpHandleString(hf_ucp_parm_LRP);
969 UcpHandleByte(hf_ucp_parm_PR);
970 UcpHandleString(hf_ucp_parm_LPR);
971 UcpHandleByte(hf_ucp_parm_UM);
972 UcpHandleString(hf_ucp_parm_LUM);
973 UcpHandleByte(hf_ucp_parm_RC);
974 UcpHandleString(hf_ucp_parm_LRC);
975 UcpHandleByte(hf_ucp_parm_DD);
976 UcpHandleTime(hf_ucp_parm_DDT);
977 ucp_handle_mt(tree, tvb, &offset);
980 #define add_03R(a, b) add_01R(a,b)
983 add_04O(proto_tree *tree, tvbuff_t *tvb)
984 { /* Address list information */
987 UcpHandleString(hf_ucp_parm_GAdC);
988 UcpHandleString(hf_ucp_parm_AC);
989 UcpHandleString(hf_ucp_parm_OAdC);
990 UcpHandleString(hf_ucp_parm_OAC);
994 add_04R(proto_tree *tree, tvbuff_t *tvb)
1000 intval = UcpHandleByte(hf_ucp_parm_ACK);
1001 if (intval == 'A') {
1002 intval = UcpHandleInt(hf_ucp_parm_NPL);
1003 for (idx = 0; idx < intval; idx++)
1004 UcpHandleString(hf_ucp_parm_AdC);
1005 UcpHandleString(hf_ucp_parm_GAdC);
1007 UcpHandleInt(hf_ucp_parm_EC);
1008 UcpHandleString(hf_ucp_parm_SM);
1012 add_05O(proto_tree *tree, tvbuff_t *tvb)
1013 { /* Change address list */
1018 UcpHandleString(hf_ucp_parm_GAdC);
1019 UcpHandleString(hf_ucp_parm_AC);
1020 UcpHandleString(hf_ucp_parm_OAdC);
1021 UcpHandleString(hf_ucp_parm_OAC);
1022 intval = UcpHandleInt(hf_ucp_parm_NPL);
1023 for (idx = 0; idx < intval; idx++)
1024 UcpHandleString(hf_ucp_parm_AdC);
1025 UcpHandleByte(hf_ucp_parm_A_D);
1028 #define add_05R(a, b) add_01R(a, b)
1031 add_06O(proto_tree *tree, tvbuff_t *tvb)
1032 { /* Advice of accum. charges */
1035 UcpHandleString(hf_ucp_parm_AdC);
1036 UcpHandleString(hf_ucp_parm_AC);
1040 add_06R(proto_tree *tree, tvbuff_t *tvb)
1045 intval = UcpHandleByte(hf_ucp_parm_ACK);
1046 if (intval == 'A') {
1047 UcpHandleTime(hf_ucp_parm_CT);
1048 UcpHandleString(hf_ucp_parm_AAC);
1050 UcpHandleInt(hf_ucp_parm_EC);
1051 UcpHandleString(hf_ucp_parm_SM);
1055 add_07O(proto_tree *tree, tvbuff_t *tvb)
1056 { /* Password management */
1059 UcpHandleString(hf_ucp_parm_AdC);
1060 UcpHandleString(hf_ucp_parm_AC);
1061 UcpHandleString(hf_ucp_parm_NAC);
1064 #define add_07R(a, b) add_01R(a, b)
1067 add_08O(proto_tree *tree, tvbuff_t *tvb)
1068 { /* Leg. code management */
1071 UcpHandleString(hf_ucp_parm_AdC);
1072 UcpHandleString(hf_ucp_parm_AC);
1073 UcpHandleString(hf_ucp_parm_LAC);
1074 UcpHandleString(hf_ucp_parm_L1P);
1075 UcpHandleString(hf_ucp_parm_L3P);
1076 UcpHandleString(hf_ucp_parm_LRC);
1077 UcpHandleString(hf_ucp_parm_LUM);
1078 UcpHandleString(hf_ucp_parm_LRP);
1079 UcpHandleString(hf_ucp_parm_LST);
1082 #define add_08R(a, b) add_01R(a, b)
1085 add_09O(proto_tree *tree, tvbuff_t *tvb)
1086 { /* Standard text information */
1089 UcpHandleString(hf_ucp_parm_LNo);
1090 UcpHandleString(hf_ucp_parm_LST);
1094 add_09R(proto_tree *tree, tvbuff_t *tvb)
1100 intval = UcpHandleByte(hf_ucp_parm_ACK);
1101 if (intval == 'A') {
1102 intval = UcpHandleInt(hf_ucp_parm_NPL);
1103 for (idx = 0; idx < intval; idx++)
1104 UcpHandleString(hf_ucp_parm_LST);
1106 UcpHandleInt(hf_ucp_parm_EC);
1107 UcpHandleString(hf_ucp_parm_SM);
1111 add_10O(proto_tree *tree, tvbuff_t *tvb)
1112 { /* Change standard text */
1115 UcpHandleString(hf_ucp_parm_AdC);
1116 UcpHandleString(hf_ucp_parm_AC);
1117 UcpHandleString(hf_ucp_parm_LNo);
1118 UcpHandleString(hf_ucp_parm_TNo);
1119 UcpHandleData(hf_ucp_parm_STx);
1120 UcpHandleInt(hf_ucp_parm_CS);
1123 #define add_10R(a, b) add_01R(a, b)
1125 #define add_11O(a, b) add_06O(a, b) /* Request roaming info */
1128 add_11R(proto_tree *tree, tvbuff_t *tvb)
1134 intval = UcpHandleByte(hf_ucp_parm_ACK);
1135 if (intval == 'A') {
1136 intval = UcpHandleInt(hf_ucp_parm_NPL);
1137 for (idx = 0; idx < intval; idx++)
1138 UcpHandleString(hf_ucp_parm_GA);
1140 UcpHandleInt(hf_ucp_parm_EC);
1141 UcpHandleString(hf_ucp_parm_SM);
1145 add_12O(proto_tree *tree, tvbuff_t *tvb)
1146 { /* Change roaming */
1151 UcpHandleString(hf_ucp_parm_AdC);
1152 UcpHandleString(hf_ucp_parm_AC);
1153 intval = UcpHandleInt(hf_ucp_parm_NPL);
1154 for (idx = 0; idx < intval; idx++)
1155 UcpHandleString(hf_ucp_parm_GA);
1158 #define add_12R(a, b) add_01R(a, b)
1160 #define add_13O(a, b) add_06O(a, b) /* Roaming reset */
1162 #define add_13R(a, b) add_01R(a, b)
1165 add_14O(proto_tree *tree, tvbuff_t *tvb)
1166 { /* Message retrieval */
1169 UcpHandleString(hf_ucp_parm_AdC);
1170 UcpHandleString(hf_ucp_parm_AC);
1171 UcpHandleString(hf_ucp_parm_MNo);
1172 UcpHandleByte(hf_ucp_parm_R_T);
1176 add_14R(proto_tree *tree, tvbuff_t *tvb)
1182 intval = UcpHandleByte(hf_ucp_parm_ACK);
1183 if (intval == 'A') {
1184 intval = UcpHandleInt(hf_ucp_parm_NPL);
1186 * Spec is unclear here. Is 'SM' part of the Msg:s field or not?
1187 * For now, assume it is part of it...
1189 for (idx = 0; idx < intval; idx++)
1190 UcpHandleData(hf_ucp_data_section);
1192 UcpHandleInt(hf_ucp_parm_EC);
1193 UcpHandleString(hf_ucp_parm_SM);
1198 add_15O(proto_tree *tree, tvbuff_t *tvb)
1199 { /* Request call barring */
1202 UcpHandleString(hf_ucp_parm_AdC);
1203 UcpHandleString(hf_ucp_parm_AC);
1204 UcpHandleTime(hf_ucp_parm_ST);
1205 UcpHandleTime(hf_ucp_parm_SP);
1208 #define add_15R(a, b) add_01R(a, b)
1210 #define add_16O(a, b) add_06O(a, b) /* Cancel call barring */
1212 #define add_16R(a, b) add_01R(a, b)
1215 add_17O(proto_tree *tree, tvbuff_t *tvb)
1216 { /* Request call diversion */
1219 UcpHandleString(hf_ucp_parm_AdC);
1220 UcpHandleString(hf_ucp_parm_AC);
1221 UcpHandleString(hf_ucp_parm_DAdC);
1222 UcpHandleTime(hf_ucp_parm_ST);
1223 UcpHandleTime(hf_ucp_parm_SP);
1226 #define add_17R(a, b) add_01R(a, b)
1228 #define add_18O(a, b) add_06O(a, b) /* Cancel call diversion */
1230 #define add_18R(a, b) add_01R(a, b)
1233 add_19O(proto_tree *tree, tvbuff_t *tvb)
1234 { /* Request deferred delivery*/
1237 UcpHandleString(hf_ucp_parm_AdC);
1238 UcpHandleString(hf_ucp_parm_AC);
1239 UcpHandleTime(hf_ucp_parm_ST);
1240 UcpHandleTime(hf_ucp_parm_SP);
1243 #define add_19R(a, b) add_01R(a, b)
1245 #define add_20O(a, b) add_06O(a, b) /* Cancel deferred delivery */
1247 #define add_20R(a, b) add_01R(a, b)
1249 #define add_21O(a, b) add_06O(a, b) /* All features reset */
1251 #define add_21R(a, b) add_01R(a, b)
1254 add_22O(proto_tree *tree, tvbuff_t *tvb)
1255 { /* Call input w. add. CS */
1258 UcpHandleString(hf_ucp_parm_AdC);
1259 UcpHandleString(hf_ucp_parm_OAdC);
1260 UcpHandleString(hf_ucp_parm_OAC);
1261 UcpHandleData(hf_ucp_data_section);
1262 UcpHandleInt(hf_ucp_parm_CS);
1265 #define add_22R(a, b) add_01R(a, b)
1268 add_23O(proto_tree *tree, tvbuff_t *tvb)
1269 { /* UCP version status */
1272 UcpHandleString(hf_ucp_parm_IVR5x);
1273 UcpHandleByte(hf_ucp_parm_REQ_OT);
1277 add_23R(proto_tree *tree, tvbuff_t *tvb)
1283 intval = UcpHandleByte(hf_ucp_parm_ACK);
1284 if (intval == 'A') {
1285 UcpHandleByte(hf_ucp_parm_IVR5x);
1286 intval = UcpHandleInt(hf_ucp_parm_NPL);
1287 for (idx = 0; idx < intval; idx++)
1288 UcpHandleInt(hf_ucp_hdr_OT);
1290 UcpHandleInt(hf_ucp_parm_EC);
1291 UcpHandleString(hf_ucp_parm_SM);
1295 add_24O(proto_tree *tree, tvbuff_t *tvb)
1296 { /* Mobile subs. feature stat*/
1299 UcpHandleString(hf_ucp_parm_AdC);
1300 UcpHandleString(hf_ucp_parm_AC);
1301 UcpHandleByte(hf_ucp_parm_SSTAT);
1305 add_24R(proto_tree *tree, tvbuff_t *tvb)
1311 intval = UcpHandleByte(hf_ucp_parm_ACK);
1312 if (intval == 'A') {
1313 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1314 proto_tree_add_text(tree, tvb, offset - 1, 1,
1315 "GA roaming definitions");
1316 if (intval == 'N') {
1317 proto_tree_add_text(tree, tvb, offset -1, 1,
1318 "Not subscribed/not allowed");
1322 intval = UcpHandleInt(hf_ucp_parm_NPL);
1323 for (idx = 0; idx < intval; idx++)
1324 UcpHandleData(hf_ucp_data_section);
1327 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1328 proto_tree_add_text(tree, tvb, offset - 1, 1,
1329 "Call barring definitions");
1330 if (intval == 'N') {
1331 proto_tree_add_text(tree, tvb, offset -1, 1,
1332 "Not subscribed/not allowed");
1336 intval = UcpHandleInt(hf_ucp_parm_NPL);
1337 for (idx = 0; idx < intval; idx++)
1338 UcpHandleData(hf_ucp_data_section);
1341 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1342 proto_tree_add_text(tree, tvb, offset - 1, 1,
1343 "Deferred delivery definitions");
1344 if (intval == 'N') {
1345 proto_tree_add_text(tree, tvb, offset -1, 1,
1346 "Not subscribed/not allowed");
1350 intval = UcpHandleInt(hf_ucp_parm_NPL);
1351 for (idx = 0; idx < intval; idx++)
1352 UcpHandleData(hf_ucp_data_section);
1355 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1356 proto_tree_add_text(tree, tvb, offset - 1, 1,
1357 "Diversion definitions");
1358 if (intval == 'N') {
1359 proto_tree_add_text(tree, tvb, offset -1, 1,
1360 "Not subscribed/not allowed");
1364 intval = UcpHandleInt(hf_ucp_parm_NPL);
1365 for (idx = 0; idx < intval; idx++)
1366 UcpHandleData(hf_ucp_data_section);
1369 UcpHandleInt(hf_ucp_parm_LMN);
1370 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1371 if (intval == 'N') {
1372 proto_tree_add_string(tree, hf_ucp_parm_NMESS_str, tvb,
1373 offset -1, 1, "Not subscribed/not allowed");
1377 intval = UcpHandleInt(hf_ucp_parm_NMESS);
1381 UcpHandleInt(hf_ucp_parm_EC);
1382 UcpHandleString(hf_ucp_parm_SM);
1386 add_30O(proto_tree *tree, tvbuff_t *tvb)
1387 { /* SMS message transfer */
1390 UcpHandleString(hf_ucp_parm_AdC);
1391 UcpHandleString(hf_ucp_parm_OAdC);
1392 UcpHandleString(hf_ucp_parm_AC);
1393 UcpHandleByte(hf_ucp_parm_NRq);
1394 UcpHandleString(hf_ucp_parm_NAdC);
1395 UcpHandleInt(hf_ucp_parm_NPID);
1396 UcpHandleByte(hf_ucp_parm_DD);
1397 UcpHandleTime(hf_ucp_parm_DDT);
1398 UcpHandleTime(hf_ucp_parm_VP);
1399 UcpHandleData(hf_ucp_data_section);
1403 add_30R(proto_tree *tree, tvbuff_t *tvb)
1408 intval = UcpHandleByte(hf_ucp_parm_ACK);
1410 UcpHandleTime(hf_ucp_parm_MVP);
1412 UcpHandleInt(hf_ucp_parm_EC);
1413 UcpHandleString(hf_ucp_parm_SM);
1417 add_31O(proto_tree *tree, tvbuff_t *tvb)
1421 UcpHandleString(hf_ucp_parm_AdC);
1422 UcpHandleInt(hf_ucp_parm_PID);
1425 #define add_31R(a, b) add_01R(a, b)
1428 add_5xO(proto_tree *tree, tvbuff_t *tvb)
1429 { /* 50-series operations */
1436 UcpHandleString(hf_ucp_parm_AdC);
1437 UcpHandleString(hf_ucp_parm_OAdC);
1438 UcpHandleString(hf_ucp_parm_AC);
1439 UcpHandleByte(hf_ucp_parm_NRq);
1440 UcpHandleString(hf_ucp_parm_NAdC);
1441 UcpHandleByte(hf_ucp_parm_NT);
1442 UcpHandleInt(hf_ucp_parm_NPID);
1443 UcpHandleByte(hf_ucp_parm_LRq);
1444 UcpHandleString(hf_ucp_parm_LRAd);
1445 UcpHandleInt(hf_ucp_parm_LPID);
1446 UcpHandleByte(hf_ucp_parm_DD);
1447 UcpHandleTime(hf_ucp_parm_DDT);
1448 UcpHandleTime(hf_ucp_parm_VP);
1449 UcpHandleString(hf_ucp_parm_RPID);
1450 UcpHandleTime(hf_ucp_parm_SCTS);
1451 UcpHandleByte(hf_ucp_parm_Dst);
1452 UcpHandleInt(hf_ucp_parm_Rsn);
1453 UcpHandleTime(hf_ucp_parm_DSCTS);
1454 UcpHandleByte(hf_ucp_parm_MT);
1455 UcpHandleString(hf_ucp_parm_NB);
1456 UcpHandleData(hf_ucp_data_section);
1457 UcpHandleByte(hf_ucp_parm_MMS);
1458 UcpHandleByte(hf_ucp_parm_PR);
1459 UcpHandleByte(hf_ucp_parm_DCs);
1460 UcpHandleByte(hf_ucp_parm_MCLs);
1461 UcpHandleByte(hf_ucp_parm_RPI);
1462 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1463 proto_tree_add_string(tree, hf_ucp_parm_CPg, tvb, offset - 1,1,
1464 "(reserved for Code Page)");
1467 if ((intval = tvb_get_guint8(tvb, offset++)) != '/') {
1468 proto_tree_add_string(tree, hf_ucp_parm_RPLy, tvb, offset - 1,1,
1469 "(reserved for Reply type)");
1472 UcpHandleString(hf_ucp_parm_OTOA);
1473 UcpHandleString(hf_ucp_parm_HPLMN);
1474 tmpoff = offset; /* Extra services */
1475 while (tvb_get_guint8(tvb, tmpoff++) != '/')
1477 if ((tmpoff - offset) > 1) {
1478 int len = tmpoff - offset - 1;
1480 ti = proto_tree_add_item(tree, hf_ucp_parm_XSer,tvb,offset,len,FALSE);
1481 tmptvb = tvb_new_subset(tvb, offset, len + 1, len + 1);
1482 proto_item_add_subtree(ti, ett_XSer);
1483 ucp_handle_XSer(ti, tmptvb);
1486 UcpHandleData(hf_ucp_parm_RES4);
1487 UcpHandleData(hf_ucp_parm_RES5);
1490 #define add_5xR(a, b) add_30R(a, b)
1493 add_6xO(proto_tree *tree, tvbuff_t *tvb, guint8 OT)
1494 { /* 60-series operations */
1497 UcpHandleString(hf_ucp_parm_OAdC);
1498 UcpHandleByte(hf_ucp_parm_OTON);
1499 UcpHandleByte(hf_ucp_parm_ONPI);
1501 UcpHandleByte(hf_ucp_parm_STYP0);
1503 UcpHandleByte(hf_ucp_parm_STYP1);
1505 UcpHandleData(hf_ucp_parm_PWD);
1506 UcpHandleData(hf_ucp_parm_NPWD);
1507 UcpHandleString(hf_ucp_parm_VERS);
1508 UcpHandleString(hf_ucp_parm_LAdC);
1509 UcpHandleByte(hf_ucp_parm_LTON);
1510 UcpHandleByte(hf_ucp_parm_LNPI);
1511 UcpHandleInt(hf_ucp_parm_OPID);
1512 UcpHandleData(hf_ucp_parm_RES1);
1513 UcpHandleData(hf_ucp_parm_RES2);
1516 #define add_6xR(a, b) add_01R(a, b)
1519 * End of convenient shorthands
1521 #undef UcpHandleString
1522 #undef UcpHandleByte
1524 #undef UcpHandleTime
1525 #undef UcpHandleData
1527 /* Code to actually dissect the packets */
1529 * Overlapping data for these functions
1531 static int result, endpkt;
1534 * The heuristic dissector
1537 dissect_ucp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1539 guint8 O_R; /* Request or response */
1541 if (!proto_is_protocol_enabled(proto_ucp))
1542 return FALSE; /* UCP was disabled */
1544 /* This runs atop TCP, so we are guaranteed that there is at least one
1545 byte in the tvbuff. */
1546 if (tvb_get_guint8(tvb, 0) != UCP_STX)
1549 result = check_ucp(tvb, &endpkt);
1551 if (result == UCP_MALFORMED)
1553 if (endpkt < UCP_OT_OFFSET + 1)
1555 * Might be shortened packet but don't handle anyway.
1560 * Try getting the operation-type and whether it's a request/response
1562 O_R = tvb_get_guint8(tvb, UCP_O_R_OFFSET);
1563 if (match_strval(O_R, vals_hdr_O_R) == NULL)
1566 * Ok, looks like a valid packet, go dissect.
1568 dissect_ucp(tvb, pinfo, tree);
1573 * The actual dissector
1576 dissect_ucp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1578 int offset = 0; /* Offset in packet within tvbuff */
1579 int tmpoff; /* Local offset value (per field) */
1580 guint8 O_R; /* Request or response */
1581 guint8 OT; /* Operation type */
1585 /* Set up structures needed to add the protocol subtree and manage it */
1588 proto_tree *ucp_tree;
1591 O_R = tvb_get_guint8(tvb, UCP_O_R_OFFSET);
1593 * So do an atoi() on the operation type
1595 OT = tvb_get_guint8(tvb, UCP_OT_OFFSET) - '0';
1596 OT = 10 * OT + (tvb_get_guint8(tvb, UCP_OT_OFFSET + 1) - '0');
1598 /* Make entries in Protocol column and Info column on summary display */
1599 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1600 col_set_str(pinfo->cinfo, COL_PROTOCOL, "UCP");
1602 if (check_col(pinfo->cinfo, COL_INFO)) {
1603 col_clear(pinfo->cinfo, COL_INFO);
1604 col_append_fstr(pinfo->cinfo, COL_INFO, "%s (%s)",
1605 val_to_str(OT, vals_hdr_OT, "unknown operation"),
1606 match_strval(O_R, vals_hdr_O_R));
1607 if (result == UCP_SHORTENED)
1608 col_append_str(pinfo->cinfo, COL_INFO, " [short packet]");
1609 else if (result == UCP_INV_CHK)
1610 col_append_str(pinfo->cinfo, COL_INFO, " [checksum invalid]");
1613 /* In the interest of speed, if "tree" is NULL, don't do any work not
1614 necessary to generate protocol tree items. */
1617 /* create display subtree for the protocol */
1618 ti = proto_tree_add_item(tree, proto_ucp, tvb, 0,
1619 tvb_length(tvb), FALSE);
1621 ucp_tree = proto_item_add_subtree(ti, ett_ucp);
1623 * Process the packet here.
1624 * Transaction number
1626 offset++; /* Skip <stx> */
1628 intval = tvb_get_guint8(tvb, tmpoff++) - '0';
1629 intval = 10 * intval + (tvb_get_guint8(tvb, tmpoff++) - '0');
1630 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_TRN, tvb, offset,
1631 UCP_TRN_LEN, intval);
1634 offset++; /* Skip '/' */
1637 for (i = 0; i < UCP_LEN_LEN; i++) { /* Length */
1638 intval = 10 * intval +
1639 (tvb_get_guint8(tvb, tmpoff++) - '0');
1641 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_LEN, tvb, offset,
1642 UCP_LEN_LEN, intval);
1645 offset++; /* Operation/Response */
1646 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_O_R, tvb, offset++,
1649 offset++; /* Operation type */
1650 proto_tree_add_uint(ucp_tree, hf_ucp_hdr_OT, tvb, offset,
1652 offset += UCP_OT_LEN;
1654 * Variable part starts here. Don't dissect if not complete.
1656 if (result == UCP_SHORTENED)
1658 tmp_tvb = tvb_new_subset(tvb, offset, -1, -1);
1659 sub_ti = proto_tree_add_item(ucp_tree, hf_ucp_oper_section, tvb,
1660 offset, endpkt - offset, FALSE);
1664 O_R == 'O' ? add_01O(sub_ti,tmp_tvb) : add_01R(sub_ti,tmp_tvb);
1667 O_R == 'O' ? add_02O(sub_ti,tmp_tvb) : add_02R(sub_ti,tmp_tvb);
1670 O_R == 'O' ? add_03O(sub_ti,tmp_tvb) : add_03R(sub_ti,tmp_tvb);
1673 O_R == 'O' ? add_04O(sub_ti,tmp_tvb) : add_04R(sub_ti,tmp_tvb);
1676 O_R == 'O' ? add_05O(sub_ti,tmp_tvb) : add_05R(sub_ti,tmp_tvb);
1679 O_R == 'O' ? add_06O(sub_ti,tmp_tvb) : add_06R(sub_ti,tmp_tvb);
1682 O_R == 'O' ? add_07O(sub_ti,tmp_tvb) : add_07R(sub_ti,tmp_tvb);
1685 O_R == 'O' ? add_08O(sub_ti,tmp_tvb) : add_08R(sub_ti,tmp_tvb);
1688 O_R == 'O' ? add_09O(sub_ti,tmp_tvb) : add_09R(sub_ti,tmp_tvb);
1691 O_R == 'O' ? add_10O(sub_ti,tmp_tvb) : add_10R(sub_ti,tmp_tvb);
1694 O_R == 'O' ? add_11O(sub_ti,tmp_tvb) : add_11R(sub_ti,tmp_tvb);
1697 O_R == 'O' ? add_12O(sub_ti,tmp_tvb) : add_12R(sub_ti,tmp_tvb);
1700 O_R == 'O' ? add_13O(sub_ti,tmp_tvb) : add_13R(sub_ti,tmp_tvb);
1703 O_R == 'O' ? add_14O(sub_ti,tmp_tvb) : add_14R(sub_ti,tmp_tvb);
1706 O_R == 'O' ? add_15O(sub_ti,tmp_tvb) : add_15R(sub_ti,tmp_tvb);
1709 O_R == 'O' ? add_16O(sub_ti,tmp_tvb) : add_16R(sub_ti,tmp_tvb);
1712 O_R == 'O' ? add_17O(sub_ti,tmp_tvb) : add_17R(sub_ti,tmp_tvb);
1715 O_R == 'O' ? add_18O(sub_ti,tmp_tvb) : add_18R(sub_ti,tmp_tvb);
1718 O_R == 'O' ? add_19O(sub_ti,tmp_tvb) : add_19R(sub_ti,tmp_tvb);
1721 O_R == 'O' ? add_20O(sub_ti,tmp_tvb) : add_20R(sub_ti,tmp_tvb);
1724 O_R == 'O' ? add_21O(sub_ti,tmp_tvb) : add_21R(sub_ti,tmp_tvb);
1727 O_R == 'O' ? add_22O(sub_ti,tmp_tvb) : add_22R(sub_ti,tmp_tvb);
1730 O_R == 'O' ? add_23O(sub_ti,tmp_tvb) : add_23R(sub_ti,tmp_tvb);
1733 O_R == 'O' ? add_24O(sub_ti,tmp_tvb) : add_24R(sub_ti,tmp_tvb);
1736 O_R == 'O' ? add_30O(sub_ti,tmp_tvb) : add_30R(sub_ti,tmp_tvb);
1739 O_R == 'O' ? add_31O(sub_ti,tmp_tvb) : add_31R(sub_ti,tmp_tvb);
1741 case 51: case 52: case 53: case 54: case 55: case 56: case 57:
1743 O_R == 'O' ? add_5xO(sub_ti,tmp_tvb) : add_5xR(sub_ti,tmp_tvb);
1746 O_R == 'O' ? add_6xO(sub_ti,tmp_tvb,OT) : add_6xR(sub_ti,tmp_tvb);
1755 /* Register the protocol with Ethereal */
1757 proto_register_ucp(void)
1760 /* Setup list of fields */
1761 static hf_register_info hf[] = {
1763 { "Transaction Reference Number", "ucp.hdr.TRN",
1764 FT_UINT8, BASE_DEC, NULL, 0x00,
1765 "Transaction number for this command, used in windowing.",
1770 { "Length", "ucp.hdr.LEN",
1771 FT_UINT16, BASE_DEC, NULL, 0x00,
1772 "Total number of characters between <stx>...<etx>.",
1777 { "Type", "ucp.hdr.O_R",
1778 FT_UINT8, BASE_DEC, VALS(vals_hdr_O_R), 0x00,
1779 "Your basic 'is a request or response'.",
1784 { "Operation", "ucp.hdr.OT",
1785 FT_UINT8, BASE_DEC, VALS(vals_hdr_OT), 0x00,
1786 "The operation that is requested with this message.",
1790 { &hf_ucp_oper_section,
1791 { "Data", "ucp.parm",
1792 FT_NONE, BASE_DEC, NULL, 0x00,
1793 "The actual content of the operation.",
1798 { "AdC", "ucp.parm.AdC",
1799 FT_STRING, BASE_NONE, NULL, 0x00,
1800 "Address code recipient.",
1804 { &hf_ucp_parm_OAdC,
1805 { "OAdC", "ucp.parm.OAdC",
1806 FT_STRING, BASE_NONE, NULL, 0x00,
1807 "Address code originator.",
1811 { &hf_ucp_parm_DAdC,
1812 { "DAdC", "ucp.parm.DAdC",
1813 FT_STRING, BASE_NONE, NULL, 0x00,
1814 "Diverted address code.",
1819 { "AC", "ucp.parm.AC",
1820 FT_STRING, BASE_NONE, NULL, 0x00,
1821 "Authentication code.",
1826 { "OAC", "ucp.parm.OAC",
1827 FT_STRING, BASE_NONE, NULL, 0x00,
1828 "Authentication code, originator.",
1833 { "NAC", "ucp.parm.NAC",
1834 FT_STRING, BASE_NONE, NULL, 0x00,
1835 "New authentication code.",
1840 { "BAS", "ucp.parm.BAS",
1841 FT_UINT8, BASE_DEC, VALS(vals_parm_BAS), 0x00,
1842 "Barring status flag.",
1847 { "LAR", "ucp.parm.LAR",
1848 FT_UINT8, BASE_DEC, VALS(vals_parm_LAR), 0x00,
1849 "Leg. code for all calls flag.",
1854 { "LAC", "ucp.parm.LAC",
1855 FT_STRING, BASE_NONE, NULL, 0x00,
1856 "New leg. code for all calls.",
1861 { "L1R", "ucp.parm.L1R",
1862 FT_UINT8, BASE_DEC, VALS(vals_parm_L1R), 0x00,
1863 "Leg. code for priority 1 flag.",
1868 { "L1P", "ucp.parm.L1P",
1869 FT_STRING, BASE_NONE, NULL, 0x00,
1870 "New leg. code for level 1 priority.",
1875 { "L3R", "ucp.parm.L3R",
1876 FT_UINT8, BASE_DEC, VALS(vals_parm_L3R), 0x00,
1877 "Leg. code for priority 3 flag.",
1882 { "L3P", "ucp.parm.L3P",
1883 FT_STRING, BASE_NONE, NULL, 0x00,
1884 "New leg. code for level 3 priority.",
1889 { "LCR", "ucp.parm.LCR",
1890 FT_UINT8, BASE_DEC, VALS(vals_parm_LCR), 0x00,
1891 "Leg. code for reverse charging flag.",
1896 { "LUR", "ucp.parm.LUR",
1897 FT_UINT8, BASE_DEC, VALS(vals_parm_LUR), 0x00,
1898 "Leg. code for urgent message flag.",
1903 { "LRR", "ucp.parm.LRR",
1904 FT_UINT8, BASE_DEC, VALS(vals_parm_LRR), 0x00,
1905 "Leg. code for repitition flag.",
1910 { "RT", "ucp.parm.RT",
1911 FT_UINT8, BASE_DEC, VALS(vals_parm_RT), 0x00,
1917 { "NoN", "ucp.parm.NoN",
1918 FT_UINT16, BASE_DEC, NULL, 0x00,
1919 "Maximum number of numerical characters accepted.",
1924 { "NoA", "ucp.parm.NoA",
1925 FT_UINT16, BASE_DEC, NULL, 0x00,
1926 "Maximum number of alphanumerical characters accepted.",
1931 { "NoB", "ucp.parm.NoB",
1932 FT_UINT16, BASE_DEC, NULL, 0x00,
1933 "Maximum number of data bits accepted.",
1938 { "PNC", "ucp.parm.PNC",
1939 FT_UINT8, BASE_DEC, VALS(vals_parm_PNC), 0x00,
1940 "Paging network controller.",
1945 { "LNo", "ucp.parm.LNo",
1946 FT_STRING, BASE_NONE, NULL, 0x00,
1947 "Standard text list number requested by calling party.",
1952 { "LST", "ucp.parm.LST",
1953 FT_STRING, BASE_NONE, NULL, 0x00,
1954 "Legitimisation code for standard text.",
1959 { "TNo", "ucp.parm.TNo",
1960 FT_STRING, BASE_NONE, NULL, 0x00,
1961 "Standard text number requested by calling party.",
1966 { "CS", "ucp.parm.CS",
1967 FT_UINT8, BASE_DEC, NULL, 0x00,
1968 "Additional character set number.",
1973 { "PID", "ucp.parm.PID",
1974 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
1980 { "NPL", "ucp.parm.NPL",
1981 FT_UINT16, BASE_DEC, NULL, 0x00,
1982 "Number of parameters in the following list.",
1987 { "GA", "ucp.parm.GA",
1988 FT_STRING, BASE_NONE, NULL, 0x00,
1989 "GA?? haven't got a clue.",
1994 { "RP", "ucp.parm.RP",
1995 FT_UINT8, BASE_DEC, VALS(vals_parm_RP), 0x00,
1996 "Repitition requested.",
2001 { "LRP", "ucp.parm.LRP",
2002 FT_STRING, BASE_DEC, NULL, 0x00,
2003 "Legitimisation code for repitition.",
2008 { "PR", "ucp.parm.PR",
2009 FT_UINT8, BASE_DEC, NULL, 0x00,
2010 "Priority requested.",
2015 { "LPR", "ucp.parm.LPR",
2016 FT_STRING, BASE_DEC, NULL, 0x00,
2017 "Legitimisation code for priority requested.",
2022 { "UM", "ucp.parm.UM",
2023 FT_UINT8, BASE_DEC, VALS(vals_parm_UM), 0x00,
2024 "Urgent message indicator.",
2029 { "LUM", "ucp.parm.LUM",
2030 FT_STRING, BASE_DEC, NULL, 0x00,
2031 "Legitimisation code for urgent message.",
2036 { "RC", "ucp.parm.RC",
2037 FT_UINT8, BASE_DEC, VALS(vals_parm_RC), 0x00,
2038 "Reverse charging request.",
2043 { "LRC", "ucp.parm.LRC",
2044 FT_STRING, BASE_DEC, NULL, 0x00,
2045 "Legitimisation code for reverse charging.",
2050 { "NRq", "ucp.parm.NRq",
2051 FT_UINT8, BASE_DEC, VALS(vals_parm_NRq), 0x00,
2052 "Notification request.",
2056 { &hf_ucp_parm_GAdC,
2057 { "GAdC", "ucp.parm.GAdC",
2058 FT_STRING, BASE_NONE, NULL, 0x00,
2059 "Group address code.",
2064 { "A_D", "ucp.parm.A_D",
2065 FT_UINT8, BASE_DEC, VALS(vals_parm_A_D), 0x00,
2066 "Add to/delete from fixed subscriber address list record.",
2071 { "CT", "ucp.parm.CT",
2072 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2073 "Accumulated charges timestamp.",
2078 { "AAC", "ucp.parm.AAC",
2079 FT_STRING, BASE_NONE, NULL, 0x00,
2080 "Accumulated charges.",
2085 { "MNo", "ucp.parm.MNo",
2086 FT_STRING, BASE_NONE, NULL, 0x00,
2092 { "R_T", "ucp.parm.R_T",
2093 FT_STRING, BASE_NONE, NULL, 0x00,
2098 { &hf_ucp_parm_NAdC,
2099 { "NAdC", "ucp.parm.NAdC",
2100 FT_STRING, BASE_NONE, NULL, 0x00,
2101 "Notification address.",
2106 { "NT", "ucp.parm.NT",
2107 FT_STRING, BASE_NONE, NULL, 0x00,
2108 "Notification type.",
2112 { &hf_ucp_parm_IVR5x,
2113 { "IVR5x", "ucp.parm.IVR5x",
2114 FT_STRING, BASE_NONE, NULL, 0x00,
2115 "UCP release number supported/accepted.",
2119 { &hf_ucp_parm_REQ_OT,
2120 { "REQ_OT", "ucp.parm.REQ_OT",
2121 FT_UINT8, BASE_DEC, VALS(vals_parm_REQ_OT), 0x00,
2122 "UCP release number supported/accepted.",
2126 { &hf_ucp_parm_SSTAT,
2127 { "SSTAT", "ucp.parm.SSTAT",
2128 FT_UINT8, BASE_DEC, VALS(vals_parm_SSTAT), 0x00,
2129 "Supplementary services for which status is requested.",
2134 { "LMN", "ucp.parm.LMN",
2135 FT_UINT8, BASE_DEC, NULL, 0x00,
2136 "Last message number.",
2140 { &hf_ucp_parm_NMESS,
2141 { "NMESS", "ucp.parm.NMESS",
2142 FT_UINT8, BASE_DEC, NULL, 0x00,
2143 "Number of stored messages.",
2147 { &hf_ucp_parm_NMESS_str,
2148 { "NMESS_str", "ucp.parm.NMESS_str",
2149 FT_STRING, BASE_NONE, NULL, 0x00,
2150 "Number of stored messages.",
2154 { &hf_ucp_parm_NPID,
2155 { "NPID", "ucp.parm.NPID",
2156 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
2157 "Notification PID value.",
2162 { "LRq", "ucp.parm.LRq",
2163 FT_UINT8, BASE_DEC, VALS(vals_parm_LRq), 0x00,
2164 "Last resort address request.",
2168 { &hf_ucp_parm_LRAd,
2169 { "LRAd", "ucp.parm.LRAd",
2170 FT_STRING, BASE_NONE, NULL, 0x00,
2171 "Last resort address.",
2175 { &hf_ucp_parm_LPID,
2176 { "LPID", "ucp.parm.LPID",
2177 FT_UINT16, BASE_DEC, VALS(vals_parm_PID), 0x00,
2178 "Last resort PID value.",
2183 { "DD", "ucp.parm.DD",
2184 FT_UINT8, BASE_DEC, VALS(vals_parm_DD), 0x00,
2185 "Deferred delivery requested.",
2190 { "DDT", "ucp.parm.DDT",
2191 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2192 "Deferred delivery time.",
2197 { "STx", "ucp.parm.STx",
2198 FT_NONE, BASE_NONE, NULL, 0x00,
2204 { "ST", "ucp.parm.ST",
2205 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2211 { "SP", "ucp.parm.SP",
2212 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2218 { "VP", "ucp.parm.VP",
2219 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2224 { &hf_ucp_parm_RPID,
2225 { "RPID", "ucp.parm.RPID",
2226 FT_STRING, BASE_NONE, NULL, 0x00,
2231 { &hf_ucp_parm_SCTS,
2232 { "SCTS", "ucp.parm.SCTS",
2233 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2234 "Service Centre timestamp.",
2239 { "Dst", "ucp.parm.Dst",
2240 FT_UINT8, BASE_DEC, VALS(vals_parm_Dst), 0x00,
2246 { "Rsn", "ucp.parm.Rsn",
2247 FT_UINT16, BASE_DEC, VALS(vals_parm_Rsn), 0x00,
2252 { &hf_ucp_parm_DSCTS,
2253 { "DSCTS", "ucp.parm.DSCTS",
2254 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2255 "Delivery timestamp.",
2260 { "MT", "ucp.parm.MT",
2261 FT_UINT8, BASE_DEC, VALS(vals_parm_MT), 0x00,
2267 { " NB", "ucp.parm.NB",
2268 FT_STRING, BASE_NONE, NULL, 0x00,
2269 "No. of bits in Transparent Data (TD) message.",
2273 { &hf_ucp_data_section,
2274 { " Data", "ucp.message",
2275 FT_NONE, BASE_NONE, NULL, 0x00,
2276 "The actual message or data.",
2281 { "MMS", "ucp.parm.MMS",
2282 FT_UINT8, BASE_DEC, NULL, 0x00,
2283 "More messages to send.",
2288 { "DCs", "ucp.parm.DCs",
2289 FT_UINT8, BASE_DEC, VALS(vals_parm_DCs), 0x00,
2290 "Data coding scheme (deprecated).",
2294 { &hf_ucp_parm_MCLs,
2295 { "MCLs", "ucp.parm.MCLs",
2296 FT_UINT8, BASE_DEC, VALS(vals_parm_MCLs), 0x00,
2302 { "RPI", "ucp.parm.RPI",
2303 FT_UINT8, BASE_DEC, VALS(vals_parm_RPI), 0x00,
2309 { "CPg", "ucp.parm.CPg",
2310 FT_STRING, BASE_NONE, NULL, 0x00,
2311 "Reserved for Code Page.",
2315 { &hf_ucp_parm_RPLy,
2316 { "RPLy", "ucp.parm.RPLy",
2317 FT_STRING, BASE_NONE, NULL, 0x00,
2318 "Reserved for Reply type.",
2322 { &hf_ucp_parm_OTOA,
2323 { "OTOA", "ucp.parm.OTOA",
2324 FT_STRING, BASE_NONE, NULL, 0x00,
2325 "Originator Type Of Address.",
2329 { &hf_ucp_parm_HPLMN,
2330 { "HPLMN", "ucp.parm.HPLMN",
2331 FT_STRING, BASE_NONE, NULL, 0x00,
2332 "Home PLMN address.",
2336 { &hf_ucp_parm_XSer,
2337 { "Extra services:", "ucp.parm.XSer",
2338 FT_NONE, BASE_DEC, NULL, 0x00,
2343 { &hf_ucp_parm_RES4,
2344 { "RES4", "ucp.parm.RES4",
2345 FT_STRING, BASE_NONE, NULL, 0x00,
2346 "Reserved for future use.",
2350 { &hf_ucp_parm_RES5,
2351 { "RES5", "ucp.parm.RES5",
2352 FT_STRING, BASE_NONE, NULL, 0x00,
2353 "Reserved for future use.",
2357 { &hf_ucp_parm_OTON,
2358 { "OTON", "ucp.parm.OTON",
2359 FT_UINT8, BASE_DEC, VALS(vals_parm_OTON), 0x00,
2360 "Originator type of number.",
2364 { &hf_ucp_parm_ONPI,
2365 { "ONPI", "ucp.parm.ONPI",
2366 FT_UINT8, BASE_DEC, VALS(vals_parm_ONPI), 0x00,
2367 "Originator numbering plan id.",
2371 { &hf_ucp_parm_STYP0,
2372 { "STYP0", "ucp.parm.STYP0",
2373 FT_UINT8, BASE_DEC, VALS(vals_parm_STYP0), 0x00,
2374 "Subtype of operation.",
2378 { &hf_ucp_parm_STYP1,
2379 { "STYP1", "ucp.parm.STYP1",
2380 FT_UINT8, BASE_DEC, VALS(vals_parm_STYP1), 0x00,
2381 "Subtype of operation.",
2386 { "PWD", "ucp.parm.PWD",
2387 FT_NONE, BASE_DEC, NULL, 0x00,
2388 "Current password.",
2392 { &hf_ucp_parm_NPWD,
2393 { "NPWD", "ucp.parm.NPWD",
2394 FT_NONE, BASE_DEC, NULL, 0x00,
2399 { &hf_ucp_parm_VERS,
2400 { "VERS", "ucp.parm.VERS",
2401 FT_STRING, BASE_NONE, NULL, 0x00,
2406 { &hf_ucp_parm_LAdC,
2407 { "LAdC", "ucp.parm.LAdC",
2408 FT_STRING, BASE_NONE, NULL, 0x00,
2409 "Address for VSMSC list operation.",
2413 { &hf_ucp_parm_LTON,
2414 { "LTON", "ucp.parm.LTON",
2415 FT_UINT8, BASE_DEC, NULL, 0x00,
2416 "Type of number list address.",
2420 { &hf_ucp_parm_LNPI,
2421 { "LNPI", "ucp.parm.LNPI",
2422 FT_UINT8, BASE_DEC, NULL, 0x00,
2423 "Numbering plan id. list address.",
2427 { &hf_ucp_parm_OPID,
2428 { "OPID", "ucp.parm.OPID",
2429 FT_UINT8, BASE_DEC, VALS(vals_parm_OPID), 0x00,
2430 "Originator protocol identifier.",
2434 { &hf_ucp_parm_RES1,
2435 { "RES1", "ucp.parm.RES1",
2436 FT_STRING, BASE_NONE, NULL, 0x00,
2437 "Reserved for future use.",
2441 { &hf_ucp_parm_RES2,
2442 { "RES2", "ucp.parm.RES2",
2443 FT_STRING, BASE_NONE, NULL, 0x00,
2444 "Reserved for future use.",
2449 { "(N)Ack", "ucp.parm.ACK",
2450 FT_UINT8, BASE_DEC, VALS(vals_parm_ACK), 0x00,
2451 "Positive or negative acknowledge of the operation.",
2456 { "MVP", "ucp.parm.MVP",
2457 FT_ABSOLUTE_TIME, BASE_NONE, NULL, 0x00,
2458 "Mofified validity period.",
2463 { "Error code", "ucp.parm.EC",
2464 FT_UINT8, BASE_DEC, VALS(vals_parm_EC), 0x00,
2465 "The result of the requested operation.",
2470 { "SM", "ucp.parm.SM",
2471 FT_STRING, BASE_NONE, NULL, 0x00,
2477 { "Type of service", "ucp.xser.service",
2478 FT_UINT8, BASE_HEX, VALS(vals_xser_service), 0x00,
2479 "The type of service specified.",
2484 /* Setup protocol subtree array */
2485 static gint *ett[] = {
2489 /* Register the protocol name and description */
2490 proto_ucp = proto_register_protocol("Universal Computer Protocol",
2493 /* Required function calls to register header fields and subtrees used */
2494 proto_register_field_array(proto_ucp, hf, array_length(hf));
2495 proto_register_subtree_array(ett, array_length(ett));
2499 * If dissector uses sub-dissector registration add a registration routine.
2500 * This format is required because a script is used to find these routines and
2501 * create the code that calls these routines.
2504 proto_reg_handoff_ucp(void)
2506 dissector_handle_t ucp_handle;
2509 * UCP can be spoken on any port so, when not on a specific port, try this
2510 * one whenever TCP is spoken.
2512 heur_dissector_add("tcp", dissect_ucp_heur, proto_ucp);
2515 * Also register as one that can be selected by a TCP port number.
2517 ucp_handle = create_dissector_handle(dissect_ucp, proto_ucp);
2518 dissector_add_handle("tcp.port", ucp_handle);