1 #pragma once
2 #include <net/ethernet.h>
3 
4 #include <optional>
5 #include <string>
6 
7 /** @brief Clears out the interfaces and IPs configured for mocking
8  */
9 void mock_clear();
10 
11 /** @brief Adds the given interface and addr info
12  *         into the ifaddr list.
13  *  @param[in] name - Interface name.
14  *  @param[in] addr - IP address.
15  *  @param[in] mask - subnet mask.
16  *  @param[in] flags - Interface flags.
17  */
18 
19 void mock_addIP(const char* name, const char* addr, const char* mask);
20 
21 /** @brief Adds an address string to index mapping and MAC mapping
22  *
23  *  @param[in] name - Interface name
24  *  @param[in] idx  - Interface index
25  *  @param[in] mac  - Interface MAC address
26  */
27 void mock_addIF(const std::string& name, unsigned idx, unsigned flags = 0,
28                 std::optional<ether_addr> mac = std::nullopt,
29                 std::optional<unsigned> mtu = std::nullopt);
30