gitlab-ci: add build stage

Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
This commit is contained in:
Tucker Polomik
2023-06-15 13:27:07 -06:00
parent 3431101306
commit a7469568c4
6 changed files with 27 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ workflow:
stages:
- static_analysis
- unit_tests
- build
clang-format:
stage: static_analysis
@@ -44,3 +45,19 @@ googletest:
- make
- find . -maxdepth 1 -type f -executable -exec {} \;
allow_failure: false
check_build:
stage: build
before_script:
- apt-get update
- apt-get install -y git make cmake libnl-3-dev libnl-genl-3-dev libpcap-dev
script:
- git clone https://github.com/radiotap/radiotap-library.git
- cd radiotap-library
- mkdir -p .build
- cd .build
- cmake ..
- make -j && make install
- cd ../..
- make -j
allow_failure: false

View File

@@ -28,6 +28,7 @@ public:
*/
virtual void close();
protected:
/**
* @brief Send an NL message to the kernel and get a response.
*

View File

@@ -37,9 +37,9 @@ bool nl80211_socket::connect()
return result;
}
bool nl80211_socket::send_receive_msg(int command, int flags,
std::function<bool(struct nl_msg *msg)> msg_create,
std::function<void(struct nl_msg *msg)> msg_handle)
bool nl80211_socket::send_receive_msg_wrapper(int command, int flags,
std::function<bool(struct nl_msg *msg)> msg_create,
std::function<void(struct nl_msg *msg)> msg_handle)
{
return netlink_socket::send_receive_msg(
[&](struct nl_msg *msg) -> bool {

View File

@@ -9,7 +9,7 @@ public:
explicit nl80211_socket(int proto);
virtual bool connect() override;
virtual bool send_receive_msg(int command, int flags,
std::function<bool(struct nl_msg *msg)> msg_create,
std::function<void(struct nl_msg *msg)> msg_handle);
virtual bool send_receive_msg_wrapper(int command, int flags,
std::function<bool(struct nl_msg *msg)> msg_create,
std::function<void(struct nl_msg *msg)> msg_handle);
};

View File

@@ -62,7 +62,7 @@ bool nl80211_client_impl::get_interface_info(const std::string &ifname, if_info
return false;
}
return m_socket->send_receive_msg(
return m_socket->send_receive_msg_wrapper(
NL80211_CMD_GET_INTERFACE, 0,
[&](struct nl_msg *msg) -> bool {
nla_put_u32(msg, NL80211_ATTR_IFINDEX, if_idx);
@@ -96,7 +96,7 @@ bool nl80211_client_impl::get_interface_info(const std::string &ifname, if_info
bool nl80211_client_impl::get_wiphy_bandwidth(if_info &info)
{
return m_socket->send_receive_msg(
return m_socket->send_receive_msg_wrapper(
NL80211_CMD_GET_INTERFACE, NLM_F_DUMP, [](struct nl_msg *msg) -> bool { return true; },
[&](struct nl_msg *msg) {
if (info.bandwidth) {

View File

@@ -1,6 +1,7 @@
#pragma once
#include "nl80211_socket.h"
#include <array>
#include <cstdint>
#include <string>
#include <vector>