Lines Matching +defs:a +defs:code

8  * modification, are permitted provided that: (1) source code distributions
10 * distributions including binary code include the above copyright notice and
100 /* initialization code used for variable link header */
219 * A strdup whose allocations are freed after code generation is over.
232 new_block(int code)
237 p->s.code = code;
244 new_stmt(int code)
249 p->s.code = code;
305 (root->s.code == (BPF_RET|BPF_K) && root->s.k == 0))
353 (root->s.code == (BPF_RET|BPF_K) && root->s.k == 0))
364 * Clean up a "struct bpf_program" by freeing all the memory allocated
379 * which of the jt and jf fields has been resolved and which is a pointer
425 /* prepend initialization code to root */
567 * Various code constructs need to know the layout of the data link
577 /* Generate code to load the dynamic 'off_nl' to the X register */
662 * SLIP doesn't have a link level type. The 16 byte
707 * FDDI doesn't really have a link-level type field.
899 * For DLT_NULL, the link-layer header is a 32-bit word
901 * DLT_ENC, the link-layer header begins with a 32-bit
904 * For DLT_LOOP, the link-layer header is a 32-bit
977 u_int32_t *a, *m;
1007 a = (u_int32_t *)addr;
1009 b1 = gen_mcmp_nl(offset + 12, BPF_W, ntohl(a[3]), ntohl(m[3]));
1010 b0 = gen_mcmp_nl(offset + 8, BPF_W, ntohl(a[2]), ntohl(m[2]));
1012 b0 = gen_mcmp_nl(offset + 4, BPF_W, ntohl(a[1]), ntohl(m[1]));
1014 b0 = gen_mcmp_nl(offset + 0, BPF_W, ntohl(a[0]), ntohl(m[0]));
1098 * carry both src and dst addresses, plus 5 packet types in a format that
1099 * carries only the src node, plus 2 types that use a different format and
1106 * will require a lot more hacking.
1109 * one would want to add a "mask" argument to this routine. That would
1545 This function generates code to set X to the start of the IP payload
1821 no_optimize = 1; /*this code is not compatible with optimzer yet */
1824 * s[0] is a dummy entry to protect other BPF insn from damaged
2272 * there is no need to build up a list of addresses
2505 bpf_error("'gateway' requires a name");
2533 u_int32_t *a, *m;
2554 a = (u_int32_t *)addr;
2556 if ((a[0] & ~m[0]) || (a[1] & ~m[1])
2557 || (a[2] & ~m[2]) || (a[3] & ~m[3])) {
2610 xfer_to_x(struct arth *a)
2615 s->s.k = a->regno;
2620 xfer_to_a(struct arth *a)
2625 s->s.k = a->regno;
2677 /* XXX Note that we assume a fixed link header here. */
2734 gen_relation(int code, struct arth *a0, struct arth *a1, int reversed)
2742 b = new_block(JMP(code));
2743 if (code == BPF_JGT || code == BPF_JGE) {
2780 struct arth *a = (struct arth *)newchunk(sizeof(*a));
2786 a->s = s;
2787 a->regno = regno;
2789 return a;
2796 struct arth *a = (struct arth *)newchunk(sizeof(*a));
2802 a->s = s;
2803 a->regno = regno;
2805 return a;
2811 struct arth *a;
2815 a = (struct arth *)newchunk(sizeof(*a));
2823 a->s = s;
2824 a->regno = reg;
2826 return a;
2830 gen_neg(struct arth *a)
2834 s = xfer_to_a(a);
2835 sappend(a->s, s);
2838 sappend(a->s, s);
2840 s->s.k = a->regno;
2841 sappend(a->s, s);
2843 return a;
2847 gen_arth(int code, struct arth *a0, struct arth *a1)
2853 s2 = new_stmt(BPF_ALU|BPF_X|code);
2897 * Return a register to the table so it can
2952 b->s.code = JMP(BPF_JGE);
2958 b->s.code = JMP(BPF_JGT);
2995 bpf_error("not a broadcast link");
3000 * We treat a netmask of PCAP_NETMASK_UNKNOWN (0xffffffff)
3054 b1->s.code = JMP(BPF_JGE);
3186 /* PF firewall log reason code */
3330 * the VLAN packet. This is somewhat of a kludge.
3355 /* If a specific VLAN is requested, check VLAN id */