1#ifndef CONTROL_PLANE_P4INFOAPI_H_
2#define CONTROL_PLANE_P4INFOAPI_H_
6#include "control-plane/p4RuntimeArchHandler.h"
7#include "control-plane/p4RuntimeSerializer.h"
8#include "lib/cstring.h"
10#pragma GCC diagnostic push
11#pragma GCC diagnostic ignored "-Wunused-parameter"
12#pragma GCC diagnostic ignored "-Wpedantic"
13#include "p4/config/v1/p4info.pb.h"
14#pragma GCC diagnostic pop
23auto findP4InfoObject(
const It &first,
const It &last, cstring controlPlaneName) ->
const
24 typename std::iterator_traits<It>::value_type * {
25 using T =
typename std::iterator_traits<It>::value_type;
26 auto desiredObject = std::find_if(
27 first, last, [&](
const T &
object) {
return object.preamble().name() == controlPlaneName; });
28 if (desiredObject == last) {
31 return &*desiredObject;
39auto findP4InfoObject(
const It &first,
const It &last, p4rt_id_t
id) ->
const
40 typename std::iterator_traits<It>::value_type * {
41 using T =
typename std::iterator_traits<It>::value_type;
43 std::find_if(first, last, [&](
const T &
object) {
return object.preamble().id() == id; });
44 if (desiredObject == last) {
47 return &*desiredObject;
57const p4::config::v1::Table *
findP4RuntimeTable(
const p4::config::v1::P4Info &p4Info, p4rt_id_t
id);
82 const p4::config::v1::P4Info &p4Info,
cstring controlPlaneName);
87 const p4::config::v1::P4Info &p4Info, p4rt_id_t
id);
102 const p4::config::v1::P4Info &p4Info,
cstring controlPlaneName);
107 const p4::config::v1::P4Info &p4Info, p4rt_id_t
id);
116const p4::config::v1::Meter *
findP4RuntimeMeter(
const p4::config::v1::P4Info &p4Info, p4rt_id_t
id);
131 const p4::config::v1::P4Info &p4Info,
cstring controlPlaneName);
136 const p4::config::v1::P4Info &p4Info, p4rt_id_t
id);
180std::optional<p4rt_id_t>
getP4RuntimeId(
const p4::config::v1::P4Info &p4Info,
181 const P4RuntimeSymbolType &type,
cstring controlPlaneName);
TODO(antonin): High level goals of the generator go here!!
Definition dpdk/control-plane/bfruntime_arch_handler.h:52
const p4::config::v1::ValueSet * findP4RuntimeValueSet(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:119
const p4::config::v1::Digest * findP4RuntimeDigest(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:140
const p4::config::v1::Extern * findP4RuntimeExtern(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:150
const p4::config::v1::Meter * findP4RuntimeMeter(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:86
const p4::config::v1::DirectMeter * findP4RuntimeDirectMeter(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:96
const p4::config::v1::ActionProfile * findP4RuntimeActionProfile(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:54
const p4::config::v1::Register * findP4RuntimeRegister(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:130
const p4::config::v1::Table * findP4RuntimeTable(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:14
const p4::config::v1::Counter * findP4RuntimeCounter(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:65
const p4::config::v1::MatchField * findP4RuntimeMatchField(const p4::config::v1::Table &p4Table, cstring controlPlaneName)
Definition p4infoApi.cpp:24
const p4::config::v1::Action * findP4RuntimeAction(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:44
const p4::config::v1::DirectCounter * findP4RuntimeDirectCounter(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:75
const p4::config::v1::ControllerPacketMetadata * findP4RuntimeControllerPacketMetadata(const p4::config::v1::P4Info &p4Info, cstring controlPlaneName)
Definition p4infoApi.cpp:107
std::optional< p4rt_id_t > getP4RuntimeId(const p4::config::v1::P4Info &p4Info, const P4RuntimeSymbolType &type, cstring controlPlaneName)
Definition p4infoApi.cpp:170