Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[orchagent, DTel]: report session support to set user vrf #2326

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions orchagent/dtelorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "converter.h"
#include "ipprefix.h"
#include "swssnet.h"
#include "directory.h"
#include "vrforch.h"

using namespace std;
using namespace swss;
Expand All @@ -13,6 +15,7 @@ extern sai_switch_api_t* sai_switch_api;
extern sai_dtel_api_t* sai_dtel_api;
extern sai_object_id_t gVirtualRouterId;
extern sai_object_id_t gSwitchId;
extern Directory<Orch*> gDirectory;

dtelEventLookup_t dTelEventLookup =
{
Expand Down Expand Up @@ -1152,9 +1155,14 @@ void DTelOrch::doDtelReportSessionTableTask(Consumer &consumer)
}
else if (fvField(i) == VRF)
{
rs_attr.id = SAI_DTEL_REPORT_SESSION_ATTR_VIRTUAL_ROUTER_ID;
/* TODO: find a way to convert vrf to oid */
string vrf_name = fvValue(i);
rs_attr.value.oid = gVirtualRouterId;
if (vrf_name != "default")
{
VRFOrch* vrf_orch = gDirectory.get<VRFOrch*>();
rs_attr.value.oid = vrf_orch->getVRFid(vrf_name);
}
rs_attr.id = SAI_DTEL_REPORT_SESSION_ATTR_VIRTUAL_ROUTER_ID;
report_session_attr.push_back(rs_attr);
}
else if (fvField(i) == TRUNCATE_SIZE)
Expand Down