#include <tuntap.h>
Definition at line 70 of file tuntap.h.
◆ TunTap()
◆ ~TunTap()
◆ activate()
int TunTap::activate |
( |
bool |
arpEnabled | ) |
|
Activates tuntap
- Parameters
-
arpEnabled | enable or disable arp |
- Returns
- 0 on success, -1 on error.
- Note
- sets the device to the UP state.
Definition at line 186 of file tuntap.cc.
◆ close()
Closes tuntap handle
- Returns
- 0
Definition at line 170 of file tuntap.cc.
◆ deactivate()
int TunTap::deactivate |
( |
| ) |
|
Deactivates tuntap
- Returns
- 0 on success, -1 on error.
- Note
- sets the device to the DOWN state.
Definition at line 201 of file tuntap.cc.
◆ get_addr()
Gets the tuntap ip address
- Returns
- tuntap ip address
Definition at line 473 of file tuntap.cc.
◆ get_handle()
int TunTap::get_handle |
( |
| ) |
|
Gets tuntap handle
- Returns
- tuntap handle.
Definition at line 179 of file tuntap.cc.
◆ get_mask()
Gets the tuntap netmask
- Returns
- tuntap netmask
Definition at line 480 of file tuntap.cc.
◆ open()
int TunTap::open |
( |
const char * |
sDevicePath, |
|
|
const char * |
sDeviceName |
|
) |
| |
Opens tuntap handle
- Parameters
-
sDevicePath | path to device |
sDeviceName | name of device |
- Returns
- 0 on success, -1 on error
Definition at line 80 of file tuntap.cc.
◆ readv()
int TunTap::readv |
( |
struct iovec * |
iov, |
|
|
size_t |
iov_len |
|
) |
| |
Reads from tuntap
- Parameters
-
iov | iovector |
iov_len | number of elements in the iovector |
- Returns
- total number of bytes read
Definition at line 452 of file tuntap.cc.
◆ set_addr()
Sets tuntap interface address and netmask
ipv4 addr "192.168.1.1" mask "255.255.255.0" ipv6 addr "::192.168.1.1" mask "ffff:ffff:ffff:ffff::"
- Parameters
-
addr | tun address ipv4 or ipv6 address |
mask | tun netmask used as an ipv4 or ipv6 netmask |
- Returns
- 0 on success, -1 on error.
Definition at line 208 of file tuntap.cc.
◆ set_ethaddr() [1/2]
Sets tuntap eth address
- Parameters
-
- Returns
- 0 on success, -1 on error.
Definition at line 381 of file tuntap.cc.
◆ set_ethaddr() [2/2]
int TunTap::set_ethaddr |
( |
NEMId |
id | ) |
|
Sets tuntap eth address
- Parameters
-
- Returns
- 0 on success, -1 on error.
Definition at line 368 of file tuntap.cc.
◆ writev()
int TunTap::writev |
( |
const struct iovec * |
iov, |
|
|
size_t |
iov_len |
|
) |
| |
Writes to tuntap
- Parameters
-
iov | iovector |
iov_len | number of elements in the iovector |
- Returns
- total number of bytes written
Definition at line 430 of file tuntap.cc.
The documentation for this class was generated from the following files: