| 42 | namespace { |
| 43 | |
| 44 | absl::StatusOr<std::unique_ptr<cel::Compiler>> ConfigureCompiler() { |
| 45 | absl::StatusOr<std::unique_ptr<cel::CompilerBuilder>> compiler_builder = |
| 46 | cel::NewCompilerBuilder(cel::GetMinimalDescriptorPool()); |
| 47 | if (!compiler_builder.ok()) { |
| 48 | return std::move(compiler_builder).status(); |
| 49 | } |
| 50 | absl::Status s = |
| 51 | (*compiler_builder)->AddLibrary(cel::StandardCompilerLibrary()); |
| 52 | // =========================================================================== |
| 53 | // Codelab: Update compiler builder with functions from network_functions.h |
| 54 | // and add a varible for the input IP. |
| 55 | // =========================================================================== |
| 56 | if (!s.ok()) return s; |
| 57 | |
| 58 | return (*compiler_builder)->Build(); |
| 59 | } |
| 60 | |
| 61 | absl::StatusOr<std::unique_ptr<cel::Runtime>> ConfigureRuntime() { |
| 62 | cel::RuntimeOptions runtime_options; |
no test coverage detected