util: Replace raw struct functions with stdplus
These functions were recently added to stdplus as they are useful across
projects.
Change-Id: Ia383715a253fce71dacc6bc72b1771393e8ed600
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/neighbor.cpp b/neighbor.cpp
index 717719c..dc6a581 100644
--- a/neighbor.cpp
+++ b/neighbor.cpp
@@ -14,6 +14,7 @@
#include <sys/types.h>
#include <stdexcept>
+#include <stdplus/raw.hpp>
#include <string_view>
#include <utility>
#include <vector>
@@ -32,7 +33,7 @@
{
throw std::runtime_error("Not a neighbor msg");
}
- auto ndm = extract<ndmsg>(msg, "Bad neighbor msg");
+ auto ndm = stdplus::raw::extract<ndmsg>(msg);
// Filter out neighbors we don't care about
unsigned ifindex = ndm.ndm_ifindex;
@@ -55,7 +56,7 @@
auto [hdr, data] = netlink::extractRtAttr(msg);
if (hdr.rta_type == NDA_LLADDR)
{
- neighbor.mac = copyFrom<ether_addr>(data, "Bad neighbor MAC");
+ neighbor.mac = stdplus::raw::copyFrom<ether_addr>(data);
}
else if (hdr.rta_type == NDA_DST)
{