Skip to content

Commit

Permalink
fix recursive call and use common config
Browse files Browse the repository at this point in the history
  • Loading branch information
suhrm committed Aug 15, 2024
1 parent c7fa7a4 commit 1fc635a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions apps/app/tunnel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ int main(int argc, char** argv)
if (mode == "tun")
{
tunnel::tun_interface iface1;
iface1.create({});
iface1.set_log_callback(log1);
iface1.monitor().enable_log();
iface1.create({});
iface1.set_ipv4(tunnel_address);
iface1.set_ipv4_netmask("255.255.255.0");
iface1.set_mtu(1500);
Expand All @@ -165,9 +165,9 @@ int main(int argc, char** argv)
else if (mode == "tap")
{
tunnel::tap_interface iface1;
iface1.create({});
iface1.set_log_callback(log1);
iface1.monitor().enable_log();
iface1.create({});
iface1.set_ipv4(tunnel_address);
iface1.set_ipv4_netmask("255.255.255.0");
iface1.set_mtu(1500);
Expand Down
2 changes: 1 addition & 1 deletion src/tunnel/tap_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void tap_interface::create(const config& config)
void tap_interface::create(const config& config, std::error_code& error)
{
assert(m_impl);
create(config, error);
m_impl->create(config, error);

Check failure on line 69 in src/tunnel/tap_interface.cpp

View workflow job for this annotation

GitHub Actions / Apple Big Sur (ARM)

too few arguments to function call, expected 3, have 2
}

void tap_interface::rename(const std::string& interface_name) const
Expand Down
14 changes: 1 addition & 13 deletions src/tunnel/tap_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@
#include <system_error>

#include "monitor.hpp"
#include "interface_config.hpp"

namespace tunnel
{
class tap_interface
{
public:
struct config
{
/// The name of the interface
std::string m_interface_name;

/// If true the interface will be created with Virtual Network
/// Device Header enabled.
bool m_vnet_hdr = false;

/// If true the interface will be created with IFF_NO_PI enabled.
bool m_iff_no_pi = false;
};

public:
/// Constructor
Expand Down

0 comments on commit 1fc635a

Please sign in to comment.