test: Mock out MAC address access
This makes it possible for our ethernet interfaces to have MAC Addresses
detected and configured for testing without the system providing a real
NIC.
Change-Id: Ie985efec0a5e393b0b76f3d02bd3015fef6349e4
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/mock_syscall.hpp b/test/mock_syscall.hpp
index f14bd96..4d934b3 100644
--- a/test/mock_syscall.hpp
+++ b/test/mock_syscall.hpp
@@ -1,4 +1,6 @@
#pragma once
+#include <net/ethernet.h>
+
#include <string>
/** @brief Adds the given interface and addr info
@@ -12,9 +14,11 @@
void mock_addIP(const char* name, const char* addr, const char* mask,
unsigned int flags);
-/** @brief Adds an address string to index mapping
+/** @brief Adds an address string to index mapping and MAC mapping
*
* @param[in] name - Interface name
* @param[in] idx - Interface index
+ * @param[in] mac - Interface MAC address
*/
-void mock_addIF(const std::string& name, int idx);
+void mock_addIF(const std::string& name, int idx,
+ const ether_addr& mac = ether_addr{});