summaryrefslogtreecommitdiff
path: root/src/LwipLinuxTap.cpp
blob: 68fc876bd4f718f367bb2e661bf10e76e61bfe9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "lwip/netif.h"
#include "lwip/ip_addr.h"
#include "lwip/tcpip.h"
extern "C" {
#include "netif/tapif.h"
}

static netif default_network_interface;

void init_default_netif(const ip4_addr_t* ipaddr, const ip4_addr_t* netmask, const ip4_addr_t* gw)
{
    netif_add(&default_network_interface, ipaddr, netmask, gw, nullptr, tapif_init, tcpip_input);

    netif_set_default(&default_network_interface);
}

netif& get_default_netif()
{
    return default_network_interface;
}