* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
*/
+/* \summary: IP-over-InfiniBand (IPoIB) printer */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
{
uint16_t ether_type;
- ether_type = GET_BE_U_2(&bp[40]);
+ ether_type = GET_BE_U_2(bp + 40);
if (!ndo->ndo_qflag) {
- (void)printf(", ethertype %s (0x%04x)",
+ ND_PRINT(", ethertype %s (0x%04x)",
tok2str(ethertype_values,"Unknown", ether_type),
ether_type);
} else {
- (void)printf(", ethertype %s",
+ ND_PRINT(", ethertype %s",
tok2str(ethertype_values,"Unknown", ether_type));
}
- (void)printf(", length %u: ", length);
+ ND_PRINT(", length %u: ", length);
}
/*
u_short ether_type;
if (caplen < IPOIB_HDRLEN || length < IPOIB_HDRLEN) {
- printf("[|ipoib]");
+ nd_print_trunc(ndo);
return;
}
if (ndo->ndo_eflag) {
+ ND_PRINT("IPOIB");
if (print_encap_header != NULL)
(*print_encap_header)(encap_header_arg);
ipoib_hdr_print(ndo, p, length);
length -= IPOIB_HDRLEN;
caplen -= IPOIB_HDRLEN;
- ether_type = GET_BE_U_2(&p[40]);
+ ether_type = GET_BE_U_2(p + 40);
p += IPOIB_HDRLEN;
if (ethertype_print(ndo, ether_type, p, length, caplen, NULL, NULL) == 0) {
u_int
ipoib_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
+ ndo->ndo_protocol = "ipoib";
ipoib_print(ndo, p, h->len, h->caplen, NULL, NULL);
return (IPOIB_HDRLEN);
}
-
-/*
- * Local Variables:
- * c-style: whitesmith
- * c-basic-offset: 8
- * End:
- */