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"
53using namespace literals;
67 const ::p4::config::v1::P4Info *
p4Info;
73 google::protobuf::util::JsonPrintOptions jsonPrintOptions;
77 jsonPrintOptions.add_whitespace =
true;
81 google::protobuf::util::JsonPrintOptions jsonPrintOptions)
85namespace ControlPlaneAPI {
86struct P4RuntimeArchHandlerBuilderIface;
94 void registerArch(
const cstring archName,
140 std::unordered_map<cstring, const ControlPlaneAPI::P4RuntimeArchHandlerBuilderIface *>
141 archHandlerBuilders{};
Definition frontends/common/options.h:30
Public APIs to generate P4Info message. Uses the singleton pattern.
Definition p4RuntimeSerializer.h:90
static cstring resolveArch(const CompilerOptions &options)
Definition p4RuntimeSerializer.cpp:1661
void serializeP4InfoTo(std::ostream *destination, P4RuntimeFormat format) const
Definition p4RuntimeSerializer.cpp:1505
P4RuntimeAPI generateP4Runtime(const IR::P4Program *program, cstring arch)
Definition p4RuntimeSerializer.cpp:1676
void serializeP4RuntimeIfRequired(const IR::P4Program *program, const CompilerOptions &options)
Definition p4RuntimeSerializer.cpp:1582
P4RuntimeAPI generateP4Runtime(const IR::P4Program *program, cstring arch)
Definition p4RuntimeSerializer.cpp:1469
void serializeP4RuntimeIfRequired(const IR::P4Program *program, const CompilerOptions &options)
Definition p4RuntimeSerializer.cpp:1680
void serializeEntriesTo(std::ostream *destination, P4RuntimeFormat format) const
Definition p4RuntimeSerializer.cpp:1526
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:57
const ::p4::config::v1::P4Info * p4Info
Definition p4RuntimeSerializer.h:67
const ::p4::v1::WriteRequest * entries
Definition p4RuntimeSerializer.h:70