lte/gateway/c/session_manager/PipelinedClient.cpp
/**
 * @brief Create a map of Teids -> ActivateFlowsRequest
 * If to_process is empty, create one default_teids -> ActivateFlowsRequest with
 * no rules. For each to_process item, create item.teid -> ActivateFlowsRequest
 * with item.rules
 * @param imsi
 * @param ip_addr
 * @param ipv6_addr
 * @param default_teids
 * @param msisdn
 * @param ambr
 * @param to_process
 * @param origin_type
 * @return magma::ActivateReqByTeids
 */
@brief Create a map of Teids -> ActivateFlowsRequest
If to_process is empty, create one default_teids -> ActivateFlowsRequest with
no rules.
@brief Create a map of Teids - > ActivateFlowsRequest If to_process is empty create one default_teids - > ActivateFlowsRequest with no rules .
magma::ActivateReqByTeids make_activate_req_by_teid(
    const std::string& imsi, const std::string& ip_addr,
    const std::string& ipv6_addr, const magma::Teids default_teids,
    const std::string& msisdn,
    const optional<magma::AggregatedMaximumBitrate>& ambr,
    const magma::RulesToProcess& to_process,
    const magma::RequestOriginType_OriginType origin_type) {
  magma::ActivateReqByTeids activate_req_by_teids;
  if (to_process.empty()) {
    activate_req_by_teids[default_teids] = make_activate_req(
        imsi, ip_addr, ipv6_addr, default_teids, msisdn, ambr, origin_type);
    return activate_req_by_teids;
  }
  for (const magma::RuleToProcess& val : to_process) {
    const magma::Teids& dedicated_teids = val.teids;
    if (activate_req_by_teids.find(dedicated_teids) ==
        activate_req_by_teids.end()) {
      activate_req_by_teids[dedicated_teids] = make_activate_req(
          imsi, ip_addr, ipv6_addr, dedicated_teids, msisdn, ambr, origin_type);
    }
    auto versioned_policy =
        activate_req_by_teids[dedicated_teids].mutable_policies()->Add();
    versioned_policy->set_version(val.version);
    versioned_policy->mutable_rule()->CopyFrom(val.rule);
  }
  return activate_req_by_teids;
}
magma :: ActivateReqByTeids make_activate_req_by_teid ( const std :: string & imsi , const std :: string & ip_addr , const std :: string & ipv6_addr , const magma :: Teids default_teids , const std :: string & msisdn , const optional < magma :: AggregatedMaximumBitrate > & ambr , const magma :: RulesToProcess & to_process , const magma :: RequestOriginType_OriginType origin_type ) { magma :: ActivateReqByTeids activate_req_by_teids ; if ( to_process . empty ( ) ) { activate_req_by_teids [ default_teids ] = make_activate_req ( imsi , ip_addr , ipv6_addr , default_teids , msisdn , ambr , origin_type ) ; return activate_req_by_teids ; } for ( const magma :: RuleToProcess & val : to_process ) { const magma :: Teids & dedicated_teids = val . teids ; if ( activate_req_by_teids . find ( dedicated_teids ) == activate_req_by_teids . end ( ) ) { activate_req_by_teids [ dedicated_teids ] = make_activate_req ( imsi , ip_addr , ipv6_addr , dedicated_teids , msisdn , ambr , origin_type ) ; } auto versioned_policy = activate_req_by_teids [ dedicated_teids ] . mutable_policies ( ) -> Add ( ) ; versioned_policy -> set_version ( val . version ) ; versioned_policy -> mutable_rule ( ) -> CopyFrom ( val . rule ) ; } return activate_req_by_teids ; }
@brief Create a map of Teids -> ActivateFlowsRequest
 If to_process is empty, create one default_teids -> ActivateFlowsRequest with
 no rules.
@brief Create a map of Teids - > ActivateFlowsRequest If to_process is empty create one default_teids - > ActivateFlowsRequest with no rules .
// Send an empty request with the default teid