* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#ifndef lint
-static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.49 2007-10-22 19:37:51 guy Exp $ (LBL)";
-#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <tcpdump-stdinc.h>
#include <stdio.h>
-#include <pcap.h>
#include <string.h>
#include "interface.h"
#include "ether.h"
+static const char tstr[] = "[|atm]";
+
#define OAM_CRC10_MASK 0x3ff
#define OAM_PAYLOAD_LEN 48
#define OAM_FUNCTION_SPECIFIC_LEN 45 /* this excludes crc10 and cell-type/function-type */
{
u_short extracted_ethertype;
- if (!llc_print(p, length, caplen, NULL, NULL,
+ if (!llc_print(gndo, p, length, caplen, NULL, NULL,
&extracted_ethertype)) {
/* ether_type not known, print raw packet */
if (extracted_ethertype) {
u_int hdrlen = 0;
if (caplen < 8) {
- printf("[|atm]");
+ printf("%s", tstr);
return (caplen);
}
bpf_u_int32 call_ref;
if (caplen < PROTO_POS) {
- printf("[|atm]");
+ printf("%s", tstr);
return;
}
if (p[PROTO_POS] == Q2931) {
/*
- * protocol:Q.2931 for User to Network Interface
+ * protocol:Q.2931 for User to Network Interface
* (UNI 3.1) signalling
*/
printf("Q.2931");
if (caplen < MSG_TYPE_POS) {
- printf(" [|atm]");
+ printf(" %s", tstr);
return;
}
printf(":%s ",
break;
case ATM_LANE:
- lane_print(p, length, caplen);
+ lane_print(gndo, p, length, caplen);
break;
}
}
u_int8_t unused[28];
};
-int
+int
oam_print (const u_char *p, u_int length, u_int hec) {
u_int32_t cell_header;
cksum = EXTRACT_16BITS(p + OAM_CELLTYPE_FUNCTYPE_LEN + OAM_FUNCTION_SPECIFIC_LEN)
& OAM_CRC10_MASK;
cksum_shouldbe = verify_crc10_cksum(0, p, OAM_PAYLOAD_LEN);
-
+
printf("\n\tcksum 0x%03x (%scorrect)",
cksum,
cksum_shouldbe == 0 ? "" : "in");