net: add rte prefix to ether structures
[dpdk.git] / examples / ethtool / lib / rte_ethtool.c
index e6a2e88..299488c 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
+#include <rte_string_fns.h>
 #include <rte_version.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
@@ -43,10 +44,9 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)
        memset(&dev_info, 0, sizeof(dev_info));
        rte_eth_dev_info_get(port_id, &dev_info);
 
-       snprintf(drvinfo->driver, sizeof(drvinfo->driver), "%s",
-               dev_info.driver_name);
-       snprintf(drvinfo->version, sizeof(drvinfo->version), "%s",
-               rte_version());
+       strlcpy(drvinfo->driver, dev_info.driver_name,
+               sizeof(drvinfo->driver));
+       strlcpy(drvinfo->version, rte_version(), sizeof(drvinfo->version));
        /* TODO: replace bus_info by rte_devargs.name */
        if (dev_info.device)
                bus = rte_bus_find_by_device(dev_info.device);
@@ -303,7 +303,7 @@ rte_ethtool_net_stop(uint16_t port_id)
 }
 
 int
-rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr)
+rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr)
 {
        RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
        if (addr == NULL)
@@ -314,7 +314,7 @@ rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr)
 }
 
 int
-rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr)
+rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr)
 {
        if (addr == NULL)
                return -EINVAL;
@@ -323,7 +323,7 @@ rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr)
 
 int
 rte_ethtool_net_validate_addr(uint16_t port_id __rte_unused,
-       struct ether_addr *addr)
+       struct rte_ether_addr *addr)
 {
        if (addr == NULL)
                return -EINVAL;