17#ifndef CONTROL_PLANE_P4RUNTIMESERIALIZER_H_
18#define CONTROL_PLANE_P4RUNTIMESERIALIZER_H_
20#pragma GCC diagnostic push
21#pragma GCC diagnostic ignored "-Wunused-parameter"
22#pragma GCC diagnostic ignored "-Wpedantic"
23#include <google/protobuf/util/json_util.h>
24#pragma GCC diagnostic pop
27#include <unordered_map>
29#include "lib/cstring.h"
30#include "p4RuntimeTypes.h"
51using namespace literals;
65 const ::p4::config::v1::P4Info *
p4Info;
71 google::protobuf::util::JsonPrintOptions jsonPrintOptions;
75 jsonPrintOptions.add_whitespace =
true;
79 google::protobuf::util::JsonPrintOptions jsonPrintOptions)
83namespace ControlPlaneAPI {
84struct P4RuntimeArchHandlerBuilderIface;
92 void registerArch(
const cstring archName,
138 std::unordered_map<cstring, const ControlPlaneAPI::P4RuntimeArchHandlerBuilderIface *>
139 archHandlerBuilders{};
Definition frontends/common/options.h:28
Public APIs to generate P4Info message. Uses the singleton pattern.
Definition p4RuntimeSerializer.h:88
static cstring resolveArch(const CompilerOptions &options)
Definition p4RuntimeSerializer.cpp:1643
void serializeP4InfoTo(std::ostream *destination, P4RuntimeFormat format) const
Definition p4RuntimeSerializer.cpp:1488
P4RuntimeAPI generateP4Runtime(const IR::P4Program *program, cstring arch)
Definition p4RuntimeSerializer.cpp:1658
void serializeP4RuntimeIfRequired(const IR::P4Program *program, const CompilerOptions &options)
Definition p4RuntimeSerializer.cpp:1564
P4RuntimeAPI generateP4Runtime(const IR::P4Program *program, cstring arch)
Definition p4RuntimeSerializer.cpp:1452
void serializeP4RuntimeIfRequired(const IR::P4Program *program, const CompilerOptions &options)
Definition p4RuntimeSerializer.cpp:1662
void serializeEntriesTo(std::ostream *destination, P4RuntimeFormat format) const
Definition p4RuntimeSerializer.cpp:1508
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
P4RuntimeFormat
P4Runtime serialization formats.
Definition p4RuntimeTypes.h:23
Definition p4RuntimeArchHandler.h:204
Definition p4RuntimeSerializer.h:55
const ::p4::config::v1::P4Info * p4Info
Definition p4RuntimeSerializer.h:65
const ::p4::v1::WriteRequest * entries
Definition p4RuntimeSerializer.h:68