Lines Matching refs:cstate
24 %parse-param { compiler_state_t *cstate }
222 yyerror(void *yyscanner _U_, compiler_state_t *cstate, const char *msg)
224 bpf_set_error(cstate, "can't parse filter expression: %s", msg);
229 pfreason_to_num(compiler_state_t *cstate, const char *reason)
238 bpf_set_error(cstate, "unknown PF reason");
243 pfaction_to_num(compiler_state_t *cstate, const char *action)
262 bpf_set_error(cstate, "unknown PF action");
268 pfreason_to_num(compiler_state_t *cstate, const char *reason _U_)
270 bpf_set_error(cstate, "libpcap was compiled on a machine without pf support");
275 pfaction_to_num(compiler_state_t *cstate, const char *action _U_)
277 bpf_set_error(cstate, "libpcap was compiled on a machine without pf support");
364 CHECK_INT_VAL(finish_parse(cstate, $2.b));
381 | pnum { CHECK_PTR_VAL(($$.b = gen_ncode(cstate, NULL, (bpf_u_int32)$1,
385 nid: ID { CHECK_PTR_VAL($1); CHECK_PTR_VAL(($$.b = gen_scode(cstate, $1, $$.q = $<blk>0.q))); }
386 | HID '/' NUM { CHECK_PTR_VAL($1); CHECK_PTR_VAL(($$.b = gen_mcode(cstate, $1, NULL, $3,
388 | HID NETMASK HID { CHECK_PTR_VAL($1); CHECK_PTR_VAL(($$.b = gen_mcode(cstate, $1, $3, 0,
395 bpf_set_error(cstate, "'port' modifier applied to ip host");
398 bpf_set_error(cstate, "'portrange' modifier applied to ip host");
401 bpf_set_error(cstate, "'proto' modifier applied to ip host");
404 bpf_set_error(cstate, "'protochain' modifier applied to ip host");
407 CHECK_PTR_VAL(($$.b = gen_ncode(cstate, $1, 0, $$.q)));
412 CHECK_PTR_VAL(($$.b = gen_mcode6(cstate, $1, NULL, $3,
415 bpf_set_error(cstate, "'ip6addr/prefixlen' not supported "
423 CHECK_PTR_VAL(($$.b = gen_mcode6(cstate, $1, 0, 128,
426 bpf_set_error(cstate, "'ip6addr' not supported "
431 | EID { CHECK_PTR_VAL($1); CHECK_PTR_VAL(($$.b = gen_ecode(cstate, $1, $$.q = $<blk>0.q))); }
432 | AID { CHECK_PTR_VAL($1); CHECK_PTR_VAL(($$.b = gen_acode(cstate, $1, $$.q = $<blk>0.q))); }
443 qid: pnum { CHECK_PTR_VAL(($$.b = gen_ncode(cstate, NULL, (bpf_u_int32)$1,
456 bpf_set_error(cstate, "protochain not supported");
466 | pname { CHECK_PTR_VAL(($$.b = gen_proto_abbrev(cstate, $1))); $$.q = qerr; }
467 | arth relop arth { CHECK_PTR_VAL(($$.b = gen_relation(cstate, $2, $1, $3, 0)));
469 | arth irelop arth { CHECK_PTR_VAL(($$.b = gen_relation(cstate, $2, $1, $3, 1)));
472 | atmtype { CHECK_PTR_VAL(($$.b = gen_atmtype_abbrev(cstate, $1))); $$.q = qerr; }
473 | atmmultitype { CHECK_PTR_VAL(($$.b = gen_atmmulti_abbrev(cstate, $1))); $$.q = qerr; }
475 | mtp2type { CHECK_PTR_VAL(($$.b = gen_mtp2type_abbrev(cstate, $1))); $$.q = qerr; }
545 other: pqual TK_BROADCAST { CHECK_PTR_VAL(($$ = gen_broadcast(cstate, $1))); }
546 | pqual TK_MULTICAST { CHECK_PTR_VAL(($$ = gen_multicast(cstate, $1))); }
547 | LESS NUM { CHECK_PTR_VAL(($$ = gen_less(cstate, $2))); }
548 | GREATER NUM { CHECK_PTR_VAL(($$ = gen_greater(cstate, $2))); }
549 | CBYTE NUM byteop NUM { CHECK_PTR_VAL(($$ = gen_byteop(cstate, $3, $2, $4))); }
550 | INBOUND { CHECK_PTR_VAL(($$ = gen_inbound(cstate, 0))); }
551 | OUTBOUND { CHECK_PTR_VAL(($$ = gen_inbound(cstate, 1))); }
552 | VLAN pnum { CHECK_PTR_VAL(($$ = gen_vlan(cstate, (bpf_u_int32)$2, 1))); }
553 | VLAN { CHECK_PTR_VAL(($$ = gen_vlan(cstate, 0, 0))); }
554 | MPLS pnum { CHECK_PTR_VAL(($$ = gen_mpls(cstate, (bpf_u_int32)$2, 1))); }
555 | MPLS { CHECK_PTR_VAL(($$ = gen_mpls(cstate, 0, 0))); }
556 | PPPOED { CHECK_PTR_VAL(($$ = gen_pppoed(cstate))); }
557 | PPPOES pnum { CHECK_PTR_VAL(($$ = gen_pppoes(cstate, (bpf_u_int32)$2, 1))); }
558 | PPPOES { CHECK_PTR_VAL(($$ = gen_pppoes(cstate, 0, 0))); }
559 | GENEVE pnum { CHECK_PTR_VAL(($$ = gen_geneve(cstate, (bpf_u_int32)$2, 1))); }
560 | GENEVE { CHECK_PTR_VAL(($$ = gen_geneve(cstate, 0, 0))); }
566 pfvar: PF_IFNAME ID { CHECK_PTR_VAL($2); CHECK_PTR_VAL(($$ = gen_pf_ifname(cstate, $2))); }
567 | PF_RSET ID { CHECK_PTR_VAL($2); CHECK_PTR_VAL(($$ = gen_pf_ruleset(cstate, $2))); }
568 | PF_RNR NUM { CHECK_PTR_VAL(($$ = gen_pf_rnr(cstate, $2))); }
569 | PF_SRNR NUM { CHECK_PTR_VAL(($$ = gen_pf_srnr(cstate, $2))); }
570 | PF_REASON reason { CHECK_PTR_VAL(($$ = gen_pf_reason(cstate, $2))); }
571 | PF_ACTION action { CHECK_PTR_VAL(($$ = gen_pf_action(cstate, $2))); }
575 { CHECK_PTR_VAL(($$ = gen_p80211_type(cstate, $2 | $4,
579 | TYPE type { CHECK_PTR_VAL(($$ = gen_p80211_type(cstate, $2,
582 | SUBTYPE type_subtype { CHECK_PTR_VAL(($$ = gen_p80211_type(cstate, $2,
586 | DIR dir { CHECK_PTR_VAL(($$ = gen_p80211_fcdir(cstate, $2))); }
593 bpf_set_error(cstate, "unknown 802.11 type name");
606 bpf_set_error(cstate, "unknown 802.11 type");
617 bpf_set_error(cstate, "unknown 802.11 subtype name");
628 bpf_set_error(cstate, "unknown 802.11 type name");
640 pllc: LLC { CHECK_PTR_VAL(($$ = gen_llc(cstate))); }
643 CHECK_PTR_VAL(($$ = gen_llc_i(cstate)));
645 CHECK_PTR_VAL(($$ = gen_llc_s(cstate)));
647 CHECK_PTR_VAL(($$ = gen_llc_u(cstate)));
653 CHECK_PTR_VAL(($$ = gen_llc_s_subtype(cstate, subtype)));
657 bpf_set_error(cstate, "unknown LLC type name \"%s\"", $2);
660 CHECK_PTR_VAL(($$ = gen_llc_u_subtype(cstate, subtype)));
665 | LLC PF_RNR { CHECK_PTR_VAL(($$ = gen_llc_s_subtype(cstate, LLC_RNR))); }
679 bpf_set_error(cstate, "unknown 802.11 direction");
686 | ID { CHECK_PTR_VAL($1); CHECK_INT_VAL(($$ = pfreason_to_num(cstate, $1))); }
689 action: ID { CHECK_PTR_VAL($1); CHECK_INT_VAL(($$ = pfaction_to_num(cstate, $1))); }
700 arth: pnum { CHECK_PTR_VAL(($$ = gen_loadi(cstate, $1))); }
703 narth: pname '[' arth ']' { CHECK_PTR_VAL(($$ = gen_load(cstate, $1, $3, 1))); }
704 | pname '[' arth ':' NUM ']' { CHECK_PTR_VAL(($$ = gen_load(cstate, $1, $3, $5))); }
705 | arth '+' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_ADD, $1, $3))); }
706 | arth '-' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_SUB, $1, $3))); }
707 | arth '*' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_MUL, $1, $3))); }
708 | arth '/' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_DIV, $1, $3))); }
709 | arth '%' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_MOD, $1, $3))); }
710 | arth '&' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_AND, $1, $3))); }
711 | arth '|' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_OR, $1, $3))); }
712 | arth '^' arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_XOR, $1, $3))); }
713 | arth LSH arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_LSH, $1, $3))); }
714 | arth RSH arth { CHECK_PTR_VAL(($$ = gen_arth(cstate, BPF_RSH, $1, $3))); }
715 | '-' arth %prec UMINUS { CHECK_PTR_VAL(($$ = gen_neg(cstate, $2))); }
717 | LEN { CHECK_PTR_VAL(($$ = gen_loadlen(cstate))); }
746 | relop NUM { CHECK_PTR_VAL(($$.b = gen_atmfield_code(cstate, $<blk>0.atmfieldtype, (bpf_int32)$2, (bpf_u_int32)$1, 0))); }
747 | irelop NUM { CHECK_PTR_VAL(($$.b = gen_atmfield_code(cstate, $<blk>0.atmfieldtype, (bpf_int32)$2, (bpf_u_int32)$1, 1))); }
754 CHECK_PTR_VAL(($$.b = gen_atmfield_code(cstate, $$.atmfieldtype, (bpf_int32) $1, BPF_JEQ, 0)));
779 | relop NUM { CHECK_PTR_VAL(($$.b = gen_mtp3field_code(cstate, $<blk>0.mtp3fieldtype, (u_int)$2, (u_int)$1, 0))); }
780 | irelop NUM { CHECK_PTR_VAL(($$.b = gen_mtp3field_code(cstate, $<blk>0.mtp3fieldtype, (u_int)$2, (u_int)$1, 1))); }
793 CHECK_PTR_VAL(($$.b = gen_mtp3field_code(cstate, $$.mtp3fieldtype, (u_int) $1, BPF_JEQ, 0)));