---
title: llarp::EndpointBase

---

# llarp::EndpointBase





Inherited by [llarp::handlers::ExitEndpoint](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md), [llarp::service::Endpoint](Classes/structllarp_1_1service_1_1Endpoint.md)

## Public Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[QUICMappingInfo](Classes/structllarp_1_1EndpointBase_1_1QUICMappingInfo.md)** <br>info about a quic mapping  |
| struct | **[SendStat](Classes/structllarp_1_1EndpointBase_1_1SendStat.md)**  |

## Public Types

|                | Name           |
| -------------- | -------------- |
| using std::variant< [service::Address](Classes/structllarp_1_1service_1_1Address.md), [RouterID](Classes/structllarp_1_1RouterID.md) > | **[AddressVariant_t](Classes/classllarp_1_1EndpointBase.md#using-addressvariant-t)**  |

## Public Functions

|                | Name           |
| -------------- | -------------- |
| virtual | **[~EndpointBase](Classes/classllarp_1_1EndpointBase.md#function-~endpointbase)**() =default |
| std::optional< [QUICMappingInfo](Classes/structllarp_1_1EndpointBase_1_1QUICMappingInfo.md) > | **[GetQUICMappingInfoByID](Classes/classllarp_1_1EndpointBase.md#function-getquicmappinginfobyid)**(int stream_id) const<br>maybe get quic mapping info given its stream id returns std::nullopt if we have no stream given that id  |
| void | **[PutSRVRecord](Classes/classllarp_1_1EndpointBase.md#function-putsrvrecord)**([dns::SRVData](Classes/structllarp_1_1dns_1_1SRVData.md) srv)<br>add an srv record to this endpoint's descriptor  |
| virtual std::shared_ptr< [dns::Server](Classes/classllarp_1_1dns_1_1Server.md) > | **[DNS](Classes/classllarp_1_1EndpointBase.md#function-dns)**() const<br>get dns serverr if we have on on this endpoint  |
| virtual void | **[SRVRecordsChanged](Classes/classllarp_1_1EndpointBase.md#function-srvrecordschanged)**() =0<br>called when srv data changes in some way  |
| bool | **[DelSRVRecordIf](Classes/classllarp_1_1EndpointBase.md#function-delsrvrecordif)**(std::function< bool(const [dns::SRVData](Classes/structllarp_1_1dns_1_1SRVData.md) &)> filter)<br>remove srv records from this endpoint that match a filter for each srv record call it with filter, remove if filter returns true return if we removed any srv records  |
| std::set< [dns::SRVData](Classes/structllarp_1_1dns_1_1SRVData.md) > | **[SRVRecords](Classes/classllarp_1_1EndpointBase.md#function-srvrecords)**() const<br>get copy of all srv records  |
| virtual std::optional< [SendStat](Classes/structllarp_1_1EndpointBase_1_1SendStat.md) > | **[GetStatFor](Classes/classllarp_1_1EndpointBase.md#function-getstatfor)**(AddressVariant_t remote) const =0<br>get statistics about how much traffic we sent and recv'd to a remote endpoint  |
| virtual std::unordered_set< AddressVariant_t > | **[AllRemoteEndpoints](Classes/classllarp_1_1EndpointBase.md#function-allremoteendpoints)**() const =0<br>list all remote endpoint addresses we have that are mapped  |
| virtual AddressVariant_t | **[LocalAddress](Classes/classllarp_1_1EndpointBase.md#function-localaddress)**() const =0<br>get our local address  |
| virtual [quic::TunnelManager](Classes/classllarp_1_1quic_1_1TunnelManager.md) * | **[GetQUICTunnel](Classes/classllarp_1_1EndpointBase.md#function-getquictunnel)**() =0 |
| virtual std::optional< AddressVariant_t > | **[GetEndpointWithConvoTag](Classes/classllarp_1_1EndpointBase.md#function-getendpointwithconvotag)**([service::ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) tag) const =0 |
| virtual std::optional< [service::ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) > | **[GetBestConvoTagFor](Classes/classllarp_1_1EndpointBase.md#function-getbestconvotagfor)**(AddressVariant_t addr) const =0 |
| virtual bool | **[EnsurePathTo](Classes/classllarp_1_1EndpointBase.md#function-ensurepathto)**(AddressVariant_t addr, std::function< void(std::optional< [service::ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) >)> hook, llarp_time_t timeout) =0 |
| virtual void | **[LookupNameAsync](Classes/classllarp_1_1EndpointBase.md#function-lookupnameasync)**(std::string name, std::function< void(std::optional< AddressVariant_t >)> resultHandler) =0 |
| virtual const EventLoop_ptr & | **[Loop](Classes/classllarp_1_1EndpointBase.md#function-loop)**() =0 |
| virtual bool | **[SendToOrQueue](Classes/classllarp_1_1EndpointBase.md#function-sendtoorqueue)**([service::ConvoTag](Classes/structllarp_1_1service_1_1ConvoTag.md) tag, const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & payload, service::ProtocolType t) =0 |
| virtual void | **[LookupServiceAsync](Classes/classllarp_1_1EndpointBase.md#function-lookupserviceasync)**(std::string name, std::string service, std::function< void(std::vector< [dns::SRVData](Classes/structllarp_1_1dns_1_1SRVData.md) >)> resultHandler) =0<br>lookup srv records async  |
| virtual void | **[MarkAddressOutbound](Classes/classllarp_1_1EndpointBase.md#function-markaddressoutbound)**(AddressVariant_t remote) =0 |

## Public Types Documentation

### using AddressVariant_t

```cpp
using llarp::EndpointBase::AddressVariant_t =  std::variant<service::Address, RouterID>;
```


## Public Functions Documentation

### function ~EndpointBase

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


### function GetQUICMappingInfoByID

```cpp
std::optional< QUICMappingInfo > GetQUICMappingInfoByID(
    int stream_id
) const
```

maybe get quic mapping info given its stream id returns std::nullopt if we have no stream given that id 

### function PutSRVRecord

```cpp
void PutSRVRecord(
    dns::SRVData srv
)
```

add an srv record to this endpoint's descriptor 

### function DNS

```cpp
inline virtual std::shared_ptr< dns::Server > DNS() const
```

get dns serverr if we have on on this endpoint 

**Reimplemented by**: [llarp::handlers::TunEndpoint::DNS](Classes/structllarp_1_1handlers_1_1TunEndpoint.md#function-dns)


### function SRVRecordsChanged

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

called when srv data changes in some way 

**Reimplemented by**: [llarp::handlers::ExitEndpoint::SRVRecordsChanged](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-srvrecordschanged), [llarp::service::Endpoint::SRVRecordsChanged](Classes/structllarp_1_1service_1_1Endpoint.md#function-srvrecordschanged)


### function DelSRVRecordIf

```cpp
bool DelSRVRecordIf(
    std::function< bool(const dns::SRVData &)> filter
)
```

remove srv records from this endpoint that match a filter for each srv record call it with filter, remove if filter returns true return if we removed any srv records 

### function SRVRecords

```cpp
std::set< dns::SRVData > SRVRecords() const
```

get copy of all srv records 

### function GetStatFor

```cpp
virtual std::optional< SendStat > GetStatFor(
    AddressVariant_t remote
) const =0
```

get statistics about how much traffic we sent and recv'd to a remote endpoint 

**Reimplemented by**: [llarp::handlers::ExitEndpoint::GetStatFor](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-getstatfor), [llarp::service::Endpoint::GetStatFor](Classes/structllarp_1_1service_1_1Endpoint.md#function-getstatfor)


### function AllRemoteEndpoints

```cpp
virtual std::unordered_set< AddressVariant_t > AllRemoteEndpoints() const =0
```

list all remote endpoint addresses we have that are mapped 

**Reimplemented by**: [llarp::handlers::ExitEndpoint::AllRemoteEndpoints](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-allremoteendpoints), [llarp::service::Endpoint::AllRemoteEndpoints](Classes/structllarp_1_1service_1_1Endpoint.md#function-allremoteendpoints)


### function LocalAddress

```cpp
virtual AddressVariant_t LocalAddress() const =0
```

get our local address 

**Reimplemented by**: [llarp::handlers::ExitEndpoint::LocalAddress](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-localaddress), [llarp::service::Endpoint::LocalAddress](Classes/structllarp_1_1service_1_1Endpoint.md#function-localaddress)


### function GetQUICTunnel

```cpp
virtual quic::TunnelManager * GetQUICTunnel() =0
```


**Reimplemented by**: [llarp::handlers::ExitEndpoint::GetQUICTunnel](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-getquictunnel), [llarp::service::Endpoint::GetQUICTunnel](Classes/structllarp_1_1service_1_1Endpoint.md#function-getquictunnel)


### function GetEndpointWithConvoTag

```cpp
virtual std::optional< AddressVariant_t > GetEndpointWithConvoTag(
    service::ConvoTag tag
) const =0
```


**Reimplemented by**: [llarp::service::Endpoint::GetEndpointWithConvoTag](Classes/structllarp_1_1service_1_1Endpoint.md#function-getendpointwithconvotag), [llarp::handlers::ExitEndpoint::GetEndpointWithConvoTag](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-getendpointwithconvotag)


### function GetBestConvoTagFor

```cpp
virtual std::optional< service::ConvoTag > GetBestConvoTagFor(
    AddressVariant_t addr
) const =0
```


**Reimplemented by**: [llarp::handlers::ExitEndpoint::GetBestConvoTagFor](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-getbestconvotagfor)


### function EnsurePathTo

```cpp
virtual bool EnsurePathTo(
    AddressVariant_t addr,
    std::function< void(std::optional< service::ConvoTag >)> hook,
    llarp_time_t timeout
) =0
```


**Reimplemented by**: [llarp::handlers::ExitEndpoint::EnsurePathTo](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-ensurepathto)


### function LookupNameAsync

```cpp
virtual void LookupNameAsync(
    std::string name,
    std::function< void(std::optional< AddressVariant_t >)> resultHandler
) =0
```


**Reimplemented by**: [llarp::handlers::ExitEndpoint::LookupNameAsync](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-lookupnameasync)


### function Loop

```cpp
virtual const EventLoop_ptr & Loop() =0
```


**Reimplemented by**: [llarp::handlers::ExitEndpoint::Loop](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-loop), [llarp::service::Endpoint::Loop](Classes/structllarp_1_1service_1_1Endpoint.md#function-loop)


### function SendToOrQueue

```cpp
virtual bool SendToOrQueue(
    service::ConvoTag tag,
    const llarp_buffer_t & payload,
    service::ProtocolType t
) =0
```


**Reimplemented by**: [llarp::service::Endpoint::SendToOrQueue](Classes/structllarp_1_1service_1_1Endpoint.md#function-sendtoorqueue), [llarp::handlers::ExitEndpoint::SendToOrQueue](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-sendtoorqueue)


### function LookupServiceAsync

```cpp
virtual void LookupServiceAsync(
    std::string name,
    std::string service,
    std::function< void(std::vector< dns::SRVData >)> resultHandler
) =0
```

lookup srv records async 

**Reimplemented by**: [llarp::handlers::ExitEndpoint::LookupServiceAsync](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-lookupserviceasync), [llarp::service::Endpoint::LookupServiceAsync](Classes/structllarp_1_1service_1_1Endpoint.md#function-lookupserviceasync)


### function MarkAddressOutbound

```cpp
virtual void MarkAddressOutbound(
    AddressVariant_t remote
) =0
```


**Reimplemented by**: [llarp::handlers::ExitEndpoint::MarkAddressOutbound](Classes/structllarp_1_1handlers_1_1ExitEndpoint.md#function-markaddressoutbound), [llarp::service::Endpoint::MarkAddressOutbound](Classes/structllarp_1_1service_1_1Endpoint.md#function-markaddressoutbound)


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

Updated on 2022-10-06 at 19:25:17 +0000