Commit 2fbb8947 authored by gauthier's avatar gauthier

gtpv1u prepare for ECHO_RESPONSE

parent f13fe527
...@@ -44,11 +44,23 @@ public: ...@@ -44,11 +44,23 @@ public:
l_endpoint = {}; l_endpoint = {};
l_endpoint_addr_len = sizeof(l_endpoint); l_endpoint_addr_len = sizeof(l_endpoint);
r_endpoint = {}; r_endpoint = {};
l_endpoint_addr_len = sizeof(r_endpoint); r_endpoint_addr_len = sizeof(r_endpoint);
teid = UNASSIGNED_TEID; teid = UNASSIGNED_TEID;
gtpu_tx_id = 0; gtpu_tx_id = 0;
} }
itti_s1u_msg& operator=(itti_s1u_msg other)
{
this->itti_msg::operator=(other);
std::swap(l_endpoint, other.l_endpoint);
std::swap(l_endpoint_addr_len, other.l_endpoint_addr_len);
std::swap(r_endpoint, other.r_endpoint);
std::swap(r_endpoint_addr_len, other.r_endpoint_addr_len);
std::swap(teid, other.teid);
std::swap(gtpu_tx_id, other.gtpu_tx_id);
return *this;
}
itti_s1u_msg(const itti_s1u_msg& i) : itti_msg(i) { itti_s1u_msg(const itti_s1u_msg& i) : itti_msg(i) {
l_endpoint = i.l_endpoint; l_endpoint = i.l_endpoint;
l_endpoint_addr_len = i.l_endpoint_addr_len; l_endpoint_addr_len = i.l_endpoint_addr_len;
...@@ -76,9 +88,15 @@ public: ...@@ -76,9 +88,15 @@ public:
itti_s1u_echo_request(const task_id_t orig, const task_id_t dest): itti_s1u_echo_request(const task_id_t orig, const task_id_t dest):
itti_s1u_msg(S1U_ECHO_REQUEST, orig, dest) { itti_s1u_msg(S1U_ECHO_REQUEST, orig, dest) {
} }
itti_s1u_echo_request(const itti_s1u_echo_request& i) : itti_s1u_msg(i) { explicit itti_s1u_echo_request(const itti_s1u_echo_request& i) : itti_s1u_msg(i) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
} }
itti_s1u_echo_request& operator=(itti_s1u_echo_request other)
{
this->itti_s1u_msg::operator=(other);
std::swap(gtp_ies, other.gtp_ies);
return *this;
}
itti_s1u_echo_request(const itti_s1u_echo_request& i, const task_id_t orig, const task_id_t dest) : itti_s1u_echo_request(const itti_s1u_echo_request& i, const task_id_t orig, const task_id_t dest) :
itti_s1u_msg(i, orig, dest) { itti_s1u_msg(i, orig, dest) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
...@@ -93,9 +111,15 @@ public: ...@@ -93,9 +111,15 @@ public:
itti_s1u_echo_response(const task_id_t orig, const task_id_t dest): itti_s1u_echo_response(const task_id_t orig, const task_id_t dest):
itti_s1u_msg(S1U_ECHO_RESPONSE, orig, dest) { itti_s1u_msg(S1U_ECHO_RESPONSE, orig, dest) {
} }
itti_s1u_echo_response(const itti_s1u_echo_response& i) : itti_s1u_msg(i) { explicit itti_s1u_echo_response(const itti_s1u_echo_response& i) : itti_s1u_msg(i) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
} }
itti_s1u_echo_response& operator=(itti_s1u_echo_response other)
{
this->itti_s1u_msg::operator=(other);
std::swap(gtp_ies, other.gtp_ies);
return *this;
}
itti_s1u_echo_response(const itti_s1u_echo_response& i, const task_id_t orig, const task_id_t dest) : itti_s1u_echo_response(const itti_s1u_echo_response& i, const task_id_t orig, const task_id_t dest) :
itti_s1u_msg(i, orig, dest) { itti_s1u_msg(i, orig, dest) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
...@@ -110,9 +134,15 @@ public: ...@@ -110,9 +134,15 @@ public:
itti_s1u_error_indication(const task_id_t orig, const task_id_t dest): itti_s1u_error_indication(const task_id_t orig, const task_id_t dest):
itti_s1u_msg(S1U_ERROR_INDICATION, orig, dest) { itti_s1u_msg(S1U_ERROR_INDICATION, orig, dest) {
} }
itti_s1u_error_indication(const itti_s1u_error_indication& i) : itti_s1u_msg(i) { explicit itti_s1u_error_indication(const itti_s1u_error_indication& i) : itti_s1u_msg(i) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
} }
itti_s1u_error_indication& operator=(itti_s1u_error_indication other)
{
this->itti_s1u_msg::operator=(other);
std::swap(gtp_ies, other.gtp_ies);
return *this;
}
itti_s1u_error_indication(const itti_s1u_error_indication& i, const task_id_t orig, const task_id_t dest) : itti_s1u_error_indication(const itti_s1u_error_indication& i, const task_id_t orig, const task_id_t dest) :
itti_s1u_msg(i, orig, dest) { itti_s1u_msg(i, orig, dest) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
...@@ -127,9 +157,15 @@ public: ...@@ -127,9 +157,15 @@ public:
itti_s1u_supported_extension_headers_notification(const task_id_t orig, const task_id_t dest): itti_s1u_supported_extension_headers_notification(const task_id_t orig, const task_id_t dest):
itti_s1u_msg(S1U_SUPPORTED_EXTENSION_HEADERS_NOTIFICATION, orig, dest) { itti_s1u_msg(S1U_SUPPORTED_EXTENSION_HEADERS_NOTIFICATION, orig, dest) {
} }
itti_s1u_supported_extension_headers_notification(const itti_s1u_supported_extension_headers_notification& i) : itti_s1u_msg(i) { explicit itti_s1u_supported_extension_headers_notification(const itti_s1u_supported_extension_headers_notification& i) : itti_s1u_msg(i) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
} }
itti_s1u_supported_extension_headers_notification& operator=(itti_s1u_supported_extension_headers_notification other)
{
this->itti_s1u_msg::operator=(other);
std::swap(gtp_ies, other.gtp_ies);
return *this;
}
itti_s1u_supported_extension_headers_notification(const itti_s1u_supported_extension_headers_notification& i, const task_id_t orig, const task_id_t dest) : itti_s1u_supported_extension_headers_notification(const itti_s1u_supported_extension_headers_notification& i, const task_id_t orig, const task_id_t dest) :
itti_s1u_msg(i, orig, dest) { itti_s1u_msg(i, orig, dest) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
...@@ -144,9 +180,17 @@ public: ...@@ -144,9 +180,17 @@ public:
itti_s1u_end_marker(const task_id_t orig, const task_id_t dest): itti_s1u_end_marker(const task_id_t orig, const task_id_t dest):
itti_s1u_msg(S1U_END_MARKER, orig, dest) { itti_s1u_msg(S1U_END_MARKER, orig, dest) {
} }
itti_s1u_end_marker(const itti_s1u_end_marker& i) : itti_s1u_msg(i) { explicit itti_s1u_end_marker(const itti_s1u_end_marker& i) : itti_s1u_msg(i) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
} }
itti_s1u_end_marker& operator=(itti_s1u_end_marker other)
{
this->itti_s1u_msg::operator=(other);
std::swap(gtp_ies, other.gtp_ies);
return *this;
}
itti_s1u_end_marker(const itti_s1u_end_marker& i, const task_id_t orig, const task_id_t dest) : itti_s1u_end_marker(const itti_s1u_end_marker& i, const task_id_t orig, const task_id_t dest) :
itti_s1u_msg(i, orig, dest) { itti_s1u_msg(i, orig, dest) {
gtp_ies = i.gtp_ies; gtp_ies = i.gtp_ies;
......
...@@ -219,6 +219,18 @@ public: ...@@ -219,6 +219,18 @@ public:
next_extension_header_type = h.next_extension_header_type; next_extension_header_type = h.next_extension_header_type;
} }
gtpv1u_msg_header& operator=(gtpv1u_msg_header other)
{
std::swap(u1, other.u1);
std::swap(message_type, other.message_type);
std::swap(message_length, other.message_length);
std::swap(teid, other.teid);
std::swap(sequence_number, other.sequence_number);
std::swap(npdu_number, other.npdu_number);
std::swap(next_extension_header_type, other.next_extension_header_type);
return *this;
}
void set_teid(const uint32_t& tid) { void set_teid(const uint32_t& tid) {
teid = tid; teid = tid;
} }
...@@ -297,6 +309,13 @@ public: ...@@ -297,6 +309,13 @@ public:
remote_port(m.remote_port), remote_port(m.remote_port),
ies(m.ies) {} ies(m.ies) {}
gtpv1u_msg& operator=(gtpv1u_msg other)
{
std::swap(remote_port, other.remote_port);
std::swap(ies, other.ies);
return *this;
}
explicit gtpv1u_msg(const gtpv1u_msg_header& hdr) : gtpv1u_msg_header(hdr), remote_port(0), ies() {} explicit gtpv1u_msg(const gtpv1u_msg_header& hdr) : gtpv1u_msg_header(hdr), remote_port(0), ies() {}
explicit gtpv1u_msg(const gtpv1u_echo_request& gtp_ies); explicit gtpv1u_msg(const gtpv1u_echo_request& gtp_ies);
......
...@@ -65,7 +65,11 @@ public: ...@@ -65,7 +65,11 @@ public:
gtpv1u_echo_request(): private_extension() {} gtpv1u_echo_request(): private_extension() {}
gtpv1u_echo_request(const gtpv1u_echo_request& i) : private_extension(i.private_extension) {} gtpv1u_echo_request(const gtpv1u_echo_request& i) : private_extension(i.private_extension) {}
gtpv1u_echo_request& operator=(gtpv1u_echo_request other)
{
std::swap(private_extension, other.private_extension);
return *this;
}
static const char* get_msg_name() {return "GTPU_ECHO_REQUEST";}; static const char* get_msg_name() {return "GTPU_ECHO_REQUEST";};
bool get(core::private_extension_t& v) const {if (private_extension.first) {v = private_extension.second;return true;}return false;} bool get(core::private_extension_t& v) const {if (private_extension.first) {v = private_extension.second;return true;}return false;}
...@@ -86,6 +90,13 @@ public: ...@@ -86,6 +90,13 @@ public:
gtpv1u_echo_response(const gtpv1u_echo_response& i): recovery(i.recovery), private_extension(i.private_extension) {} gtpv1u_echo_response(const gtpv1u_echo_response& i): recovery(i.recovery), private_extension(i.private_extension) {}
static const char* get_msg_name() {return "GTPU_ECHO_RESPONSE";}; static const char* get_msg_name() {return "GTPU_ECHO_RESPONSE";};
gtpv1u_echo_response& operator=(gtpv1u_echo_response other)
{
std::swap(recovery, other.recovery);
std::swap(private_extension, other.private_extension);
return *this;
}
bool get(core::recovery_t& v) const {if (recovery.first) {v = recovery.second;return true;}return false;} bool get(core::recovery_t& v) const {if (recovery.first) {v = recovery.second;return true;}return false;}
bool get(core::private_extension_t& v) const {if (private_extension.first) {v = private_extension.second;return true;}return false;} bool get(core::private_extension_t& v) const {if (private_extension.first) {v = private_extension.second;return true;}return false;}
...@@ -110,6 +121,14 @@ public: ...@@ -110,6 +121,14 @@ public:
gtp_u_peer_address(i.gtp_u_peer_address), gtp_u_peer_address(i.gtp_u_peer_address),
private_extension(i.private_extension) {} private_extension(i.private_extension) {}
gtpv1u_error_indication& operator=(gtpv1u_error_indication other)
{
std::swap(tunnel_endpoint_identifier_data_i, other.tunnel_endpoint_identifier_data_i);
std::swap(gtp_u_peer_address, other.gtp_u_peer_address);
std::swap(private_extension, other.private_extension);
return *this;
}
static const char* get_msg_name() {return "GTPU_ERROR_INDICATION";}; static const char* get_msg_name() {return "GTPU_ERROR_INDICATION";};
bool get(core::tunnel_endpoint_identifier_data_i_t& v) const {if (tunnel_endpoint_identifier_data_i.first) {v = tunnel_endpoint_identifier_data_i.second;return true;}return false;} bool get(core::tunnel_endpoint_identifier_data_i_t& v) const {if (tunnel_endpoint_identifier_data_i.first) {v = tunnel_endpoint_identifier_data_i.second;return true;}return false;}
...@@ -133,6 +152,12 @@ public: ...@@ -133,6 +152,12 @@ public:
gtpv1u_supported_extension_headers_notification(const gtpv1u_supported_extension_headers_notification& i) : gtpv1u_supported_extension_headers_notification(const gtpv1u_supported_extension_headers_notification& i) :
extension_header_type_list(i.extension_header_type_list) {} extension_header_type_list(i.extension_header_type_list) {}
gtpv1u_supported_extension_headers_notification& operator=(gtpv1u_supported_extension_headers_notification other)
{
std::swap(extension_header_type_list, other.extension_header_type_list);
return *this;
}
static const char* get_msg_name() {return "GTPU_SUPPORTED_EXTENSION_HEADERS_NOTIFICATION";}; static const char* get_msg_name() {return "GTPU_SUPPORTED_EXTENSION_HEADERS_NOTIFICATION";};
bool get(core::extension_header_type_list_t& v) const {if (extension_header_type_list.first) {v = extension_header_type_list.second;return true;}return false;} bool get(core::extension_header_type_list_t& v) const {if (extension_header_type_list.first) {v = extension_header_type_list.second;return true;}return false;}
...@@ -150,9 +175,15 @@ public: ...@@ -150,9 +175,15 @@ public:
gtpv1u_end_marker() : gtpv1u_end_marker() :
private_extension() {} private_extension() {}
explicit gtpv1u_end_marker(const gtpv1u_error_indication& i) : gtpv1u_end_marker(const gtpv1u_end_marker& i) :
private_extension(i.private_extension) {} private_extension(i.private_extension) {}
gtpv1u_end_marker& operator=(gtpv1u_end_marker other)
{
std::swap(private_extension, other.private_extension);
return *this;
}
static const char* get_msg_name() {return "GTPU_END_MARKER";}; static const char* get_msg_name() {return "GTPU_END_MARKER";};
bool get(core::private_extension_t& v) const {if (private_extension.first) {v = private_extension.second;return true;}return false;} bool get(core::private_extension_t& v) const {if (private_extension.first) {v = private_extension.second;return true;}return false;}
......
...@@ -156,6 +156,16 @@ public: ...@@ -156,6 +156,16 @@ public:
itti_msg(); itti_msg();
itti_msg(const itti_msg_type_t msg_type, const task_id_t origin, const task_id_t destination); itti_msg(const itti_msg_type_t msg_type, const task_id_t origin, const task_id_t destination);
itti_msg(const itti_msg& i); itti_msg(const itti_msg& i);
itti_msg& operator=(itti_msg other)
{
std::swap(msg_num, other.msg_num);
std::swap(origin, other.origin);
std::swap(destination, other.destination);
std::swap(msg_type, other.msg_type);
return *this;
}
virtual ~itti_msg() = default; virtual ~itti_msg() = default;
static const char* get_msg_name(); static const char* get_msg_name();
......
...@@ -283,6 +283,7 @@ include_directories(${SRC_TOP_DIR}/common) ...@@ -283,6 +283,7 @@ include_directories(${SRC_TOP_DIR}/common)
include_directories(${SRC_TOP_DIR}/itti) include_directories(${SRC_TOP_DIR}/itti)
include_directories(${SRC_TOP_DIR}/common/msg) include_directories(${SRC_TOP_DIR}/common/msg)
include_directories(${SRC_TOP_DIR}/common/utils) include_directories(${SRC_TOP_DIR}/common/utils)
include_directories(${SRC_TOP_DIR}/gtpv1u)
include_directories(${SRC_TOP_DIR}/pfcp) include_directories(${SRC_TOP_DIR}/pfcp)
include_directories(${SRC_TOP_DIR}/spgwu) include_directories(${SRC_TOP_DIR}/spgwu)
include_directories(${SRC_TOP_DIR}/spgwu/simpleswitch) include_directories(${SRC_TOP_DIR}/spgwu/simpleswitch)
......
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