On Tue, 13 Mar 2018 01:51:34 +0530 Vipin Varghese <vipin.vargh...@intel.com> wrote:
> +static int parse_user_mac(struct ether_addr *user_mac, > + const char *value) > +{ > + unsigned int index = 0; > + char mac_temp[strlen(ETH_TAP_USR_MAC_FMT) + 1], *mac_byte = NULL; > + > + if (user_mac == NULL || value == NULL) > + return 0; > + > + snprintf(mac_temp, sizeof(mac_temp), "%s", value); > + mac_byte = strtok(mac_temp, ":"); > + > + while ((mac_byte != NULL) && > + (strlen(mac_byte) <= 2) && > + (strlen(mac_byte) == strspn(mac_byte, > + ETH_TAP_CMP_MAC_FMT))) { > + user_mac->addr_bytes[index++] = strtoul(mac_byte, NULL, 16); > + mac_byte = strtok(NULL, ":"); > + } > + > + return index; > +} We need rte_ether_aton or better yet replace the DPDK custom definition of "struct ether_addr" with the with the one from Linux/BSD <netinet/ether.h> There is no value in having a private version of all these routines...