LCOV - code coverage report
Current view: top level - vnsw/agent/kstate - vrf_assign_kstate.cc (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 0 37 0.0 %
Date: 2026-11-09 02:10:49 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             :  * Copyright Contributors to the OpenSDN project
       4             :  */
       5             : 
       6             : #include "kstate.h"
       7             : #include "vrf_assign_kstate.h"
       8             : 
       9           0 : VrfAssignKState::VrfAssignKState(KVrfAssignResp *obj,
      10             :                                  const std::string &resp_ctx,
      11           0 :                                  vr_vrf_assign_req &req, int id) :
      12           0 :     KState(resp_ctx, obj) {
      13             : 
      14           0 :     req.set_h_op(sandesh_op::DUMP);
      15           0 :     req.set_var_vif_index(id);
      16           0 :     req.set_var_marker(-1);
      17           0 : }
      18             : 
      19           0 : void VrfAssignKState::SendNextRequest() {
      20           0 :     VrfAssignContext *ctx = boost::any_cast<VrfAssignContext *>(more_context_);
      21           0 :     vr_vrf_assign_req req;
      22             : 
      23           0 :     req.set_h_op(sandesh_op::DUMP);
      24           0 :     req.set_var_vif_index(ctx->vif_index_);
      25           0 :     req.set_var_vlan_id(ctx->marker_);
      26           0 :     req.set_var_marker(ctx->marker_);
      27           0 :     EncodeAndSend(req);
      28           0 : }
      29             : 
      30           0 : void VrfAssignKState::Handler() {
      31           0 :     KVrfAssignResp *resp = static_cast<KVrfAssignResp *>(response_object_);
      32           0 :     if (resp) {
      33           0 :         if (MoreData()) {
      34             :             /* There are more labels in Kernel. We need to query them from
      35             :              * Kernel and send it to Sandesh.
      36             :              */
      37           0 :             SendResponse();
      38           0 :             SendNextRequest();
      39             :         } else {
      40           0 :             resp->set_context(response_context_);
      41           0 :             resp->Response();
      42           0 :             if (!more_context_.empty()) {
      43             :                 VrfAssignContext *ctx =
      44           0 :                     boost::any_cast<VrfAssignContext *>(more_context_);
      45           0 :                 if (ctx) {
      46           0 :                     delete ctx;
      47           0 :                     more_context_ = boost::any();
      48             :                 }
      49             :             }
      50             :         }
      51             :     }
      52           0 : }
      53             : 
      54           0 : void VrfAssignKState::SendResponse() {
      55           0 :     KVrfAssignResp *resp = static_cast<KVrfAssignResp *>(response_object_);
      56           0 :     resp->set_context(response_context_);
      57           0 :     resp->set_more(true);
      58           0 :     resp->Response();
      59             : 
      60           0 :     response_object_ = new KVrfAssignResp();
      61           0 : }

Generated by: LCOV version 1.14