dump: fix compilation on CentOS 7
Refs: #4852
Change-Id: I2550d26f709f645ee3d6b2e0f63a6698525e1a76
diff --git a/tools/dump/ndndump.hpp b/tools/dump/ndndump.hpp
index 0198026..58ba032 100644
--- a/tools/dump/ndndump.hpp
+++ b/tools/dump/ndndump.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2011-2018, Regents of the University of California.
+ * Copyright (c) 2011-2019, Regents of the University of California.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -25,6 +25,18 @@
#include <pcap.h>
#include <regex>
+#ifdef HAVE_BSD_TCPHDR
+#define TH_OFF th_off
+#else
+#define TH_OFF doff
+#endif
+
+#ifdef HAVE_BSD_UDPHDR
+#define UH_LEN uh_ulen
+#else
+#define UH_LEN len
+#endif
+
namespace ndn {
namespace dump {