- b1 = gen_mcmp(cstate, OR_LINKPL, offset + 12, BPF_W, ntohl(a[3]), ntohl(m[3]));
- b0 = gen_mcmp(cstate, OR_LINKPL, offset + 8, BPF_W, ntohl(a[2]), ntohl(m[2]));
- gen_and(b0, b1);
- b0 = gen_mcmp(cstate, OR_LINKPL, offset + 4, BPF_W, ntohl(a[1]), ntohl(m[1]));
- gen_and(b0, b1);
- b0 = gen_mcmp(cstate, OR_LINKPL, offset + 0, BPF_W, ntohl(a[0]), ntohl(m[0]));
- gen_and(b0, b1);
- return b1;
-}
-#endif
-
-static struct block *
-gen_ehostop(compiler_state_t *cstate, const u_char *eaddr, int dir)
-{
- register struct block *b0, *b1;
-
- switch (dir) {
- case Q_SRC:
- return gen_bcmp(cstate, OR_LINKHDR, 6, 6, eaddr);
-
- case Q_DST:
- return gen_bcmp(cstate, OR_LINKHDR, 0, 6, eaddr);
-
- case Q_AND:
- b0 = gen_ehostop(cstate, eaddr, Q_SRC);
- b1 = gen_ehostop(cstate, eaddr, Q_DST);
- gen_and(b0, b1);
- return b1;
-
- case Q_DEFAULT:
- case Q_OR:
- b0 = gen_ehostop(cstate, eaddr, Q_SRC);
- b1 = gen_ehostop(cstate, eaddr, Q_DST);
- gen_or(b0, b1);
- return b1;
-
- case Q_ADDR1:
- case Q_ADDR2:
- case Q_ADDR3:
- case Q_ADDR4:
- case Q_RA:
- case Q_TA:
- bpf_error(cstate, ERRSTR_802_11_ONLY_KW, dqkw(dir));
- /*NOTREACHED*/
- }
- abort();
- /*NOTREACHED*/
-}
-
-/*
- * Like gen_ehostop, but for DLT_FDDI
- */
-static struct block *
-gen_fhostop(compiler_state_t *cstate, const u_char *eaddr, int dir)
-{
- struct block *b0, *b1;
-
- switch (dir) {
- case Q_SRC:
- return gen_bcmp(cstate, OR_LINKHDR, 6 + 1 + cstate->pcap_fddipad, 6, eaddr);
-
- case Q_DST:
- return gen_bcmp(cstate, OR_LINKHDR, 0 + 1 + cstate->pcap_fddipad, 6, eaddr);
-
- case Q_AND:
- b0 = gen_fhostop(cstate, eaddr, Q_SRC);
- b1 = gen_fhostop(cstate, eaddr, Q_DST);
- gen_and(b0, b1);
- return b1;
-
- case Q_DEFAULT:
- case Q_OR:
- b0 = gen_fhostop(cstate, eaddr, Q_SRC);
- b1 = gen_fhostop(cstate, eaddr, Q_DST);
- gen_or(b0, b1);
- return b1;
-
- case Q_ADDR1:
- case Q_ADDR2:
- case Q_ADDR3:
- case Q_ADDR4:
- case Q_RA:
- case Q_TA:
- bpf_error(cstate, ERRSTR_802_11_ONLY_KW, dqkw(dir));
- /*NOTREACHED*/
- }
- abort();
- /*NOTREACHED*/
-}
-
-/*
- * Like gen_ehostop, but for DLT_IEEE802 (Token Ring)
- */
-static struct block *
-gen_thostop(compiler_state_t *cstate, const u_char *eaddr, int dir)
-{
- register struct block *b0, *b1;
-
- switch (dir) {
- case Q_SRC:
- return gen_bcmp(cstate, OR_LINKHDR, 8, 6, eaddr);
-
- case Q_DST:
- return gen_bcmp(cstate, OR_LINKHDR, 2, 6, eaddr);
-
- case Q_AND:
- b0 = gen_thostop(cstate, eaddr, Q_SRC);
- b1 = gen_thostop(cstate, eaddr, Q_DST);
- gen_and(b0, b1);
- return b1;
-
- case Q_DEFAULT:
- case Q_OR:
- b0 = gen_thostop(cstate, eaddr, Q_SRC);
- b1 = gen_thostop(cstate, eaddr, Q_DST);
- gen_or(b0, b1);
- return b1;
-
- case Q_ADDR1:
- case Q_ADDR2:
- case Q_ADDR3:
- case Q_ADDR4:
- case Q_RA:
- case Q_TA:
- bpf_error(cstate, ERRSTR_802_11_ONLY_KW, dqkw(dir));
- /*NOTREACHED*/