* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+/* \summary: IP over Fibre Channel printer */
+
+/* specification: RFC 2625 */
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
#include <string.h>
-#include "interface.h"
+#include "netdissect.h"
#include "addrtoname.h"
#include "ether.h"
-/*
- * RFC 2625 IP-over-Fibre Channel.
- */
-
struct ipfc_header {
u_char ipfc_dhost[8];
u_char ipfc_shost[8];
dstname = etheraddr_string(ndo, ipfcdst);
/*
- * XXX - show the upper 16 bits? Do so only if "vflag" is set?
+ * XXX - should we show the upper 16 bits of the addresses?
+ * Do so only if "vflag" is set?
+ * Section 3.3 "FC Port and Node Network Addresses" says that
+ *
+ * In this specification, both the Source and Destination
+ * 4-bit NAA identifiers SHALL be set to binary '0001'
+ * indicating that an IEEE 48-bit MAC address is contained
+ * in the lower 48 bits of the network address fields. The
+ * high order 12 bits in the network address fields SHALL
+ * be set to 0x0000.
+ *
+ * so, for captures following this specification, the upper 16
+ * bits should be 0x1000, followed by a MAC address.
*/
- ND_PRINT((ndo, "%s %s %d: ", srcname, dstname, length));
+ ND_PRINT((ndo, "%s > %s, length %u: ", srcname, dstname, length));
}
static u_int
{
const struct ipfc_header *ipfcp = (const struct ipfc_header *)p;
struct ether_header ehdr;
+ struct lladdr_info src, dst;
int llc_hdrlen;
if (caplen < IPFC_HDRLEN) {
if (ndo->ndo_eflag)
ipfc_hdr_print(ndo, ipfcp, length, ESRC(&ehdr), EDST(&ehdr));
+ src.addr = ESRC(&ehdr);
+ src.addr_string = etheraddr_string;
+ dst.addr = EDST(&ehdr);
+ dst.addr_string = etheraddr_string;
+
/* Skip over Network_Header */
length -= IPFC_HDRLEN;
p += IPFC_HDRLEN;
caplen -= IPFC_HDRLEN;
/* Try to print the LLC-layer header & higher layers */
- llc_hdrlen = llc_print(ndo, p, length, caplen, ESRC(&ehdr), EDST(&ehdr));
+ llc_hdrlen = llc_print(ndo, p, length, caplen, &src, &dst);
if (llc_hdrlen < 0) {
/*
* Some kinds of LLC packet we cannot