---
title: llarp::win32::WinDivert

---

# llarp::win32::WinDivert



## Functions

|                | Name           |
| -------------- | -------------- |
| std::string | **[format_ip](Namespaces/namespacellarp_1_1win32_1_1WinDivert.md#function-format-ip)**(uint32_t ip)<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_interceptor](Namespaces/namespacellarp_1_1win32_1_1WinDivert.md#function-make-interceptor)**(const std::string & filter_spec, std::function< void(void)> wakeup)<br>create a packet interceptor that uses windivert.  |


## Functions Documentation

### function format_ip

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

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

### function make_interceptor

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

create a packet interceptor 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 2023-01-24 at 18:23:43 +0000