/* "proto" is an Ethernet type value and for IPNET, if it is not IPv4 or IPv6 then we have an error.  */
static struct block * gen_ipnet_linktype(compiler_state_t *, int)
/* "proto" is an Ethernet type value and for IPNET, if it is not IPv4 or IPv6 then we have an error.  */
static struct block * gen_ipnet_linktype(compiler_state_t *, int)
{
	switch (proto) {
	case ETHERTYPE_IP:
		return gen_cmp(cstate, OR_LINKTYPE, 0, BPF_B, (bpf_int32)IPH_AF_INET);
	case ETHERTYPE_IPV6:
		return gen_cmp(cstate, OR_LINKTYPE, 0, BPF_B,
		    (bpf_int32)IPH_AF_INET6);
	default:
		break;
	}
	return gen_false(cstate);
}