X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fparser.c;h=fb0769fe370960ef3057169c9f59d72e7c47613c;hb=2cf67788ae895b4e3c05059e1feb06f6d3d8865e;hp=ffcdeb3a643c3c2c2fac9077d7dbd364be7e5f48;hpb=fbc74e66334f52a00263dd81dd49fe513b6e8967;p=dpdk.git diff --git a/examples/ip_pipeline/parser.c b/examples/ip_pipeline/parser.c index ffcdeb3a64..fb0769fe37 100644 --- a/examples/ip_pipeline/parser.c +++ b/examples/ip_pipeline/parser.c @@ -513,13 +513,13 @@ inet_pton6(const char *src, unsigned char *dst) return 1; } -static struct ether_addr * +static struct rte_ether_addr * my_ether_aton(const char *a) { int i; char *end; - unsigned long o[ETHER_ADDR_LEN]; - static struct ether_addr ether_addr; + unsigned long o[RTE_ETHER_ADDR_LEN]; + static struct rte_ether_addr ether_addr; i = 0; do { @@ -528,21 +528,21 @@ my_ether_aton(const char *a) if (errno != 0 || end == a || (end[0] != ':' && end[0] != 0)) return NULL; a = end + 1; - } while (++i != sizeof(o) / sizeof(o[0]) && end[0] != 0); + } while (++i != RTE_DIM(o) && end[0] != 0); /* Junk at the end of line */ if (end[0] != 0) return NULL; /* Support the format XX:XX:XX:XX:XX:XX */ - if (i == ETHER_ADDR_LEN) { + if (i == RTE_ETHER_ADDR_LEN) { while (i-- != 0) { if (o[i] > UINT8_MAX) return NULL; ether_addr.addr_bytes[i] = (uint8_t)o[i]; } /* Support the format XXXX:XXXX:XXXX */ - } else if (i == ETHER_ADDR_LEN / 2) { + } else if (i == RTE_ETHER_ADDR_LEN / 2) { while (i-- != 0) { if (o[i] > UINT16_MAX) return NULL; @@ -553,7 +553,7 @@ my_ether_aton(const char *a) } else return NULL; - return (struct ether_addr *)ðer_addr; + return (struct rte_ether_addr *)ðer_addr; } int @@ -581,15 +581,15 @@ parse_ipv6_addr(const char *token, struct in6_addr *ipv6) } int -parse_mac_addr(const char *token, struct ether_addr *addr) +parse_mac_addr(const char *token, struct rte_ether_addr *addr) { - struct ether_addr *tmp; + struct rte_ether_addr *tmp; tmp = my_ether_aton(token); if (tmp == NULL) return -1; - memcpy(addr, tmp, sizeof(struct ether_addr)); + memcpy(addr, tmp, sizeof(struct rte_ether_addr)); return 0; }