---
title: llarp::service::IServiceLookup

---

# llarp::service::IServiceLookup





Inherited by [llarp::service::HiddenServiceAddressLookup](Classes/structllarp_1_1service_1_1HiddenServiceAddressLookup.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| | **[IServiceLookup](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-iservicelookup)**() =delete |
| virtual | **[~IServiceLookup](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-~iservicelookup)**() =default |
| virtual bool | **[HandleIntrosetResponse](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-handleintrosetresponse)**(const std::set< [EncryptedIntroSet](Classes/structllarp_1_1service_1_1EncryptedIntroSet.md) > & )<br>handle lookup result for introsets  |
| virtual bool | **[HandleNameResponse](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-handlenameresponse)**(std::optional< [Address](Classes/structllarp_1_1service_1_1Address.md) > )<br>handle lookup result for introsets  |
| virtual void | **[HandleTimeout](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-handletimeout)**() |
| bool | **[IsTimedOut](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-istimedout)**(llarp_time_t now) const<br>determine if this request has timed out  |
| llarp_time_t | **[TimeLeft](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-timeleft)**(llarp_time_t now) const<br>return how long this request has left to be fufilled  |
| virtual std::shared_ptr< [routing::IMessage](Classes/structllarp_1_1routing_1_1IMessage.md) > | **[BuildRequestMessage](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-buildrequestmessage)**() =0<br>build request message for service lookup  |
| virtual bool | **[SendRequestViaPath](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-sendrequestviapath)**(path::Path_ptr p, [AbstractRouter](Classes/structllarp_1_1AbstractRouter.md) * r)<br>build a new request message and send it via a path  |
| virtual bool | **[IsFor](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-isfor)**(EndpointBase::AddressVariant_t ) const<br>return true if this lookup is for a remote address  |
| util::StatusObject | **[ExtractStatus](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-extractstatus)**() const |

## Protected Functions

|                | Name           |
| -------------- | -------------- |
| | **[IServiceLookup](Classes/structllarp_1_1service_1_1IServiceLookup.md#function-iservicelookup)**([ILookupHolder](Classes/structllarp_1_1service_1_1ILookupHolder.md) * parent, uint64_t tx, std::string name, llarp_time_t timeout =10s) |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| [ILookupHolder](Classes/structllarp_1_1service_1_1ILookupHolder.md) * | **[m_parent](Classes/structllarp_1_1service_1_1IServiceLookup.md#variable-m-parent)**  |
| uint64_t | **[txid](Classes/structllarp_1_1service_1_1IServiceLookup.md#variable-txid)**  |
| const std::string | **[name](Classes/structllarp_1_1service_1_1IServiceLookup.md#variable-name)**  |
| [RouterID](Classes/structllarp_1_1RouterID.md) | **[endpoint](Classes/structllarp_1_1service_1_1IServiceLookup.md#variable-endpoint)**  |

## Protected Attributes

|                | Name           |
| -------------- | -------------- |
| const llarp_time_t | **[m_created](Classes/structllarp_1_1service_1_1IServiceLookup.md#variable-m-created)**  |
| const llarp_time_t | **[m_timeout](Classes/structllarp_1_1service_1_1IServiceLookup.md#variable-m-timeout)**  |

## Public Functions Documentation

### function IServiceLookup

```cpp
IServiceLookup() =delete
```


### function ~IServiceLookup

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


### function HandleIntrosetResponse

```cpp
inline virtual bool HandleIntrosetResponse(
    const std::set< EncryptedIntroSet > & 
)
```

handle lookup result for introsets 

**Reimplemented by**: [llarp::service::HiddenServiceAddressLookup::HandleIntrosetResponse](Classes/structllarp_1_1service_1_1HiddenServiceAddressLookup.md#function-handleintrosetresponse)


### function HandleNameResponse

```cpp
inline virtual bool HandleNameResponse(
    std::optional< Address > 
)
```

handle lookup result for introsets 

### function HandleTimeout

```cpp
inline virtual void HandleTimeout()
```


### function IsTimedOut

```cpp
inline bool IsTimedOut(
    llarp_time_t now
) const
```

determine if this request has timed out 

### function TimeLeft

```cpp
inline llarp_time_t TimeLeft(
    llarp_time_t now
) const
```

return how long this request has left to be fufilled 

### function BuildRequestMessage

```cpp
virtual std::shared_ptr< routing::IMessage > BuildRequestMessage() =0
```

build request message for service lookup 

**Reimplemented by**: [llarp::service::HiddenServiceAddressLookup::BuildRequestMessage](Classes/structllarp_1_1service_1_1HiddenServiceAddressLookup.md#function-buildrequestmessage)


### function SendRequestViaPath

```cpp
virtual bool SendRequestViaPath(
    path::Path_ptr p,
    AbstractRouter * r
)
```

build a new request message and send it via a path 

### function IsFor

```cpp
inline virtual bool IsFor(
    EndpointBase::AddressVariant_t 
) const
```

return true if this lookup is for a remote address 

**Reimplemented by**: [llarp::service::HiddenServiceAddressLookup::IsFor](Classes/structllarp_1_1service_1_1HiddenServiceAddressLookup.md#function-isfor)


### function ExtractStatus

```cpp
inline util::StatusObject ExtractStatus() const
```


## Protected Functions Documentation

### function IServiceLookup

```cpp
IServiceLookup(
    ILookupHolder * parent,
    uint64_t tx,
    std::string name,
    llarp_time_t timeout =10s
)
```


## Public Attributes Documentation

### variable m_parent

```cpp
ILookupHolder * m_parent;
```


### variable txid

```cpp
uint64_t txid;
```


### variable name

```cpp
const std::string name;
```


### variable endpoint

```cpp
RouterID endpoint;
```


## Protected Attributes Documentation

### variable m_created

```cpp
const llarp_time_t m_created;
```


### variable m_timeout

```cpp
const llarp_time_t m_timeout;
```


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

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