LCOV - code coverage report
Current view: top level - vnsw/agent/kstate - mpls_kstate.cc (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 0 33 0.0 %
Date: 2026-06-11 01:56:02 Functions: 0 4 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #include "kstate.h"
       6             : #include "mpls_kstate.h"
       7             : 
       8           0 : MplsKState::MplsKState(KMplsResp *obj, const std::string &resp_ctx,
       9           0 :                        vr_mpls_req &req, int id) : KState(resp_ctx, obj) {
      10           0 :     req.set_mr_label(id);
      11           0 :     if (id >= 0) {
      12           0 :         req.set_h_op(sandesh_op::GET);
      13             :     } else {
      14           0 :         req.set_h_op(sandesh_op::DUMP);
      15           0 :         req.set_mr_marker(-1);
      16             :     }
      17           0 : }
      18             : 
      19           0 : void MplsKState::SendNextRequest() {
      20           0 :     vr_mpls_req req;
      21           0 :     req.set_h_op(sandesh_op::DUMP);
      22           0 :     req.set_mr_label(0);
      23           0 :     int32_t label = boost::any_cast<int32_t>(more_context_);
      24           0 :     req.set_mr_marker(label);
      25           0 :     EncodeAndSend(req);
      26           0 : }
      27             : 
      28           0 : void MplsKState::Handler() {
      29           0 :     KMplsResp *resp = static_cast<KMplsResp *>(response_object_);
      30           0 :     if (resp) {
      31           0 :         if (MoreData()) {
      32             :             /* There are more labels in Kernel. We need to query them from
      33             :              * Kernel and send it to Sandesh.
      34             :              */
      35           0 :             SendResponse();
      36           0 :             SendNextRequest();
      37             :         } else {
      38           0 :             resp->set_context(response_context_);
      39           0 :             resp->Response();
      40           0 :             more_context_ = boost::any();
      41             :         }
      42             :     }
      43           0 : }
      44             : 
      45           0 : void MplsKState::SendResponse() {
      46             : 
      47           0 :     KMplsResp *resp = static_cast<KMplsResp *>(response_object_);
      48           0 :     resp->set_context(response_context_);
      49           0 :     resp->set_more(true);
      50           0 :     resp->Response();
      51             : 
      52           0 :     response_object_ = new KMplsResp();
      53           0 : }

Generated by: LCOV version 1.14