No empty .Rs/.Re
[netbsd-mini2440.git] / usr.sbin / isdn / isdntrace / 1tr6.c
blob2910c9eef5103ab8995643306252d30adcb682e2
1 /*
2 * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
25 *---------------------------------------------------------------------------
27 * 1tr6.c - print 1TR6 protocol traces
28 * -----------------------------------
30 * $Id: 1tr6.c,v 1.3 2003/10/06 09:43:28 itojun Exp $
32 * $FreeBSD$
34 * last edit-date: [Mon Dec 13 21:55:31 1999]
36 *---------------------------------------------------------------------------*/
38 #include "trace.h"
40 static int p_1tr6address(char *pbuf, unsigned char buf[]);
41 static int p_1tr6cause(char *pbuf, unsigned char buf[]);
43 /*---------------------------------------------------------------------------*
44 * decode the (german) national specific 1TR6 protocol
45 *---------------------------------------------------------------------------*/
46 void
47 decode_1tr6(char *pbuf, int n, int off, unsigned char *buf, int raw)
49 int codeset = 0;
50 int oldcodeset = 0;
51 int codelock = 0;
53 int pd;
54 int len;
55 int j;
56 int i;
58 if (n <= 0)
59 return;
61 *pbuf = '\0';
63 if (raw)
65 for (i = 0; i < n; i += 16)
67 sprintf((pbuf+strlen(pbuf)),"Dump:%.3d ", i+off);
68 for (j = 0; j < 16; j++)
69 if (i + j < n)
70 sprintf((pbuf+strlen(pbuf)),"%02x ", buf[i + j]);
71 else
72 sprintf((pbuf+strlen(pbuf))," ");
73 sprintf((pbuf+strlen(pbuf))," ");
74 for (j = 0; j < 16 && i + j < n; j++)
75 if (isprint(buf[i + j]))
76 sprintf((pbuf+strlen(pbuf)),"%c", buf[i + j]);
77 else
78 sprintf((pbuf+strlen(pbuf)),".");
79 sprintf((pbuf+strlen(pbuf)),"\n");
83 sprintf((pbuf+strlen(pbuf)), "1TR6: ");
85 /* protocol discriminator */
87 i = 0;
89 pd = buf[i];
91 switch (pd)
93 case 0x40:
94 sprintf((pbuf+strlen(pbuf)), "pd=N0, ");
95 break;
96 case 0x41:
97 sprintf((pbuf+strlen(pbuf)), "pd=N1, ");
98 break;
99 default:
100 sprintf((pbuf+strlen(pbuf)), "pd=UNDEF (0x%02x), ",pd);
101 break;
104 /* call reference */
106 i++;
108 len = buf[i] & 0x0f;
110 switch (len)
112 case 1:
113 sprintf((pbuf+strlen(pbuf)), "cr=0x%02x %s, ", (buf[i+1] & 0x7f), (buf[i+1] & 0x80) ? "(from destination)" : "(from origination)");
114 break;
115 default:
116 sprintf((pbuf+strlen(pbuf)), "cr: LEN=%d %s 0x%02x 0x%02x, ", len, (buf[i+1] & 0x80) ? "org" : "dst", (buf[i+1] & 0x7f), (buf[i+2] & 0x7f));
117 break;
120 i += (len+1);
122 /* message type */
124 sprintf((pbuf+strlen(pbuf)), "message=");
126 if (pd == 0x40) /* protocol discriminator N0 */
128 switch (buf[i])
130 case 0x61:
131 sprintf((pbuf+strlen(pbuf)), "REGISTER INDICATION: ");
132 break;
133 case 0x62:
134 sprintf((pbuf+strlen(pbuf)), "CANCEL INDICATION: ");
135 break;
136 case 0x63:
137 sprintf((pbuf+strlen(pbuf)), "FACILITY STATUS: ");
138 break;
139 case 0x64:
140 sprintf((pbuf+strlen(pbuf)), "STATUS ACKNOWLEDGE: ");
141 break;
142 case 0x65:
143 sprintf((pbuf+strlen(pbuf)), "STATUS REJECT: ");
144 break;
145 case 0x66:
146 sprintf((pbuf+strlen(pbuf)), "FACILITY INFORMATION: ");
147 break;
148 case 0x67:
149 sprintf((pbuf+strlen(pbuf)), "INFORMATION ACKNOWLEDGE: ");
150 break;
151 case 0x68:
152 sprintf((pbuf+strlen(pbuf)), "INFORMATION REJECT: ");
153 break;
154 case 0x75:
155 sprintf((pbuf+strlen(pbuf)), "CLOSE: ");
156 break;
157 case 0x77:
158 sprintf((pbuf+strlen(pbuf)), "CLOSE ACKNOWLEDGE: ");
159 break;
160 default:
161 sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x40 MSG=0x%02x, ", buf[i]);
162 break;
165 else if (pd == 0x41)
167 switch (buf[i])
169 case 0x00:
170 sprintf((pbuf+strlen(pbuf)), "ESCAPE: ");
171 break;
172 case 0x01:
173 sprintf((pbuf+strlen(pbuf)), "ALERT: ");
174 break;
175 case 0x02:
176 sprintf((pbuf+strlen(pbuf)), "CALL SENT: ");
177 break;
178 case 0x07:
179 sprintf((pbuf+strlen(pbuf)), "CONNECT: ");
180 break;
181 case 0x0f:
182 sprintf((pbuf+strlen(pbuf)), "CONNECT ACKNOWLEDGE: ");
183 break;
184 case 0x05:
185 sprintf((pbuf+strlen(pbuf)), "SETUP: ");
186 break;
187 case 0x0d:
188 sprintf((pbuf+strlen(pbuf)), "SETUP ACKNOWLEDGE: ");
189 break;
191 case 0x26:
192 sprintf((pbuf+strlen(pbuf)), "RESUME: ");
193 break;
194 case 0x2e:
195 sprintf((pbuf+strlen(pbuf)), "RESUME ACKNOWLEDGE: ");
196 break;
197 case 0x22:
198 sprintf((pbuf+strlen(pbuf)), "RESUME REJECT: ");
199 break;
200 case 0x25:
201 sprintf((pbuf+strlen(pbuf)), "SUSPEND: ");
202 break;
203 case 0x2d:
204 sprintf((pbuf+strlen(pbuf)), "SUSPEND ACKNOWLEDGE: ");
205 break;
206 case 0x21:
207 sprintf((pbuf+strlen(pbuf)), "SUSPEND REJECT: ");
208 break;
209 case 0x20:
210 sprintf((pbuf+strlen(pbuf)), "USER INFORMATION: ");
211 break;
213 case 0x40:
214 sprintf((pbuf+strlen(pbuf)), "DETACH");
215 break;
216 case 0x45:
217 sprintf((pbuf+strlen(pbuf)), "DISCONNECT: ");
218 break;
219 case 0x4d:
220 sprintf((pbuf+strlen(pbuf)), "RELEASE: ");
221 break;
222 case 0x5a:
223 sprintf((pbuf+strlen(pbuf)), "RELEASE ACKNOWLEDGE");
224 break;
226 case 0x6e:
227 sprintf((pbuf+strlen(pbuf)), "CANCEL ACKNOWLEDGE: ");
228 break;
229 case 0x67:
230 sprintf((pbuf+strlen(pbuf)), "CANCEL REJECT: ");
231 break;
232 case 0x69:
233 sprintf((pbuf+strlen(pbuf)), "CONGESTION CONTROL: ");
234 break;
235 case 0x60:
236 sprintf((pbuf+strlen(pbuf)), "FACILITY: ");
237 break;
238 case 0x68:
239 sprintf((pbuf+strlen(pbuf)), "FACILITY ACKNOWLEDGE: ");
240 break;
241 case 0x66:
242 sprintf((pbuf+strlen(pbuf)), "FACILITY CANCEL: ");
243 break;
244 case 0x64:
245 sprintf((pbuf+strlen(pbuf)), "FACILITY REGISTER: ");
246 break;
247 case 0x65:
248 sprintf((pbuf+strlen(pbuf)), "FACILITY REJECT: ");
249 break;
250 case 0x6d:
251 sprintf((pbuf+strlen(pbuf)), "INFORMATION: ");
252 break;
253 case 0x6c:
254 sprintf((pbuf+strlen(pbuf)), "REGISTER ACKNOWLEDGE: ");
255 break;
256 case 0x6f:
257 sprintf((pbuf+strlen(pbuf)), "REGISTER REJECT: ");
258 break;
259 case 0x63:
260 sprintf((pbuf+strlen(pbuf)), "STATUS: ");
261 break;
263 default:
264 sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x41 MSG=0x%02x, ", buf[i]);
265 break;
268 else
270 sprintf((pbuf+strlen(pbuf)), "ERROR: PD=0x%02x MSG=0x%02x, ", pd, buf[i]);
273 /* other information elements */
275 i++;
277 for (; i < n;)
279 sprintf((pbuf+strlen(pbuf)), "\n ");
281 if (buf[i] & 0x80)
283 /* single octett info element */
285 switch (buf[i] & 0x70)
287 case 0x00: /* reserved */
288 sprintf((pbuf+strlen(pbuf)), "[reserved single octett info]");
289 break;
291 case 0x10: /* shift */
292 oldcodeset = codeset;
293 codeset = buf[i] & 0x07;
294 if (buf[i] & 0x08)
295 codelock = 0;
296 else
297 codelock = 1;
298 sprintf((pbuf+strlen(pbuf)), "[shift: codeset=%d lock=%d]", codeset, codelock);
299 break;
301 case 0x20: /* more data */
302 sprintf((pbuf+strlen(pbuf)), "[more data]");
303 break;
305 case 0x30: /* congestion level */
306 sprintf((pbuf+strlen(pbuf)), "[congestion level = %d]", buf[i] & 0x0f);
307 break;
309 default:
310 sprintf((pbuf+strlen(pbuf)), "[UNDEF SINGLE OCTET ELEMENT 0x%02x]", buf[i]);
311 break;
314 i++; /* next */
317 else
319 /* variable length info element */
321 if (codeset == 0)
323 switch (buf[i])
325 case 0x08:
326 sprintf((pbuf+strlen(pbuf)), "[cause: ");
327 i += p_1tr6cause(pbuf, &buf[i]);
328 goto next;
329 break;
331 case 0x0c:
332 sprintf((pbuf+strlen(pbuf)), "[connected address: ");
333 i += p_1tr6address(pbuf, &buf[i]);
334 goto next;
335 break;
337 case 0x10:
338 sprintf((pbuf+strlen(pbuf)), "[call identity: ");
339 break;
340 case 0x18:
341 sprintf((pbuf+strlen(pbuf)), "[channel id: channel=");
342 i += 2;
343 switch (buf[i] & 0x03)
345 case 0:
346 sprintf((pbuf+strlen(pbuf)), "no channel");
347 break;
348 case 1:
349 sprintf((pbuf+strlen(pbuf)), "B-1");
350 break;
351 case 2:
352 sprintf((pbuf+strlen(pbuf)), "B-2");
353 break;
354 case 3:
355 sprintf((pbuf+strlen(pbuf)), "any channel");
356 break;
358 if (buf[i] & 0x08)
359 sprintf((pbuf+strlen(pbuf)), " (exclusive)]");
360 else
361 sprintf((pbuf+strlen(pbuf)), " (preferred)]");
362 i++;
363 goto next;
364 break;
365 case 0x20:
366 sprintf((pbuf+strlen(pbuf)), "[network specific facilities: ");
367 i++;
368 len = buf[i];
369 i+=2;
370 switch (buf[i])
372 case 1:
373 sprintf((pbuf+strlen(pbuf)), "Sperre");
374 break;
375 case 2:
376 sprintf((pbuf+strlen(pbuf)), "AWS 1");
377 break;
378 case 3:
379 sprintf((pbuf+strlen(pbuf)), "AWS 2");
380 break;
381 case 0xe:
382 sprintf((pbuf+strlen(pbuf)), "Konferenz");
383 break;
384 case 0xf:
385 sprintf((pbuf+strlen(pbuf)), "B-Kan uebern.");
386 break;
387 case 0x10:
388 sprintf((pbuf+strlen(pbuf)), "aktvrg. ghlt. Vbdg.");
389 break;
390 case 0x11:
391 sprintf((pbuf+strlen(pbuf)), "3er Konf");
392 break;
393 case 0x12:
394 sprintf((pbuf+strlen(pbuf)), "1seitg D/G Wechsel");
395 break;
396 case 0x13:
397 sprintf((pbuf+strlen(pbuf)), "2seitig D/G Wechsel");
398 break;
399 case 0x14:
400 sprintf((pbuf+strlen(pbuf)), "Rufnr. identifiz.");
401 break;
402 case 0x15:
403 sprintf((pbuf+strlen(pbuf)), "GBG");
404 break;
405 case 0x17:
406 sprintf((pbuf+strlen(pbuf)), "ueberg. Ruf");
407 break;
408 case 0x1a:
409 sprintf((pbuf+strlen(pbuf)), "um/weitergel. Ruf");
410 break;
411 case 0x1b:
412 sprintf((pbuf+strlen(pbuf)), "unterdr. A-Rufnr.");
413 break;
414 case 0x1e:
415 sprintf((pbuf+strlen(pbuf)), "Verbdg. deaktivieren");
416 break;
417 case 0x1d:
418 sprintf((pbuf+strlen(pbuf)), "Verbdg. aktivieren");
419 break;
420 case 0x1f:
421 sprintf((pbuf+strlen(pbuf)), "SPV");
422 break;
423 case 0x23:
424 sprintf((pbuf+strlen(pbuf)), "Rueckw. 2seitg. DW");
425 break;
426 case 0x24:
427 sprintf((pbuf+strlen(pbuf)), "Anrufumltg. priv. Netz");
428 break;
429 default:
430 sprintf((pbuf+strlen(pbuf)), "undefined");
431 break;
433 i++;
434 sprintf((pbuf+strlen(pbuf)), ", serv=%d", buf[i]);
435 i++;
436 sprintf((pbuf+strlen(pbuf)), ", ainfo=%d", buf[i]);
437 i++;
438 len-=4;
439 for (j = 0; j < len; j++)
441 sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
443 sprintf((pbuf+strlen(pbuf)),"]");
444 i += j;
445 goto next;
446 break;
447 case 0x28:
448 sprintf((pbuf+strlen(pbuf)), "[display: ");
449 break;
450 case 0x2c:
451 sprintf((pbuf+strlen(pbuf)), "[keypad: ");
452 break;
453 case 0x6c:
454 sprintf((pbuf+strlen(pbuf)), "[origination address: ");
455 i += p_1tr6address(pbuf, &buf[i]);
456 goto next;
457 break;
458 case 0x70:
459 sprintf((pbuf+strlen(pbuf)), "[destination address: ");
460 i += p_1tr6address(pbuf, &buf[i]);
461 goto next;
462 break;
463 case 0x7e:
464 sprintf((pbuf+strlen(pbuf)), "[user-user information: ");
465 break;
466 case 0x7f:
467 sprintf((pbuf+strlen(pbuf)), "[reserved: ");
468 break;
469 default:
470 sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID");
471 break;
474 else if (codeset == 6)
476 switch (buf[i])
478 case 0x01:
479 sprintf((pbuf+strlen(pbuf)), "[service ind: serv=");
480 i+= 2;
481 switch (buf[i])
483 case 0x01:
484 sprintf((pbuf+strlen(pbuf)), "phone");
485 break;
486 case 0x02:
487 sprintf((pbuf+strlen(pbuf)), "a/b");
488 break;
489 case 0x03:
490 sprintf((pbuf+strlen(pbuf)), "X.21");
491 break;
492 case 0x04:
493 sprintf((pbuf+strlen(pbuf)), "fax g4");
494 break;
495 case 0x05:
496 sprintf((pbuf+strlen(pbuf)), "btx");
497 break;
498 case 0x07:
499 sprintf((pbuf+strlen(pbuf)), "64k data");
500 break;
501 case 0x08:
502 sprintf((pbuf+strlen(pbuf)), "X.25");
503 break;
504 case 0x09:
505 sprintf((pbuf+strlen(pbuf)), "teletex");
506 break;
507 case 0x0a:
508 sprintf((pbuf+strlen(pbuf)), "mixed");
509 break;
510 case 0x0d:
511 sprintf((pbuf+strlen(pbuf)), "temex");
512 break;
513 case 0x0e:
514 sprintf((pbuf+strlen(pbuf)), "picturephone");
515 break;
516 case 0x0f:
517 sprintf((pbuf+strlen(pbuf)), "btx (new)");
518 break;
519 case 0x10:
520 sprintf((pbuf+strlen(pbuf)), "videophone");
521 break;
522 default:
523 sprintf((pbuf+strlen(pbuf)), "undefined");
524 break;
526 i++;
527 sprintf((pbuf+strlen(pbuf)), ", ainfo=0x%02x]", buf[i]);
528 i++;
529 goto next;
530 break;
531 case 0x02:
532 sprintf((pbuf+strlen(pbuf)), "[charging information: ");
533 break;
534 case 0x03:
535 sprintf((pbuf+strlen(pbuf)), "[date: ");
536 i++;
537 len = buf[i];
538 i++;
539 for (j = 0; j < len; j++)
541 sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
543 sprintf((pbuf+strlen(pbuf)),"]");
544 i += j;
545 goto next;
546 break;
547 case 0x05:
548 sprintf((pbuf+strlen(pbuf)), "[facility select: ");
549 break;
550 case 0x06:
551 sprintf((pbuf+strlen(pbuf)), "[status of facilities: ");
552 break;
553 case 0x07:
554 sprintf((pbuf+strlen(pbuf)), "[status of called party: ");
555 i+=2;
556 switch (buf[i])
558 case 1:
559 sprintf((pbuf+strlen(pbuf)), "no information]");
560 break;
561 case 2:
562 sprintf((pbuf+strlen(pbuf)), "is being called]");
563 break;
564 default:
565 sprintf((pbuf+strlen(pbuf)), "undefined (0x%02x)]", buf[i]);
566 break;
568 i++;
569 goto next;
570 break;
571 case 0x08:
572 sprintf((pbuf+strlen(pbuf)), "[additional tx attributes: ");
573 i++;
574 len = buf[i];
575 i++;
576 for (j = 0; j < len; j++)
578 switch (buf[j+i] &0x70)
580 case 0:
581 sprintf((pbuf+strlen(pbuf)), "no satellite link");
582 break;
583 case 1:
584 sprintf((pbuf+strlen(pbuf)), "one satellite link");
585 break;
586 case 2:
587 sprintf((pbuf+strlen(pbuf)), "two satellite links");
588 break;
589 case 3:
590 sprintf((pbuf+strlen(pbuf)), "three satellite links");
591 break;
592 default:
593 sprintf((pbuf+strlen(pbuf)), "undefined value");
594 break;
596 if (buf[j+i] & 0x80)
597 sprintf((pbuf+strlen(pbuf)),"(flag=req)]");
598 else
599 sprintf((pbuf+strlen(pbuf)),"(flag=ind)]");
601 i += j;
602 goto next;
603 break;
604 default:
605 sprintf((pbuf+strlen(pbuf)), "[UNKNOWN INFO-ELEMENT-ID");
606 break;
609 else
611 sprintf((pbuf+strlen(pbuf)), "[ILLEGAL CODESET = 0x%02x", codeset);
614 i++; /* index -> length */
616 len = buf[i];
618 i++; /* index -> 1st param */
620 for (j = 0; j < len; j++)
622 sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
625 sprintf((pbuf+strlen(pbuf)),"]");
627 i += len;
629 next:
631 if (!codelock && (codeset != oldcodeset))
632 codeset = oldcodeset;
635 sprintf((pbuf+strlen(pbuf)),"\n");
638 /*---------------------------------------------------------------------------*
639 * decode and print the cause
640 *---------------------------------------------------------------------------*/
641 static int
642 p_1tr6cause(char *pbuf, unsigned char buf[])
644 int j;
645 int len;
646 int i = 0;
648 i++; /* index -> length */
650 len = buf[i];
652 switch (len)
654 case 0:
655 sprintf((pbuf+strlen(pbuf)), "%s", print_cause_1tr6(0));
656 break;
657 case 1:
658 i++;
659 sprintf((pbuf+strlen(pbuf)), "%s", print_cause_1tr6(buf[i] & 0x7f));
660 break;
661 case 2:
662 i++;
663 sprintf((pbuf+strlen(pbuf)), "%s, location: ", print_cause_1tr6(buf[i] & 0x7f));
664 i++;
665 switch (buf[i] & 0x0f)
667 case 0x04:
668 sprintf((pbuf+strlen(pbuf)), "public network");
669 break;
670 case 0x05:
671 sprintf((pbuf+strlen(pbuf)), "private network");
672 break;
673 case 0x0f:
674 sprintf((pbuf+strlen(pbuf)), "no information");
675 break;
676 default:
677 sprintf((pbuf+strlen(pbuf)), "reserved (0x%02x)", buf[i] & 0x0f);
678 break;
680 break;
681 default:
682 i++; /* index -> length */
683 len = buf[i];
684 i++; /* index -> 1st param */
685 for (j = 0; j < len; j++)
687 sprintf((pbuf+strlen(pbuf))," 0x%02x", buf[j+i]);
689 break;
691 i++;
692 sprintf((pbuf+strlen(pbuf)),"]");
693 return(i);
696 /*---------------------------------------------------------------------------*
697 * decode and print the ISDN (telephone) number
698 *---------------------------------------------------------------------------*/
699 static int
700 p_1tr6address(char *pbuf, unsigned char buf[])
702 int j;
703 int len;
704 int i = 0;
705 int tp;
707 i++; /* index -> length */
708 len = buf[i];
709 i++; /* index -> 1st param */
710 tp = buf[i];
712 i++;
713 len--;
715 for (j = 0; j < len; j++)
717 sprintf((pbuf+strlen(pbuf)),"%c", buf[j+i]);
720 switch ((tp & 0x70) >> 4)
722 case 0:
723 sprintf((pbuf+strlen(pbuf)), " (type=unknown, ");
724 break;
725 case 1:
726 sprintf((pbuf+strlen(pbuf)), " (type=international, ");
727 break;
728 case 2:
729 sprintf((pbuf+strlen(pbuf)), " (type=national, ");
730 break;
731 default:
732 sprintf((pbuf+strlen(pbuf)), " (type=%d, ", ((tp & 0x70) >> 4));
733 break;
736 switch (tp & 0x0f)
738 case 0:
739 sprintf((pbuf+strlen(pbuf)), "plan=unknown)");
740 break;
741 case 1:
742 sprintf((pbuf+strlen(pbuf)), "plan=ISDN)");
743 break;
744 default:
745 sprintf((pbuf+strlen(pbuf)), "plan=%d)", (tp & 0x0f));
746 break;
749 sprintf((pbuf+strlen(pbuf)),"]");
751 i += j;
753 return(i);
756 /* EOF */