diff options
author | 2016-02-28 04:30:11 -0500 | |
---|---|---|
committer | 2016-02-28 04:30:58 -0500 | |
commit | 5f17c48a1f6f7006cbb6e1b17eca2ebd6b682b78 (patch) | |
tree | d1af472bbc92962e6cf4757cf7da09bcd73edf82 /src/main_dpdk.cpp | |
parent | 2f42eda77b027f5c9d39cba48373d75c0e1e2155 (diff) |
support for mac addr query
Diffstat (limited to 'src/main_dpdk.cpp')
-rw-r--r-- | src/main_dpdk.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index c23e27d4..cdf4f6f3 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -5180,3 +5180,14 @@ bool TrexDpdkPlatformApi::get_promiscuous(uint8_t port_id) const { return g_trex.m_ports[port_id].get_promiscuous(); } +void TrexDpdkPlatformApi::get_macaddr(uint8_t port_id, uint8_t *macaddr) const { + struct ether_addr rte_mac_addr; + + g_trex.m_ports[port_id].macaddr_get(&rte_mac_addr); + + assert(ETHER_ADDR_LEN == 6); + for (int i = 0; i < 6; i++) { + macaddr[i] = rte_mac_addr.addr_bytes[i]; + } + +} |