net: add rte prefix to ether structures
[dpdk.git] / app / test / test_cmdline_etheraddr.c
index 6ceba4b..90943c2 100644 (file)
@@ -82,7 +82,7 @@ const char * ether_addr_invalid_strs[] = {
 
 
 static int
-is_addr_different(const struct ether_addr addr, uint64_t num)
+is_addr_different(const struct rte_ether_addr addr, uint64_t num)
 {
        int i;
        for (i = 0; i < ETHER_ADDR_LEN; i++, num >>= 8)
@@ -97,7 +97,7 @@ int
 test_parse_etheraddr_invalid_param(void)
 {
        char buf[CMDLINE_TEST_BUFSIZE];
-       struct ether_addr result;
+       struct rte_ether_addr result;
        int ret = 0;
 
        /* try all null */
@@ -118,8 +118,7 @@ test_parse_etheraddr_invalid_param(void)
        /* try null result */
 
        /* copy string to buffer */
-       snprintf(buf, sizeof(buf), "%s",
-                       ether_addr_valid_strs[0].str);
+       strlcpy(buf, ether_addr_valid_strs[0].str, sizeof(buf));
 
        ret = cmdline_parse_etheraddr(NULL, buf, NULL, 0);
        if (ret == -1) {
@@ -149,12 +148,12 @@ test_parse_etheraddr_invalid_data(void)
 {
        int ret = 0;
        unsigned i;
-       struct ether_addr result;
+       struct rte_ether_addr result;
 
        /* test full strings */
        for (i = 0; i < ETHERADDR_INVALID_STRS_SIZE; i++) {
 
-               memset(&result, 0, sizeof(struct ether_addr));
+               memset(&result, 0, sizeof(struct rte_ether_addr));
 
                ret = cmdline_parse_etheraddr(NULL, ether_addr_invalid_strs[i],
                        (void*)&result, sizeof(result));
@@ -174,12 +173,12 @@ test_parse_etheraddr_valid(void)
 {
        int ret = 0;
        unsigned i;
-       struct ether_addr result;
+       struct rte_ether_addr result;
 
        /* test full strings */
        for (i = 0; i < ETHERADDR_VALID_STRS_SIZE; i++) {
 
-               memset(&result, 0, sizeof(struct ether_addr));
+               memset(&result, 0, sizeof(struct rte_ether_addr));
 
                ret = cmdline_parse_etheraddr(NULL, ether_addr_valid_strs[i].str,
                        (void*)&result, sizeof(result));
@@ -198,7 +197,7 @@ test_parse_etheraddr_valid(void)
        /* test garbage strings */
        for (i = 0; i < ETHERADDR_GARBAGE_STRS_SIZE; i++) {
 
-               memset(&result, 0, sizeof(struct ether_addr));
+               memset(&result, 0, sizeof(struct rte_ether_addr));
 
                ret = cmdline_parse_etheraddr(NULL, ether_addr_garbage_strs[i],
                        (void*)&result, sizeof(result));