| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BPF_DSL_BPF_DSL_H_ | 5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ |
| 6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ | 6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // The semantics of each function and operator are intended to be | 69 // The semantics of each function and operator are intended to be |
| 70 // intuitive, but are described in more detail below. | 70 // intuitive, but are described in more detail below. |
| 71 // | 71 // |
| 72 // (Credit to Sean Parent's "Inheritance is the Base Class of Evil" | 72 // (Credit to Sean Parent's "Inheritance is the Base Class of Evil" |
| 73 // talk at Going Native 2013 for promoting value semantics via shared | 73 // talk at Going Native 2013 for promoting value semantics via shared |
| 74 // pointers to immutable state.) | 74 // pointers to immutable state.) |
| 75 | 75 |
| 76 namespace sandbox { | 76 namespace sandbox { |
| 77 namespace bpf_dsl { | 77 namespace bpf_dsl { |
| 78 | 78 |
| 79 template <typename T> |
| 80 class Caser; |
| 81 |
| 82 class Elser; |
| 83 |
| 79 // ResultExpr is an opaque reference to an immutable result expression tree. | 84 // ResultExpr is an opaque reference to an immutable result expression tree. |
| 80 using ResultExpr = std::shared_ptr<const internal::ResultExprImpl>; | 85 using ResultExpr = std::shared_ptr<const internal::ResultExprImpl>; |
| 81 | 86 |
| 82 // BoolExpr is an opaque reference to an immutable boolean expression tree. | 87 // BoolExpr is an opaque reference to an immutable boolean expression tree. |
| 83 using BoolExpr = std::shared_ptr<const internal::BoolExprImpl>; | 88 using BoolExpr = std::shared_ptr<const internal::BoolExprImpl>; |
| 84 | 89 |
| 85 // Allow specifies a result that the system call should be allowed to | 90 // Allow specifies a result that the system call should be allowed to |
| 86 // execute normally. | 91 // execute normally. |
| 87 SANDBOX_EXPORT ResultExpr Allow(); | 92 SANDBOX_EXPORT ResultExpr Allow(); |
| 88 | 93 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 331 |
| 327 template <typename... Rest> | 332 template <typename... Rest> |
| 328 BoolExpr AnyOf(BoolExpr first, Rest&&... rest) { | 333 BoolExpr AnyOf(BoolExpr first, Rest&&... rest) { |
| 329 return AnyOf(std::move(first), AnyOf(std::forward<Rest>(rest)...)); | 334 return AnyOf(std::move(first), AnyOf(std::forward<Rest>(rest)...)); |
| 330 } | 335 } |
| 331 | 336 |
| 332 } // namespace bpf_dsl | 337 } // namespace bpf_dsl |
| 333 } // namespace sandbox | 338 } // namespace sandbox |
| 334 | 339 |
| 335 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ | 340 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ |
| OLD | NEW |