lte/gateway/c/session_manager/PipelinedClient.cpp
/**
 * @brief Create a map of Teids -> DeactivateFlowsRequest
 * If to_process is empty, create one default_teids -> DeactivateFlowsRequest
 * with no rules. For each to_process item, create item.teid ->
 * DeactivateFlowsRequest with item.rules
 * @param imsi
 * @param ip_addr
 * @param ipv6_addr
 * @param default_teids this value is only used if to_process is empty
 * @param to_process
 * @param origin_type
 * @param remove_default_drop_rules
 * @return magma::DeactivateReqByTeids
 */
@brief Create a map of Teids -> DeactivateFlowsRequest
If to_process is empty, create one default_teids -> DeactivateFlowsRequest
with no rules.
@brief Create a map of Teids - > DeactivateFlowsRequest If to_process is empty create one default_teids - > DeactivateFlowsRequest with no rules .
magma::DeactivateReqByTeids make_deactivate_req_by_teid(
    const std::string& imsi, const std::string& ip_addr,
    const std::string& ipv6_addr, const magma::Teids default_teids,
    const magma::RulesToProcess& to_process,
    const magma::RequestOriginType_OriginType origin_type,
    const bool remove_default_drop_rules) {
  magma::DeactivateReqByTeids deactivate_req_by_teids;
  if (to_process.empty()) {
    deactivate_req_by_teids[default_teids] =
        make_deactivate_req(imsi, ip_addr, ipv6_addr, default_teids,
                            origin_type, remove_default_drop_rules);
    return deactivate_req_by_teids;
  }
  for (const magma::RuleToProcess& val : to_process) {
    const magma::Teids& dedicated_teids = val.teids;
    if (deactivate_req_by_teids.find(dedicated_teids) ==
        deactivate_req_by_teids.end()) {
      deactivate_req_by_teids[dedicated_teids] =
          make_deactivate_req(imsi, ip_addr, ipv6_addr, dedicated_teids,
                              origin_type, remove_default_drop_rules);
    }
    auto versioned_policy =
        deactivate_req_by_teids[dedicated_teids].mutable_policies()->Add();
    versioned_policy->set_version(val.version);
    versioned_policy->set_rule_id(val.rule.id());
  }
  return deactivate_req_by_teids;
}
magma :: DeactivateReqByTeids make_deactivate_req_by_teid ( const std :: string & imsi , const std :: string & ip_addr , const std :: string & ipv6_addr , const magma :: Teids default_teids , const magma :: RulesToProcess & to_process , const magma :: RequestOriginType_OriginType origin_type , const bool remove_default_drop_rules ) { magma :: DeactivateReqByTeids deactivate_req_by_teids ; if ( to_process . empty ( ) ) { deactivate_req_by_teids [ default_teids ] = make_deactivate_req ( imsi , ip_addr , ipv6_addr , default_teids , origin_type , remove_default_drop_rules ) ; return deactivate_req_by_teids ; } for ( const magma :: RuleToProcess & val : to_process ) { const magma :: Teids & dedicated_teids = val . teids ; if ( deactivate_req_by_teids . find ( dedicated_teids ) == deactivate_req_by_teids . end ( ) ) { deactivate_req_by_teids [ dedicated_teids ] = make_deactivate_req ( imsi , ip_addr , ipv6_addr , dedicated_teids , origin_type , remove_default_drop_rules ) ; } auto versioned_policy = deactivate_req_by_teids [ dedicated_teids ] . mutable_policies ( ) -> Add ( ) ; versioned_policy -> set_version ( val . version ) ; versioned_policy -> set_rule_id ( val . rule . id ( ) ) ; } return deactivate_req_by_teids ; }
@brief Create a map of Teids -> DeactivateFlowsRequest
 If to_process is empty, create one default_teids -> DeactivateFlowsRequest
 with no rules.
@brief Create a map of Teids - > DeactivateFlowsRequest If to_process is empty create one default_teids - > DeactivateFlowsRequest with no rules .
// Send an empty request with the default teid