Lines Matching refs:cstate
24 %parse-param { compiler_state_t *cstate }
222 yyerror(void *yyscanner _U_, compiler_state_t *cstate, const char *msg) in yyerror() argument
224 bpf_syntax_error(cstate, msg); in yyerror()
230 pfreason_to_num(compiler_state_t *cstate, const char *reason) in pfreason_to_num() argument
239 bpf_error(cstate, "unknown PF reason"); in pfreason_to_num()
244 pfaction_to_num(compiler_state_t *cstate, const char *action) in pfaction_to_num() argument
263 bpf_error(cstate, "unknown PF action"); in pfaction_to_num()
269 pfreason_to_num(compiler_state_t *cstate, const char *reason _U_) in pfreason_to_num() argument
271 bpf_error(cstate, "libpcap was compiled on a machine without pf support"); in pfreason_to_num()
276 pfaction_to_num(compiler_state_t *cstate, const char *action _U_) in pfaction_to_num() argument
278 bpf_error(cstate, "libpcap was compiled on a machine without pf support"); in pfaction_to_num()
362 finish_parse(cstate, $2.b);
379 | pnum { $$.b = gen_ncode(cstate, NULL, (bpf_u_int32)$1,
383 nid: ID { $$.b = gen_scode(cstate, $1, $$.q = $<blk>0.q); }
384 | HID '/' NUM { $$.b = gen_mcode(cstate, $1, NULL, $3,
386 | HID NETMASK HID { $$.b = gen_mcode(cstate, $1, $3, 0,
392 bpf_error(cstate, "'port' modifier applied to ip host");
394 bpf_error(cstate, "'portrange' modifier applied to ip host");
396 bpf_error(cstate, "'proto' modifier applied to ip host");
398 bpf_error(cstate, "'protochain' modifier applied to ip host");
399 $$.b = gen_ncode(cstate, $1, 0, $$.q);
403 $$.b = gen_mcode6(cstate, $1, NULL, $3,
406 bpf_error(cstate, "'ip6addr/prefixlen' not supported "
412 $$.b = gen_mcode6(cstate, $1, 0, 128,
415 bpf_error(cstate, "'ip6addr' not supported "
420 $$.b = gen_ecode(cstate, $1, $$.q = $<blk>0.q);
429 $$.b = gen_acode(cstate, $1, $$.q = $<blk>0.q);
447 qid: pnum { $$.b = gen_ncode(cstate, NULL, (bpf_u_int32)$1,
463 | pname { $$.b = gen_proto_abbrev(cstate, $1); $$.q = qerr; }
464 | arth relop arth { $$.b = gen_relation(cstate, $2, $1, $3, 0);
466 | arth irelop arth { $$.b = gen_relation(cstate, $2, $1, $3, 1);
469 | atmtype { $$.b = gen_atmtype_abbrev(cstate, $1); $$.q = qerr; }
470 | atmmultitype { $$.b = gen_atmmulti_abbrev(cstate, $1); $$.q = qerr; }
472 | mtp2type { $$.b = gen_mtp2type_abbrev(cstate, $1); $$.q = qerr; }
542 other: pqual TK_BROADCAST { $$ = gen_broadcast(cstate, $1); }
543 | pqual TK_MULTICAST { $$ = gen_multicast(cstate, $1); }
544 | LESS NUM { $$ = gen_less(cstate, $2); }
545 | GREATER NUM { $$ = gen_greater(cstate, $2); }
546 | CBYTE NUM byteop NUM { $$ = gen_byteop(cstate, $3, $2, $4); }
547 | INBOUND { $$ = gen_inbound(cstate, 0); }
548 | OUTBOUND { $$ = gen_inbound(cstate, 1); }
549 | VLAN pnum { $$ = gen_vlan(cstate, $2); }
550 | VLAN { $$ = gen_vlan(cstate, -1); }
551 | MPLS pnum { $$ = gen_mpls(cstate, $2); }
552 | MPLS { $$ = gen_mpls(cstate, -1); }
553 | PPPOED { $$ = gen_pppoed(cstate); }
554 | PPPOES pnum { $$ = gen_pppoes(cstate, $2); }
555 | PPPOES { $$ = gen_pppoes(cstate, -1); }
556 | GENEVE pnum { $$ = gen_geneve(cstate, $2); }
557 | GENEVE { $$ = gen_geneve(cstate, -1); }
563 pfvar: PF_IFNAME ID { $$ = gen_pf_ifname(cstate, $2); }
564 | PF_RSET ID { $$ = gen_pf_ruleset(cstate, $2); }
565 | PF_RNR NUM { $$ = gen_pf_rnr(cstate, $2); }
566 | PF_SRNR NUM { $$ = gen_pf_srnr(cstate, $2); }
567 | PF_REASON reason { $$ = gen_pf_reason(cstate, $2); }
568 | PF_ACTION action { $$ = gen_pf_action(cstate, $2); }
572 { $$ = gen_p80211_type(cstate, $2 | $4,
576 | TYPE type { $$ = gen_p80211_type(cstate, $2,
579 | SUBTYPE type_subtype { $$ = gen_p80211_type(cstate, $2,
583 | DIR dir { $$ = gen_p80211_fcdir(cstate, $2); }
589 bpf_error(cstate, "unknown 802.11 type name");
599 bpf_error(cstate, "unknown 802.11 type");
610 bpf_error(cstate, "unknown 802.11 subtype name");
618 bpf_error(cstate, "unknown 802.11 type name");
630 pllc: LLC { $$ = gen_llc(cstate); }
632 $$ = gen_llc_i(cstate);
634 $$ = gen_llc_s(cstate);
636 $$ = gen_llc_u(cstate);
642 $$ = gen_llc_s_subtype(cstate, subtype);
646 bpf_error(cstate, "unknown LLC type name \"%s\"", $2);
647 $$ = gen_llc_u_subtype(cstate, subtype);
652 | LLC PF_RNR { $$ = gen_llc_s_subtype(cstate, LLC_RNR); }
665 bpf_error(cstate, "unknown 802.11 direction");
670 | ID { $$ = pfreason_to_num(cstate, $1); }
673 action: ID { $$ = pfaction_to_num(cstate, $1); }
684 arth: pnum { $$ = gen_loadi(cstate, $1); }
687 narth: pname '[' arth ']' { $$ = gen_load(cstate, $1, $3, 1); }
688 | pname '[' arth ':' NUM ']' { $$ = gen_load(cstate, $1, $3, $5); }
689 | arth '+' arth { $$ = gen_arth(cstate, BPF_ADD, $1, $3); }
690 | arth '-' arth { $$ = gen_arth(cstate, BPF_SUB, $1, $3); }
691 | arth '*' arth { $$ = gen_arth(cstate, BPF_MUL, $1, $3); }
692 | arth '/' arth { $$ = gen_arth(cstate, BPF_DIV, $1, $3); }
693 | arth '%' arth { $$ = gen_arth(cstate, BPF_MOD, $1, $3); }
694 | arth '&' arth { $$ = gen_arth(cstate, BPF_AND, $1, $3); }
695 | arth '|' arth { $$ = gen_arth(cstate, BPF_OR, $1, $3); }
696 | arth '^' arth { $$ = gen_arth(cstate, BPF_XOR, $1, $3); }
697 | arth LSH arth { $$ = gen_arth(cstate, BPF_LSH, $1, $3); }
698 | arth RSH arth { $$ = gen_arth(cstate, BPF_RSH, $1, $3); }
699 | '-' arth %prec UMINUS { $$ = gen_neg(cstate, $2); }
701 | LEN { $$ = gen_loadlen(cstate); }
730 …| relop NUM { $$.b = gen_atmfield_code(cstate, $<blk>0.atmfieldtype, (bpf_int32)$2, (bpf_u_int32)…
731 …| irelop NUM { $$.b = gen_atmfield_code(cstate, $<blk>0.atmfieldtype, (bpf_int32)$2, (bpf_u_int32…
738 $$.b = gen_atmfield_code(cstate, $$.atmfieldtype, (bpf_int32) $1, BPF_JEQ, 0);
763 | relop NUM { $$.b = gen_mtp3field_code(cstate, $<blk>0.mtp3fieldtype, (u_int)$2, (u_int)$1, 0); }
764 …| irelop NUM { $$.b = gen_mtp3field_code(cstate, $<blk>0.mtp3fieldtype, (u_int)$2, (u_int)$1, 1);…
777 $$.b = gen_mtp3field_code(cstate, $$.mtp3fieldtype, (u_int) $1, BPF_JEQ, 0);