@@ -852,7 +852,7 @@ shared_ptr<SwitchState> ThriftConfigApplier::run() {
852
852
853
853
{
854
854
LoadBalancerConfigApplier loadBalancerConfigApplier (
855
- orig_->getLoadBalancers (), cfg_->get_loadBalancers ());
855
+ orig_->getLoadBalancers (), cfg_->loadBalancers (). value ());
856
856
auto newLoadBalancers = loadBalancerConfigApplier.updateLoadBalancers (
857
857
generateDeterministicSeed (cfg::LoadBalancerID::ECMP),
858
858
generateDeterministicSeed (cfg::LoadBalancerID::AGGREGATE_PORT));
@@ -1391,9 +1391,9 @@ void ThriftConfigApplier::validateUdfConfig(const UdfConfig& newUdfConfig) {
1391
1391
return ;
1392
1392
}
1393
1393
1394
- for (const auto & loadBalancerConfig : cfg_->get_loadBalancers ()) {
1395
- auto loadBalancerId = loadBalancerConfig.get_id ( );
1396
- auto udfGroups = loadBalancerConfig.get_fieldSelection ().udfGroups ();
1394
+ for (const auto & loadBalancerConfig : cfg_->loadBalancers (). value ()) {
1395
+ auto loadBalancerId = folly::copy ( loadBalancerConfig.id (). value () );
1396
+ auto udfGroups = loadBalancerConfig.fieldSelection (). value ().udfGroups ();
1397
1397
for (auto & udfGroupName : *udfGroups) {
1398
1398
if (udfGroupMap->find (udfGroupName) == udfGroupMap->end ()) {
1399
1399
throw FbossError (
@@ -5457,8 +5457,8 @@ std::shared_ptr<Mirror> ThriftConfigApplier::createMirror(
5457
5457
}
5458
5458
}
5459
5459
5460
- uint8_t dscpMark = mirrorConfig->get_dscp ( );
5461
- bool truncate = mirrorConfig->get_truncate ( );
5460
+ uint8_t dscpMark = folly::copy ( mirrorConfig->dscp (). value () );
5461
+ bool truncate = folly::copy ( mirrorConfig->truncate (). value () );
5462
5462
5463
5463
std::optional<PortDescriptor> egressPortDesc;
5464
5464
if (mirrorEgressPort.has_value ()) {
@@ -5776,19 +5776,19 @@ ThriftConfigApplier::updateStaticMplsRoutes(
5776
5776
for (auto & staticMplsRouteEntry : staticMplsRoutesWithNhops) {
5777
5777
RouteNextHopSet resolvedNextHops{};
5778
5778
// resolve next hops if any next hop is unresolved.
5779
- for (auto nexthop : staticMplsRouteEntry.get_nexthops ()) {
5779
+ for (auto nexthop : staticMplsRouteEntry.nexthops (). value ()) {
5780
5780
auto nhop = util::fromThrift (nexthop);
5781
5781
if (!nhop.labelForwardingAction ()) {
5782
5782
throw FbossError (
5783
5783
" static mpls route for label " ,
5784
- staticMplsRouteEntry.get_ingressLabel ( ),
5784
+ folly::copy ( staticMplsRouteEntry.ingressLabel (). value () ),
5785
5785
" has next hop without label action" );
5786
5786
}
5787
5787
folly::IPAddress nhopAddress (nhop.addr ());
5788
5788
if (nhopAddress.isLinkLocal () && !nhop.isResolved ()) {
5789
5789
throw FbossError (
5790
5790
" static mpls route for label " ,
5791
- staticMplsRouteEntry.get_ingressLabel ( ),
5791
+ folly::copy ( staticMplsRouteEntry.ingressLabel (). value () ),
5792
5792
" has link local next hop without interface" );
5793
5793
}
5794
5794
if (nhop.isResolved () ||
@@ -5804,7 +5804,7 @@ ThriftConfigApplier::updateStaticMplsRoutes(
5804
5804
if (!inftToReach) {
5805
5805
throw FbossError (
5806
5806
" static mpls route for label " ,
5807
- staticMplsRouteEntry.get_ingressLabel ( ),
5807
+ folly::copy ( staticMplsRouteEntry.ingressLabel (). value () ),
5808
5808
" has nexthop " ,
5809
5809
nhopAddress.str (),
5810
5810
" out of interface subnets" );
@@ -5815,10 +5815,11 @@ ThriftConfigApplier::updateStaticMplsRoutes(
5815
5815
nhop.weight (),
5816
5816
nhop.labelForwardingAction ()));
5817
5817
}
5818
- auto entry = labelFib->getNodeIf (staticMplsRouteEntry.get_ingressLabel ());
5818
+ auto entry = labelFib->getNodeIf (
5819
+ folly::copy (staticMplsRouteEntry.ingressLabel ().value ()));
5819
5820
if (!entry) {
5820
5821
auto node = createLabelForwardingEntry (
5821
- staticMplsRouteEntry.get_ingressLabel ( ),
5822
+ folly::copy ( staticMplsRouteEntry.ingressLabel (). value () ),
5822
5823
LabelNextHopEntry::Action::NEXTHOPS,
5823
5824
resolvedNextHops);
5824
5825
MultiLabelForwardingInformationBase::resolve (node);
@@ -5835,10 +5836,11 @@ ThriftConfigApplier::updateStaticMplsRoutes(
5835
5836
}
5836
5837
5837
5838
for (auto & staticMplsRouteEntry : staticMplsRoutesToNull) {
5838
- auto entry = labelFib->getNodeIf (staticMplsRouteEntry.get_ingressLabel ());
5839
+ auto entry = labelFib->getNodeIf (
5840
+ folly::copy (staticMplsRouteEntry.ingressLabel ().value ()));
5839
5841
if (!entry) {
5840
5842
auto node = createLabelForwardingEntry (
5841
- staticMplsRouteEntry.get_ingressLabel ( ),
5843
+ folly::copy ( staticMplsRouteEntry.ingressLabel (). value () ),
5842
5844
LabelNextHopEntry::Action::DROP,
5843
5845
LabelNextHopSet ());
5844
5846
MultiLabelForwardingInformationBase::resolve (node);
@@ -5855,10 +5857,11 @@ ThriftConfigApplier::updateStaticMplsRoutes(
5855
5857
}
5856
5858
5857
5859
for (auto & staticMplsRouteEntry : staticMplsRoutesToCPU) {
5858
- auto entry = labelFib->getNodeIf (staticMplsRouteEntry.get_ingressLabel ());
5860
+ auto entry = labelFib->getNodeIf (
5861
+ folly::copy (staticMplsRouteEntry.ingressLabel ().value ()));
5859
5862
if (!entry) {
5860
5863
auto node = createLabelForwardingEntry (
5861
- staticMplsRouteEntry.get_ingressLabel ( ),
5864
+ folly::copy ( staticMplsRouteEntry.ingressLabel (). value () ),
5862
5865
LabelNextHopEntry::Action::TO_CPU,
5863
5866
LabelNextHopSet ());
5864
5867
MultiLabelForwardingInformationBase::resolve (node);
0 commit comments