summaryrefslogtreecommitdiff
path: root/print-atm.c
diff options
context:
space:
mode:
authorhannes <hannes>2006-02-08 16:50:16 +0000
committerhannes <hannes>2006-02-08 16:50:16 +0000
commit27f414ac8e345dfb05643029788111be3cd3aaa9 (patch)
tree29e2c4286ea4deaa8254a029bf0b453ed21e0ca0 /print-atm.c
parent03f755dab7de5af69a805de33c53c3c3727a675c (diff)
downloadtcpdump-27f414ac8e345dfb05643029788111be3cd3aaa9.tar.gz
print ATM cell payload type, do a denser hexdumping for printing location data
Diffstat (limited to 'print-atm.c')
-rw-r--r--print-atm.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/print-atm.c b/print-atm.c
index 05fca9de..4cbb475f 100644
--- a/print-atm.c
+++ b/print-atm.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.46 2006-02-08 16:18:56 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.47 2006-02-08 16:50:16 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -54,6 +54,17 @@ struct tok oam_f_values[] = {
{ 0, NULL }
};
+struct tok atm_pty_values[] = {
+ { 0x0, "user data, uncongested, SDU 0" },
+ { 0x1, "user data, uncongested, SDU 1" },
+ { 0x2, "user data, congested, SDU 0" },
+ { 0x3, "user data, congested, SDU 1" },
+ { 0x4, "VCC OAM F5 flow segment" },
+ { 0x5, "VCC OAM F5 flow end-to-end" },
+ { 0x6, "Traffic Control and resource Mgmt" },
+ { 0, NULL }
+};
+
#define OAM_CELLTYPE_FM 0x1
#define OAM_CELLTYPE_PM 0x2
#define OAM_CELLTYPE_AD 0x8
@@ -396,9 +407,11 @@ oam_print (const u_char *p, u_int length, u_int hec) {
payload = (cell_header>>1)&0x7;
clp = cell_header&0x1;
- printf("%s, vpi %u, vci %u, payload %u, clp %u, length %u",
+ printf("%s, vpi %u, vci %u, payload [ %s ], clp %u, length %u",
tok2str(oam_f_values, "OAM F5", vci),
- vpi, vci, payload, clp, length);
+ vpi, vci,
+ tok2str(atm_pty_values, "Unknown", payload),
+ clp, length);
if (!vflag) {
return 1;
@@ -427,11 +440,15 @@ oam_print (const u_char *p, u_int length, u_int hec) {
EXTRACT_LE_32BITS(&oam_ptr.oam_fm_loopback->correlation_tag));
printf("\n\tLocation-ID ");
for (idx = 0; idx < sizeof(oam_ptr.oam_fm_loopback->loopback_id); idx++) {
- printf("0x%02x ", oam_ptr.oam_fm_loopback->loopback_id[idx]);
+ if (idx % 2) {
+ printf("%04x ", EXTRACT_16BITS(&oam_ptr.oam_fm_loopback->loopback_id[idx]));
+ }
}
printf("\n\tSource-ID ");
for (idx = 0; idx < sizeof(oam_ptr.oam_fm_loopback->source_id); idx++) {
- printf("0x%02x ", oam_ptr.oam_fm_loopback->source_id[idx]);
+ if (idx % 2) {
+ printf("%04x ", EXTRACT_16BITS(&oam_ptr.oam_fm_loopback->source_id[idx]));
+ }
}
break;
@@ -441,7 +458,9 @@ oam_print (const u_char *p, u_int length, u_int hec) {
printf("\n\tFailure-type 0x%02x", oam_ptr.oam_fm_ais_rdi->failure_type);
printf("\n\tLocation-ID ");
for (idx = 0; idx < sizeof(oam_ptr.oam_fm_ais_rdi->failure_location); idx++) {
- printf("0x%02x ", oam_ptr.oam_fm_ais_rdi->failure_location[idx]);
+ if (idx % 2) {
+ printf("%04x ", EXTRACT_16BITS(&oam_ptr.oam_fm_ais_rdi->failure_location[idx]));
+ }
}
break;