* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/atm.h,v 1.1 2002-07-11 09:17:22 guy Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/atm.h,v 1.2 2005-06-20 07:37:01 hannes Exp $
*/
/*
#define ATM_UNKNOWN 0 /* Unknown */
#define ATM_LANE 1 /* LANE */
#define ATM_LLC 2 /* LLC encapsulation */
+
+/*
+ * some OAM cell captures (most notably Juniper's)
+ * do not deliver a heading HEC byte
+ */
+#define ATM_OAM_NOHEC 0
+#define ATM_OAM_HEC 1
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.254 2005-05-27 14:52:35 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.255 2005-06-20 07:39:21 hannes Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
extern void atm_print(u_int, u_int, u_int, const u_char *, u_int, u_int);
extern u_int atm_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int sunatm_if_print(const struct pcap_pkthdr *, const u_char *);
-extern int oam_print(const u_char *, u_int);
+extern int oam_print(const u_char *, u_int, u_int);
extern void bootp_print(const u_char *, u_int);
extern void bgp_print(const u_char *, int);
extern void beep_print(const u_char *, u_int);
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.39 2005-05-18 20:24:04 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.40 2005-06-20 07:37:02 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
case OAMF4SC: /* fall through */
case OAMF4EC:
- oam_print(p, length);
+ oam_print(p, length, ATM_OAM_HEC);
return;
case METAC:
}
int
-oam_print (const u_char *p, u_int length) {
+oam_print (const u_char *p, u_int length, u_int hec) {
u_int16_t cell_header, cell_type, func_type,vpi,vci,payload,clp;
cell_header = EXTRACT_32BITS(p);
- cell_type = ((*(p+4))>>4) & 0x0f;
- func_type = *(p+4) & 0x0f;
+ cell_type = ((*(p+4+hec))>>4) & 0x0f;
+ func_type = *(p+4+hec) & 0x0f;
vpi = (cell_header>>20)&0xff;
vci = (cell_header>>4)&0xffff;
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.20 2005-06-09 07:56:26 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.21 2005-06-20 07:37:02 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "llc.h"
#include "nlpid.h"
#include "ethertype.h"
+#include "atm.h"
#define JUNIPER_BPF_OUT 0 /* Outgoing packet */
#define JUNIPER_BPF_IN 1 /* Incoming packet */
p+=l2info.header_len;
if (l2info.cookie[0] == 0x80) { /* OAM cell ? */
- oam_print(p,l2info.length);
+ oam_print(p,l2info.length,ATM_OAM_NOHEC);
return l2info.header_len;
}
l2info.length -= 4;
p += 4;
}
- oam_print(p,l2info.length);
+ oam_print(p,l2info.length,ATM_OAM_NOHEC);
return l2info.header_len;
}