X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fipv4_multicast%2Fmain.c;h=a84d28c86deaa4dcb3f57d4bc2072b04bb577b1b;hb=a7c528e5d71ff3f569898d268f9de129fdfc152b;hp=1eef2915906c576f3cc0b1b76913ea8babce431a;hpb=70a19dc938baae4158ac951b7058c83c5188b940;p=dpdk.git diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 1eef291590..a84d28c86d 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -80,7 +80,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[MAX_PORTS]; +static struct rte_ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; @@ -267,19 +267,20 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) * and put it into the outgoing queue for the given port. */ static inline void -mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, +mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port) { - struct ether_hdr *ethdr; + struct rte_ether_hdr *ethdr; uint16_t len; /* Construct Ethernet header. */ - ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr)); + ethdr = (struct rte_ether_hdr *) + rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr)); RTE_ASSERT(ethdr != NULL); - ether_addr_copy(dest_addr, ðdr->d_addr); - ether_addr_copy(&ports_eth_addr[port], ðdr->s_addr); - ethdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4); + rte_ether_addr_copy(dest_addr, ðdr->d_addr); + rte_ether_addr_copy(&ports_eth_addr[port], ðdr->s_addr); + ethdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPv4); /* Put new packet into the output queue */ len = qconf->tx_mbufs[port].len; @@ -296,17 +297,18 @@ static inline void mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) { struct rte_mbuf *mc; - struct ipv4_hdr *iphdr; + struct rte_ipv4_hdr *iphdr; uint32_t dest_addr, port_mask, port_num, use_clone; int32_t hash; uint16_t port; union { uint64_t as_int; - struct ether_addr as_addr; + struct rte_ether_addr as_addr; } dst_eth_addr; /* Remove the Ethernet header from the input packet */ - iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr)); + iphdr = (struct rte_ipv4_hdr *) + rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr)); RTE_ASSERT(iphdr != NULL); dest_addr = rte_be_to_cpu_32(iphdr->dst_addr); @@ -535,10 +537,10 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, struct ether_addr *eth_addr) +print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { - char buf[ETHER_ADDR_FMT_SIZE]; - ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); + char buf[RTE_ETHER_ADDR_FMT_SIZE]; + rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr); printf("%s%s", name, buf); }