Skip to content

Commit b9dd6a7

Browse files
committed
Removed unused part of file
1 parent 32d9412 commit b9dd6a7

2 files changed

Lines changed: 2 additions & 44 deletions

File tree

‎netutils/platforms/lls_linux.cpp‎

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
#include "lls_linux.h"
77
#include "common/NetworkMapper.h"
88

9-
#ifdef __linux__
9+
#if defined(__linux__) && !defined(BUILD_XDP_BACKEND)
1010

1111
std::optional<uint64_t> LowLatSocket::get_mac(uint16_t id) {
1212
return m_mapper->get_mac_by_uid(id);
1313
}
1414

15-
#ifdef __linux__
16-
1715
LowLatSocket::LowLatSocket(uint16_t self_uid, std::shared_ptr<NetworkMapper> mapper) {
1816
m_socket = 0;
1917
m_iface_addr = {};
@@ -78,46 +76,6 @@ IfaceMeta get_iface_meta(const std::string &name) {
7876
return meta;
7977
}
8078

81-
#else
82-
// Embeddable interface that must be private
83-
extern "C" IfaceMeta _fetch_iface_meta(std::string& name);
84-
85-
IfaceMeta get_iface_meta(std::string& name) {
86-
return _fetch_iface_meta(name);
87-
}
88-
89-
LowLatSocket::LowLatSocket(uint16_t self_uid, std::shared_ptr<NetworkMapper> mapper) {
90-
m_socket = 0;
91-
m_self_uid = self_uid;
92-
m_mapper = std::move(mapper);
93-
}
94-
95-
LowLatSocket::~LowLatSocket() {
96-
97-
}
98-
99-
bool LowLatSocket::init_socket(std::string interface, EthProtocol proto) {
100-
IfaceMeta meta = get_iface_meta(interface);
101-
memcpy(m_iface_addr, meta.mac, 6);
102-
103-
memset(m_hdr.h_dest, 0xFF, 6);
104-
memcpy(m_hdr.h_source, meta.mac, 6);
105-
m_hdr.h_proto = htons(proto);
106-
m_self_proto = proto;
107-
108-
return true;
109-
}
110-
111-
int LowLatSocket::send_data_internal(uint8_t *data, size_t size) {
112-
return _send_data(data, size);
113-
}
114-
115-
int LowLatSocket::recv_data_internal(uint8_t *data, size_t size) const {
116-
return _recv_data(data, size, m_self_proto);
117-
}
118-
119-
#endif // __linux__
120-
12179
bool LowLatSocket::format_packet_header(uint8_t *packet_buffer, uint16_t dest_uid, size_t packet_size) {
12280
INT_LLP<1>* llpck = reinterpret_cast<INT_LLP<1> *>(packet_buffer);
12381
llpck->eth_header = m_hdr;

‎netutils/platforms/lls_linux.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef LLSLINUX_H
77
#define LLSLINUX_H
88

9-
#ifdef __linux__
9+
#if defined(__linux__) && !defined(BUILD_XDP_BACKEND)
1010

1111
#include <string>
1212
#include <cstring>

0 commit comments

Comments
 (0)