---
title: llarp::win32::WinDivert_API

---

# llarp::win32::WinDivert_API





## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[WinDivert_API](Classes/classllarp_1_1win32_1_1WinDivert__API.md#function-windivert-api)**() |
| std::string | **[format_ip](Classes/classllarp_1_1win32_1_1WinDivert__API.md#function-format-ip)**(uint32_t ip) const<br>format an ipv4 in host order to string such that a windivert filter spec can understand it  |
| std::shared_ptr< [llarp::vpn::I_Packet_IO](Classes/classllarp_1_1vpn_1_1I__Packet__IO.md) > | **[make_intercepter](Classes/classllarp_1_1win32_1_1WinDivert__API.md#function-make-intercepter)**(std::string filter_spec, std::function< void(void)> wakeup) const<br>create a packet intercepter that uses windivert.  |

## Public Functions Documentation

### function WinDivert_API

```cpp
WinDivert_API()
```


### function format_ip

```cpp
std::string format_ip(
    uint32_t ip
) const
```

format an ipv4 in host order to string such that a windivert filter spec can understand it 

### function make_intercepter

```cpp
std::shared_ptr< llarp::vpn::I_Packet_IO > make_intercepter(
    std::string filter_spec,
    std::function< void(void)> wakeup
) const
```

create a packet intercepter that uses windivert. 

filter_spec describes the kind of traffic we wish to intercept. pass in a callable that wakes up the main event loop. we hide all implementation details from other compilation units to prevent issues with linkage that may arrise. 


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

Updated on 2022-09-10 at 18:17:15 +0000