OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_INSTRUCTION_H__ | 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_INSTRUCTION_H__ |
6 #define SANDBOX_LINUX_SECCOMP_BPF_INSTRUCTION_H__ | 6 #define SANDBOX_LINUX_SECCOMP_BPF_INSTRUCTION_H__ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 namespace playground2 { | 10 namespace sandbox { |
11 | 11 |
12 // The fields in this structure have the same meaning as the corresponding | 12 // The fields in this structure have the same meaning as the corresponding |
13 // fields in "struct sock_filter". See <linux/filter.h> for a lot more | 13 // fields in "struct sock_filter". See <linux/filter.h> for a lot more |
14 // detail. | 14 // detail. |
15 // code -- Opcode of the instruction. This is typically a bitwise | 15 // code -- Opcode of the instruction. This is typically a bitwise |
16 // combination BPF_XXX values. | 16 // combination BPF_XXX values. |
17 // k -- Operand; BPF instructions take zero or one operands. Operands | 17 // k -- Operand; BPF instructions take zero or one operands. Operands |
18 // are 32bit-wide constants, if present. They can be immediate | 18 // are 32bit-wide constants, if present. They can be immediate |
19 // values (if BPF_K is present in "code_"), addresses (if BPF_ABS | 19 // values (if BPF_K is present in "code_"), addresses (if BPF_ABS |
20 // is present in "code_"), or relative jump offsets (if BPF_JMP | 20 // is present in "code_"), or relative jump offsets (if BPF_JMP |
(...skipping 29 matching lines...) Expand all Loading... |
50 }; | 50 }; |
51 | 51 |
52 // While assembling the BPF program, non-jumping instructions are linked | 52 // While assembling the BPF program, non-jumping instructions are linked |
53 // by the "next_" pointer. This field is no longer needed when we have | 53 // by the "next_" pointer. This field is no longer needed when we have |
54 // computed basic blocks. | 54 // computed basic blocks. |
55 Instruction* next; | 55 Instruction* next; |
56 }; | 56 }; |
57 uint32_t k; | 57 uint32_t k; |
58 }; | 58 }; |
59 | 59 |
60 } // namespace | 60 } // namespace sandbox |
61 | 61 |
62 #endif // SANDBOX_LINUX_SECCOMP_BPF_INSTRUCTION_H__ | 62 #endif // SANDBOX_LINUX_SECCOMP_BPF_INSTRUCTION_H__ |
OLD | NEW |