---
title: llarp::vpn::I_Packet_IO

---

# llarp::vpn::I_Packet_IO





Inherited by [llarp::vpn::NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| virtual | **[~I_Packet_IO](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-~i-packet-io)**() =default |
| virtual void | **[Start](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-start)**()<br>start any platform specific operations before running  |
| virtual void | **[Stop](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-stop)**()<br>stop operation and tear down anything that [Start()](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-start) set up.  |
| virtual [net::IPPacket](Classes/structllarp_1_1net_1_1IPPacket.md) | **[ReadNextPacket](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-readnextpacket)**() =0<br>read next ip packet, return an empty packet if there are none ready.  |
| virtual bool | **[WritePacket](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-writepacket)**([net::IPPacket](Classes/structllarp_1_1net_1_1IPPacket.md) pkt) =0<br>write a packet to the interface returns false if we dropped it  |
| virtual int | **[PollFD](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-pollfd)**() const =0<br>get pollable fd for reading  |

## Public Functions Documentation

### function ~I_Packet_IO

```cpp
virtual ~I_Packet_IO() =default
```


### function Start

```cpp
inline virtual void Start()
```

start any platform specific operations before running 

### function Stop

```cpp
inline virtual void Stop()
```

stop operation and tear down anything that [Start()](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-start) set up. 

### function ReadNextPacket

```cpp
virtual net::IPPacket ReadNextPacket() =0
```

read next ip packet, return an empty packet if there are none ready. 

**Reimplemented by**: [llarp::apple::VPNInterface::ReadNextPacket](Classes/classllarp_1_1apple_1_1VPNInterface.md#function-readnextpacket), [llarp::vpn::AndroidInterface::ReadNextPacket](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-readnextpacket), [llarp::vpn::LinuxInterface::ReadNextPacket](Classes/classllarp_1_1vpn_1_1LinuxInterface.md#function-readnextpacket)


### function WritePacket

```cpp
virtual bool WritePacket(
    net::IPPacket pkt
) =0
```

write a packet to the interface returns false if we dropped it 

**Reimplemented by**: [llarp::apple::VPNInterface::WritePacket](Classes/classllarp_1_1apple_1_1VPNInterface.md#function-writepacket), [llarp::vpn::AndroidInterface::WritePacket](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-writepacket), [llarp::vpn::LinuxInterface::WritePacket](Classes/classllarp_1_1vpn_1_1LinuxInterface.md#function-writepacket)


### function PollFD

```cpp
virtual int PollFD() const =0
```

get pollable fd for reading 

**Reimplemented by**: [llarp::apple::VPNInterface::PollFD](Classes/classllarp_1_1apple_1_1VPNInterface.md#function-pollfd), [llarp::vpn::AndroidInterface::PollFD](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-pollfd), [llarp::vpn::LinuxInterface::PollFD](Classes/classllarp_1_1vpn_1_1LinuxInterface.md#function-pollfd)


-------------------------------

Updated on 2023-01-09 at 18:23:49 +0000