Hello!
> +static int
> +compare_filter(struct rte_mbuf *pkt)
> +{
> + struct ipv4_hdr *pkt_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr
> *,
> + sizeof(struct ether_hdr));
> + if (pkt_hdr->src_addr != src_ip_filter)
> + return -1;
> +
> + return 0;
> +}
Some critics to this...
What if i want to capture packets coming from more than one host?
What if i want to capture all packets?
What if it's not IPv4 at all?
May be this function should always return 0 if src_ip_filter == 0? This would
at least be a quick way to disable filtering.
Kind regards,
Pavel Fedin
Senior Engineer
Samsung Electronics Research center Russia