Lines Matching refs:code

2 // Use of this source code is governed by a BSD-style license that can be
24 switch (BPF_CLASS(instruction->code)) {
26 if (BPF_OP(instruction->code) != BPF_JA) {
65 switch (BPF_CLASS(iter->code)) {
67 if (iter->code == BPF_LD + BPF_W + BPF_ABS) {
98 if (BPF_OP(iter->code) == BPF_JA) {
102 BPF_OP(iter->code) == BPF_JSET ? "&" :
103 BPF_OP(iter->code) == BPF_JEQ ? "==" :
104 BPF_OP(iter->code) == BPF_JGE ? ">=" :
105 BPF_OP(iter->code) == BPF_JGT ? ">" : "???",
125 fprintf(stderr, BPF_OP(iter->code) == BPF_NEG
127 BPF_OP(iter->code) == BPF_ADD ? "+" :
128 BPF_OP(iter->code) == BPF_SUB ? "-" :
129 BPF_OP(iter->code) == BPF_MUL ? "*" :
130 BPF_OP(iter->code) == BPF_DIV ? "/" :
131 BPF_OP(iter->code) == BPF_MOD ? "%" :
132 BPF_OP(iter->code) == BPF_OR ? "|" :
133 BPF_OP(iter->code) == BPF_XOR ? "^" :
134 BPF_OP(iter->code) == BPF_AND ? "&" :
135 BPF_OP(iter->code) == BPF_LSH ? "<<" :
136 BPF_OP(iter->code) == BPF_RSH ? ">>" : "???",
147 Instruction* CodeGen::MakeInstruction(uint16_t code,
154 if (BPF_CLASS(code) == BPF_JMP && BPF_OP(code) != BPF_JA) {
159 if (next && BPF_CLASS(code) == BPF_RET) {
162 if (BPF_CLASS(code) == BPF_JMP) {
164 Instruction* insn = new Instruction(code, 0, next, NULL);
169 Instruction* insn = new Instruction(code, k, next);
175 Instruction* CodeGen::MakeInstruction(uint16_t code,
181 if (BPF_CLASS(code) != BPF_JMP || BPF_OP(code) == BPF_JA) {
187 Instruction* insn = new Instruction(code, k, jt, jf);
215 if (BPF_CLASS(insn->code) == BPF_JMP) {
219 if (BPF_OP(insn->code) != BPF_JA) {
238 if (!insn->next != (BPF_CLASS(insn->code) == BPF_RET)) {
286 if (BPF_CLASS(head->code) == BPF_JMP) {
342 if (BPF_CLASS(insn->code) == BPF_JMP) {
347 if (BPF_OP(insn->code) != BPF_JA) {
421 // If the two blocks are the same length (and have elementwise-equal code
427 CHECK(BPF_CLASS(insns1_last->code) != BPF_JMP &&
428 BPF_CLASS(insns1_last->code) != BPF_RET);
441 if (insn1.code != insn2.code) {
442 return insn1.code - insn2.code;
450 if (BPF_CLASS(insn1.code) == BPF_JMP || BPF_CLASS(insn1.code) == BPF_RET) {
458 if (BPF_CLASS(insn1.code) == BPF_RET) {
460 } else if (BPF_CLASS(insn1.code) != BPF_JMP) {
470 if (BPF_OP(insn1.code) != BPF_JA) {
527 if (BPF_CLASS(last_insn->code) == BPF_JMP) {
531 if (BPF_OP(last_insn->code) != BPF_JA) {
537 } else if (BPF_CLASS(last_insn->code) != BPF_RET) {
570 if (BPF_CLASS(last_insn->code) == BPF_JMP) {
574 if (BPF_OP(last_insn->code) != BPF_JA) {
585 } else if (BPF_CLASS(last_insn->code) != BPF_RET) {
586 // We encountered an instruction that doesn't change code flow. Try to
596 // instruction to correct the code flow.
633 if (BPF_CLASS(insn->code) == BPF_JMP) {
636 if (BPF_OP(insn->code) == BPF_JA) {
681 } else if (BPF_CLASS(insn->code) != BPF_RET &&
708 (struct sock_filter) {insn.code, insn.jt, insn.jf, insn.k});
717 "Cannot call Compile() multiple times. Create a new code "