+/* NetBSD: print-juniper.c,v 1.2 2007/07/24 11:53:45 drochner Exp */
+
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.31 2006-03-10 23:43:29 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.34 2007-08-29 02:31:44 mcr Exp $ (LBL)";
+#else
+__RCSID("NetBSD: print-juniper.c,v 1.3 2007/07/25 06:31:32 dogcow Exp ");
#endif
#ifdef HAVE_CONFIG_H
return l2info.header_len;
p+=l2info.header_len;
- gh = (struct juniper_ggsn_header *)p;
+ gh = (struct juniper_ggsn_header *)&l2info.cookie;
- if (eflag)
+ if (eflag) {
printf("proto %s (%u), vlan %u: ",
tok2str(juniper_protocol_values,"Unknown",gh->proto),
gh->proto,
EXTRACT_16BITS(&gh->vlan_id[0]));
+ }
switch (gh->proto) {
case JUNIPER_PROTO_IPV4:
break;
#ifdef INET6
case JUNIPER_PROTO_IPV6:
- ip6_print(p, l2info.length);
+ ip6_print(gndo, p, l2info.length);
break;
#endif /* INET6 */
default:
tok2str(juniper_ipsec_type_values,"Unknown",ih->type),
ih->type,
EXTRACT_32BITS(&ih->spi),
- ipaddr_string(EXTRACT_32BITS(&ih->src_ip)),
- ipaddr_string(EXTRACT_32BITS(&ih->dst_ip)),
+ ipaddr_string(&ih->src_ip),
+ ipaddr_string(&ih->dst_ip),
l2info.length);
} else {
printf("ES SA, index %u, ttl %u type %s (%u), length %u\n",
p+=l2info.header_len;
/* this DLT contains nothing but raw ethernet frames */
- ether_print(p, l2info.length, l2info.caplen);
+ ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL);
return l2info.header_len;
}
#endif
p+=l2info.header_len;
/* this DLT contains nothing but raw Ethernet frames */
- ether_print(p, l2info.length, l2info.caplen);
+ ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL);
return l2info.header_len;
}
#endif
extracted_ethertype = EXTRACT_16BITS(p);
/* this DLT contains nothing but raw PPPoE frames,
* prepended with a type field*/
- if (ether_encap_print(extracted_ethertype,
+ if (ethertype_print(gndo, extracted_ethertype,
p+ETHERTYPE_LEN,
l2info.length-ETHERTYPE_LEN,
- l2info.caplen-ETHERTYPE_LEN,
- &extracted_ethertype) == 0)
+ l2info.caplen-ETHERTYPE_LEN) == 0)
/* ether_type not known, probably it wasn't one */
printf("unknown ethertype 0x%04x", extracted_ethertype);
return l2info.header_len;
#ifdef INET6
case JUNIPER_LSQ_L3_PROTO_IPV6:
- ip6_print(p,l2info.length);
+ ip6_print(gndo, p,l2info.length);
return l2info.header_len;
#endif
case JUNIPER_LSQ_L3_PROTO_MPLS:
return l2info.header_len;
#ifdef INET6
case JUNIPER_LSQ_L3_PROTO_IPV6:
- ip6_print(p,l2info.length);
+ ip6_print(gndo, p,l2info.length);
return l2info.header_len;
#endif
case JUNIPER_LSQ_L3_PROTO_MPLS:
if (l2info.direction != JUNIPER_BPF_PKT_IN && /* ether-over-1483 encaps ? */
(EXTRACT_32BITS(l2info.cookie) & ATM2_GAP_COUNT_MASK)) {
- ether_print(p, l2info.length, l2info.caplen);
+ ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL);
return l2info.header_len;
}
case 0x6d:
case 0x6e:
case 0x6f:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
default:
}
break;
#endif
+#ifdef DLT_JUNIPER_GGSN
+ case DLT_JUNIPER_GGSN:
+ break;
+#endif
#ifdef DLT_JUNIPER_ATM1
case DLT_JUNIPER_ATM1:
break;