---
title: llarp::dns::PacketSource_Base

---

# llarp::dns::PacketSource_Base





Inherited by [llarp::dns::PacketSource_Wrapper](Classes/classllarp_1_1dns_1_1PacketSource__Wrapper.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| virtual | **[~PacketSource_Base](Classes/classllarp_1_1dns_1_1PacketSource__Base.md#function-~packetsource-base)**() =default |
| virtual bool | **[WouldLoop](Classes/classllarp_1_1dns_1_1PacketSource__Base.md#function-wouldloop)**(const [SockAddr](Classes/structllarp_1_1SockAddr.md) & to, const [SockAddr](Classes/structllarp_1_1SockAddr.md) & from) const =0<br>return true if traffic with source and dest addresses would cause a loop in resolution and thus should not be sent to query handlers  |
| virtual void | **[SendTo](Classes/classllarp_1_1dns_1_1PacketSource__Base.md#function-sendto)**(const [SockAddr](Classes/structllarp_1_1SockAddr.md) & to, const [SockAddr](Classes/structllarp_1_1SockAddr.md) & from, [OwnedBuffer](Classes/structllarp_1_1OwnedBuffer.md) buf) const =0<br>send packet with src and dst address containing buf on this packet source  |
| virtual void | **[Stop](Classes/classllarp_1_1dns_1_1PacketSource__Base.md#function-stop)**() =0<br>stop reading packets and end operation  |
| virtual std::optional< [SockAddr](Classes/structllarp_1_1SockAddr.md) > | **[BoundOn](Classes/classllarp_1_1dns_1_1PacketSource__Base.md#function-boundon)**() const =0<br>returns the sockaddr we are bound on if applicable  |

## Public Functions Documentation

### function ~PacketSource_Base

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


### function WouldLoop

```cpp
virtual bool WouldLoop(
    const SockAddr & to,
    const SockAddr & from
) const =0
```

return true if traffic with source and dest addresses would cause a loop in resolution and thus should not be sent to query handlers 

**Reimplemented by**: [llarp::dns::PacketSource_Wrapper::WouldLoop](Classes/classllarp_1_1dns_1_1PacketSource__Wrapper.md#function-wouldloop)


### function SendTo

```cpp
virtual void SendTo(
    const SockAddr & to,
    const SockAddr & from,
    OwnedBuffer buf
) const =0
```

send packet with src and dst address containing buf on this packet source 

**Reimplemented by**: [llarp::dns::PacketSource_Wrapper::SendTo](Classes/classllarp_1_1dns_1_1PacketSource__Wrapper.md#function-sendto)


### function Stop

```cpp
virtual void Stop() =0
```

stop reading packets and end operation 

**Reimplemented by**: [llarp::dns::PacketSource_Wrapper::Stop](Classes/classllarp_1_1dns_1_1PacketSource__Wrapper.md#function-stop)


### function BoundOn

```cpp
virtual std::optional< SockAddr > BoundOn() const =0
```

returns the sockaddr we are bound on if applicable 

**Reimplemented by**: [llarp::dns::PacketSource_Wrapper::BoundOn](Classes/classllarp_1_1dns_1_1PacketSource__Wrapper.md#function-boundon)


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

Updated on 2023-03-26 at 04:03:14 +0000