Skip to content

Commit

Permalink
types skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
cthbleachbit committed Apr 20, 2022
1 parent 24364d7 commit eec2c55
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ find_package(PkgConfig REQUIRED)
pkg_check_modules(DPDK REQUIRED libdpdk)
set(DPDK_LIBS "${DPDK_LDFLAGS}")
include_directories(${DPDK_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

# fmt
option(GAPPP_USE_SYSTEM_FMT "Use system fmtlib" ON)
Expand Down
2 changes: 2 additions & 0 deletions cuda-src/l3fwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#define __global__
#endif

#include "types.h"

namespace GAPPP {
namespace l3fwd {
__global__ void VecAdd(float *A, float *B, float *C) {
Expand Down
29 changes: 29 additions & 0 deletions include/types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// Created by cth451 on 22-4-19.
//

#ifndef TYPES_H
#define TYPES_H

#include <vector>
#include <cstdint>

namespace GAPPP {
struct route {
uint32_t network;
uint32_t mask;
uint32_t gateway;
uint16_t out_port;
};

struct routing_table {
std::vector<struct route> routes;
};

struct packet_info {
uint16_t incoming_port;
uint16_t outgoing_port;
};
}

#endif //TYPES_H
2 changes: 1 addition & 1 deletion src/Router.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace GAPPP {
* initialize an ethernet device
* @param port_id Port ID to set up
* @param mem_buf_pool memory buffer to setup
* @return
* @return true if the device is initialized successfully and registered in the ports array
*/
bool dev_probe(uint16_t port_id, struct rte_mempool &mem_buf_pool) noexcept;
};
Expand Down

0 comments on commit eec2c55

Please sign in to comment.