---
title: llarp::vpn::AndroidInterface

---

# llarp::vpn::AndroidInterface





Inherits from [llarp::vpn::NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md), [llarp::vpn::I_Packet_IO](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[AndroidInterface](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-androidinterface)**([InterfaceInfo](Classes/structllarp_1_1vpn_1_1InterfaceInfo.md) info, int fd) |
| virtual | **[~AndroidInterface](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-~androidinterface)**() |
| virtual int | **[PollFD](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-pollfd)**() const override<br>get pollable fd for reading  |
| virtual [net::IPPacket](Classes/structllarp_1_1net_1_1IPPacket.md) | **[ReadNextPacket](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-readnextpacket)**() override<br>read next ip packet, return an empty packet if there are none ready.  |
| virtual bool | **[WritePacket](Classes/classllarp_1_1vpn_1_1AndroidInterface.md#function-writepacket)**([net::IPPacket](Classes/structllarp_1_1net_1_1IPPacket.md) pkt) override<br>write a packet to the interface returns false if we dropped it  |

## Additional inherited members

**Public Functions inherited from [llarp::vpn::NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md)**

|                | Name           |
| -------------- | -------------- |
| | **[NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md#function-networkinterface)**([InterfaceInfo](Classes/structllarp_1_1vpn_1_1InterfaceInfo.md) info) |
| | **[NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md#function-networkinterface)**(const [NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md) & ) =delete |
| | **[NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md#function-networkinterface)**([NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md) && ) =delete |
| virtual | **[~NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md#function-~networkinterface)**() =default |
| const [InterfaceInfo](Classes/structllarp_1_1vpn_1_1InterfaceInfo.md) & | **[Info](Classes/classllarp_1_1vpn_1_1NetworkInterface.md#function-info)**() const |
| virtual void | **[MaybeWakeUpperLayers](Classes/classllarp_1_1vpn_1_1NetworkInterface.md#function-maybewakeupperlayers)**() const<br>idempotently wake up the upper layers as needed (platform dependant)  |

**Protected Attributes inherited from [llarp::vpn::NetworkInterface](Classes/classllarp_1_1vpn_1_1NetworkInterface.md)**

|                | Name           |
| -------------- | -------------- |
| [InterfaceInfo](Classes/structllarp_1_1vpn_1_1InterfaceInfo.md) | **[m_Info](Classes/classllarp_1_1vpn_1_1NetworkInterface.md#variable-m-info)**  |

**Public Functions inherited from [llarp::vpn::I_Packet_IO](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md)**

|                | 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.  |


## Public Functions Documentation

### function AndroidInterface

```cpp
inline AndroidInterface(
    InterfaceInfo info,
    int fd
)
```


### function ~AndroidInterface

```cpp
inline virtual ~AndroidInterface()
```


### function PollFD

```cpp
inline virtual int PollFD() const override
```

get pollable fd for reading 

**Reimplements**: [llarp::vpn::I_Packet_IO::PollFD](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-pollfd)


### function ReadNextPacket

```cpp
inline virtual net::IPPacket ReadNextPacket() override
```

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

**Reimplements**: [llarp::vpn::I_Packet_IO::ReadNextPacket](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-readnextpacket)


### function WritePacket

```cpp
inline virtual bool WritePacket(
    net::IPPacket pkt
) override
```

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

**Reimplements**: [llarp::vpn::I_Packet_IO::WritePacket](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md#function-writepacket)


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

Updated on 2022-10-25 at 00:38:17 +0000