Commit 2b6454b3 authored by Franck Messaoudi's avatar Franck Messaoudi

Remove: removing unused code

parent 8cffa02f
......@@ -302,7 +302,7 @@ include_directories(${SRC_TOP_DIR}/pfcp)
include_directories(${SRC_TOP_DIR}/udp)
include_directories(${SRC_TOP_DIR}/upf_app)
include_directories(${SRC_TOP_DIR}/upf_app/bpf)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/pdr)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/pdr_and_far)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/include)
include_directories(${SRC_TOP_DIR}/upf_app/app)
include_directories(${SRC_TOP_DIR}/upf_app/interfaces)
......
......@@ -25,7 +25,7 @@ include_directories(${SRC_TOP_DIR}/${MOUNTED_COMMON}/model/common_model.cmake)
include_directories(${SRC_TOP_DIR}/upf_app/bpf)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/include)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/pdr)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/pdr_and_far)
##############################################################
# FAR #
......
......@@ -5,7 +5,6 @@
#include <interfaces/SessionBpf.h>
#include <pfcp/pfcp_session.h>
#include <wrappers/BPFMaps.h>
#include <next_prog_rule_key.h>
#include "logger.hpp"
#include "upf_config.hpp"
......
......@@ -53,12 +53,12 @@ int is_little_endian() {
// strstr(buf.machine, "armv7") || strstr(buf.machine, "aarch64"));
// }
//---------------------------------------------------------------------------------------------------------------
std::ostream& operator<<(
std::ostream& Str, struct next_rule_prog_index_key const& v) {
Str << "TEID: " << v.teid << " SOURCE INTERFACE: " << v.source_value
<< "IPv4 ADDRESS: " << v.ipv4_address;
return Str;
}
// std::ostream& operator<<(
// std::ostream& Str, struct next_rule_prog_index_key const& v) {
// Str << "TEID: " << v.teid << " SOURCE INTERFACE: " << v.source_value
// << "IPv4 ADDRESS: " << v.ipv4_address;
// return Str;
// }
//---------------------------------------------------------------------------------------------------------------
SessionProgramManager::SessionProgramManager() {
......@@ -300,21 +300,21 @@ pfcp_qer_t_ SessionProgramManager::createQer(
//---------------------------------------------------------------------------------------------------------------
// Helper function to initialize the key for the FARProgram
void SessionProgramManager::initializeNextRuleProgIndexKey(
next_rule_prog_index_key& key, uint32_t teid, uint32_t ueIpAddress,
uint8_t sourceInterface) {
__builtin_memset(&key, 0, sizeof(struct next_rule_prog_index_key));
if (likely(is_little_endian())) {
key.teid = htonl(teid);
key.ipv4_address = htonl(ueIpAddress);
} else {
key.teid = teid;
key.ipv4_address = ueIpAddress;
}
key.source_value = sourceInterface;
}
// void SessionProgramManager::initializeNextRuleProgIndexKey(
// next_rule_prog_index_key& key, uint32_t teid, uint32_t ueIpAddress,
// uint8_t sourceInterface) {
// __builtin_memset(&key, 0, sizeof(struct next_rule_prog_index_key));
// if (likely(is_little_endian())) {
// key.teid = htonl(teid);
// key.ipv4_address = htonl(ueIpAddress);
// } else {
// key.teid = teid;
// key.ipv4_address = ueIpAddress;
// }
// key.source_value = sourceInterface;
// }
//---------------------------------------------------------------------------------------------------------------
// Helper function to store Session mapping
......@@ -440,17 +440,17 @@ void SessionProgramManager::updateARPTableForN3(
}
//---------------------------------------------------------------------------------------------------------------
// Helper function to save SEID with FAR program
void SessionProgramManager::saveSeidWithinFARProgram(
uint64_t seid,
std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram,
const next_rule_prog_index_key& key) {
// Map the deployed pipeline to the seid.
// The seid will be used to destroy the pipeline.
mSessionProgramsMap[seid] =
std::make_shared<SessionPrograms>(key, pPFCP_Session_LookupProgram);
addPFCPProgram(seid, pPFCP_Session_LookupProgram);
}
// // Helper function to save SEID with FAR program
// void SessionProgramManager::saveSeidWithinFARProgram(
// uint64_t seid,
// std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram,
// const next_rule_prog_index_key& key) {
// // Map the deployed pipeline to the seid.
// // The seid will be used to destroy the pipeline.
// mSessionProgramsMap[seid] =
// std::make_shared<SessionPrograms>(key, pPFCP_Session_LookupProgram);
// addPFCPProgram(seid, pPFCP_Session_LookupProgram);
// }
//---------------------------------------------------------------------------------------------------------------
uint32_t SessionProgramManager::getGnodebIp(
......@@ -555,7 +555,7 @@ void SessionProgramManager::createPipeline(
pfcp::source_interface_t sourceInterface;
uint16_t pdr_id;
uint32_t far_id;
next_rule_prog_index_key key;
// next_rule_prog_index_key key;
session_id pduSession;
uint64_t seid = session->get_up_seid();
......@@ -870,16 +870,7 @@ void SessionProgramManager::removePipeline(uint64_t seid) {
Logger::upf_app().debug(
"Delete the SessionPrograms object. It will release the pipeline");
auto key = it->second->getKey();
// it->second.reset();
// mSessionProgramsMap.erase(seid);
Logger::upf_app().debug("Clean PDU Session from the entry program's map");
// auto pPFCP_Session_LookupProgram =
// UserPlaneComponent::getInstance().getPFCP_Session_LookupProgram();
// pPFCP_Session_LookupProgram->getNextProgRuleIndexMap()->remove(key);
}
//---------------------------------------------------------------------------------------------------------------
......
......@@ -11,7 +11,6 @@
#include <pfcp/pfcp_far.h>
#include <pfcp/pfcp_pdr.h>
#include <pfcp/pfcp_qer.h>
#include <next_prog_rule_key.h>
#include <session_id.h>
#include <netinet/ether.h>
......@@ -67,9 +66,7 @@ class SessionProgramManager {
std::vector<std::shared_ptr<pfcp::pfcp_qer>> pQer,
std::vector<std::shared_ptr<pfcp::pfcp_pdr>> pdrs,
bool isModification = false, uint32_t teid2 = 0);
void initializeNextRuleProgIndexKey(
next_rule_prog_index_key& key, uint32_t teid, uint32_t ueIpAddress,
uint8_t sourceInterface);
void addPFCPProgram(
uint64_t seid,
std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram);
......@@ -77,13 +74,7 @@ class SessionProgramManager {
std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram,
uint32_t ue_ip_address, uint32_t teid_dl, uint32_t teid_ul,
uint64_t seid);
void storeFARInFARMap(
std::shared_ptr<FARProgram> pFARProgram,
std::shared_ptr<pfcp::pfcp_far> pFar);
void saveSeidWithinFARProgram(
uint64_t seid,
std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram,
const next_rule_prog_index_key& key);
void updateARPTableForN6(
std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram,
uint32_t dnIP, uint32_t upfn6IP);
......
......@@ -2,20 +2,15 @@
//---------------------------------------------------------------------------------------------------------------
SessionPrograms::SessionPrograms(
struct next_rule_prog_index_key key,
// struct next_rule_prog_index_key key,
std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram)
: mKey(key), mpPFCP_Session_LookupProgram(pPFCP_Session_LookupProgram) {}
: mpPFCP_Session_LookupProgram(pPFCP_Session_LookupProgram) {}
//---------------------------------------------------------------------------------------------------------------
SessionPrograms::~SessionPrograms() {
mpPFCP_Session_LookupProgram->tearDown();
}
//---------------------------------------------------------------------------------------------------------------
struct next_rule_prog_index_key SessionPrograms::getKey() const {
return mKey;
}
//---------------------------------------------------------------------------------------------------------------
std::shared_ptr<PFCP_Session_LookupProgram> SessionPrograms::getPFCPProgram()
const {
......
......@@ -4,7 +4,6 @@
#include <memory>
#include <pfcp_session_lookup_xdp_user.h>
#include <unistd.h>
#include <next_prog_rule_key.h>
/**
* @brief This class represents the Data-Path path. It stores the program
......@@ -15,15 +14,12 @@
class SessionPrograms {
public:
SessionPrograms(
struct next_rule_prog_index_key key,
std::shared_ptr<PFCP_Session_LookupProgram> pPFCP_Session_LookupProgram);
virtual ~SessionPrograms();
struct next_rule_prog_index_key getKey() const;
std::shared_ptr<PFCP_Session_LookupProgram> getPFCPProgram() const;
private:
std::shared_ptr<PFCP_Session_LookupProgram> mpPFCP_Session_LookupProgram;
struct next_rule_prog_index_key mKey;
};
#endif // __SESSIONPROGRAMS_H__
......@@ -3,7 +3,7 @@ include_directories(${SRC_TOP_DIR}/upf_app)
include_directories(${SRC_TOP_DIR}/upf_app/bpf)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/include)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/pdr)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/pdr_and_far)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/far)
include_directories(${SRC_TOP_DIR}/upf_app/bpf/rules/qer)
include_directories(${SRC_TOP_DIR}/upf_app/include)
......@@ -22,9 +22,9 @@ add_custom_target(upf_xdp_all DEPENDS pfcp_session_lookup_xdp)
###########################################################################
function(xdp arg)
if (${arg} STREQUAL "pfcp_session_lookup")
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/rules/pdr")
elseif (${arg} STREQUAL "far")
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/rules/far")
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/rules/pdr_and_far")
#elseif (${arg} STREQUAL "far")
# set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/rules/far")
else()
message(FATAL_ERROR "Invalid arg: ${arg}")
endif()
......
#ifndef __NEXT_PROG_RULE_KEY_H__
#define __NEXT_PROG_RULE_KEY_H__
#include <ie/teid.h>
#include <types.h>
struct next_rule_prog_index_key {
teid_t_ teid;
u8 source_value;
u32 ipv4_address;
};
#endif // __NEXT_PROG_RULE_KEY_H__
......@@ -8,7 +8,6 @@
#include <linux/bpf.h>
#include <stdint.h>
#include <ie/teid.h>
#include <next_prog_rule_key.h>
#include <rules_matching_pdr.h>
#include "interfaces.h"
#include "session_id.h"
......
......@@ -25,8 +25,8 @@
#include <utils/logger.h>
#include <utils/utils.h>
#include <next_prog_rule_key.h>
#include <framed_routing_bpf.h>
//#include <next_prog_rule_key.h>
#include "framed_routing_bpf.h"
#include "xdp_stats_kern.h"
#include <linux/bpf.h>
......
......@@ -34,7 +34,7 @@
#include "upf_config.hpp"
#include "upf_pfcp_association.hpp"
#include "simple_switch.hpp"
#include "../bpf/rules/pdr/framed_routing_bpf.h"
#include "../bpf/rules/pdr_and_far/framed_routing_bpf.h"
#include <algorithm>
#include <fstream> // std::ifstream
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment