---
title: llarp::service::Address
summary: Snapp Address. 

---

# llarp::service::Address



Snapp [Address](). 


`#include <address.hpp>`

Inherits from [llarp::AlignedBuffer< 32 >](Classes/structllarp_1_1AlignedBuffer.md)

## Public Functions

|                | Name           |
| -------------- | -------------- |
| bool | **[PermitTLD](Classes/structllarp_1_1service_1_1Address.md#function-permittld)**(const char * tld)<br>return true if we permit using this tld otherwise return false  |
| std::string | **[ToString](Classes/structllarp_1_1service_1_1Address.md#function-tostring)**(const char * tld =".loki") const |
| bool | **[FromString](Classes/structllarp_1_1service_1_1Address.md#function-fromstring)**(std::string_view str, const char * tld =".loki") |
| | **[Address](Classes/structllarp_1_1service_1_1Address.md#function-address)**() =default |
| | **[Address](Classes/structllarp_1_1service_1_1Address.md#function-address)**(const std::string & str) |
| | **[Address](Classes/structllarp_1_1service_1_1Address.md#function-address)**(const Data & buf) |
| | **[Address](Classes/structllarp_1_1service_1_1Address.md#function-address)**(const [Address](Classes/structllarp_1_1service_1_1Address.md) & other) |
| | **[Address](Classes/structllarp_1_1service_1_1Address.md#function-address)**(const [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md)< 32 > & other) |
| bool | **[operator<](Classes/structllarp_1_1service_1_1Address.md#function-operator<)**(const [Address](Classes/structllarp_1_1service_1_1Address.md) & other) const |
| bool | **[operator==](Classes/structllarp_1_1service_1_1Address.md#function-operator==)**(const [Address](Classes/structllarp_1_1service_1_1Address.md) & other) const |
| bool | **[operator!=](Classes/structllarp_1_1service_1_1Address.md#function-operator!=)**(const [Address](Classes/structllarp_1_1service_1_1Address.md) & other) const |
| [Address](Classes/structllarp_1_1service_1_1Address.md) & | **[operator=](Classes/structllarp_1_1service_1_1Address.md#function-operator=)**(const [Address](Classes/structllarp_1_1service_1_1Address.md) & other) =default |
| [Address](Classes/structllarp_1_1service_1_1Address.md) & | **[operator=](Classes/structllarp_1_1service_1_1Address.md#function-operator=)**([Address](Classes/structllarp_1_1service_1_1Address.md) & other) =default |
| [dht::Key_t](Classes/structllarp_1_1dht_1_1Key__t.md) | **[ToKey](Classes/structllarp_1_1service_1_1Address.md#function-tokey)**() const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| std::string | **[subdomain](Classes/structllarp_1_1service_1_1Address.md#variable-subdomain)** <br>if parsed using FromString this contains the subdomain this member is not used when comparing it's extra data for dns  |
| const std::set< std::string > | **[AllowedTLDs](Classes/structllarp_1_1service_1_1Address.md#variable-allowedtlds)** <br>list of whitelisted gtld to permit  |

## Additional inherited members

**Public Types inherited from [llarp::AlignedBuffer< 32 >](Classes/structllarp_1_1AlignedBuffer.md)**

|                | Name           |
| -------------- | -------------- |
| using std::array< byte_t, sz > | **[Data](Classes/structllarp_1_1AlignedBuffer.md#using-data)**  |

**Public Functions inherited from [llarp::AlignedBuffer< 32 >](Classes/structllarp_1_1AlignedBuffer.md)**

|                | Name           |
| -------------- | -------------- |
| | **[AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md#function-alignedbuffer)**() =default |
| | **[AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md#function-alignedbuffer)**(const byte_t * data) |
| constexpr | **[AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md#function-alignedbuffer)**(const Data & buf) |
| constexpr | **[AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md#function-alignedbuffer)**(Data && buf) |
| constexpr [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md)< sz > | **[operator~](Classes/structllarp_1_1AlignedBuffer.md#function-operator~)**() const<br>bitwise NOT  |
| constexpr bool | **[operator>](Classes/structllarp_1_1AlignedBuffer.md#function-operator>)**(const [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md) & other) const |
| constexpr bool | **[operator<=](Classes/structllarp_1_1AlignedBuffer.md#function-operator<=)**(const [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md) & other) const |
| constexpr bool | **[operator>=](Classes/structllarp_1_1AlignedBuffer.md#function-operator>=)**(const [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md) & other) const |
| constexpr [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md) | **[operator^](Classes/structllarp_1_1AlignedBuffer.md#function-operator^)**(const [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md) & other) const |
| constexpr [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md) & | **[operator^=](Classes/structllarp_1_1AlignedBuffer.md#function-operator^=)**(const [AlignedBuffer](Classes/structllarp_1_1AlignedBuffer.md) & other) |
| byte_t & | **[operator[]](Classes/structllarp_1_1AlignedBuffer.md#function-operator[])**(size_t idx) |
| const byte_t & | **[operator[]](Classes/structllarp_1_1AlignedBuffer.md#function-operator[])**(size_t idx) const |
| constexpr void | **[Fill](Classes/structllarp_1_1AlignedBuffer.md#function-fill)**(byte_t f) |
| constexpr Data & | **[as_array](Classes/structllarp_1_1AlignedBuffer.md#function-as-array)**() |
| constexpr const Data & | **[as_array](Classes/structllarp_1_1AlignedBuffer.md#function-as-array)**() const |
| constexpr byte_t * | **[data](Classes/structllarp_1_1AlignedBuffer.md#function-data)**() |
| constexpr const byte_t * | **[data](Classes/structllarp_1_1AlignedBuffer.md#function-data)**() const |
| bool | **[IsZero](Classes/structllarp_1_1AlignedBuffer.md#function-iszero)**() const |
| void | **[Zero](Classes/structllarp_1_1AlignedBuffer.md#function-zero)**() |
| virtual void | **[Randomize](Classes/structllarp_1_1AlignedBuffer.md#function-randomize)**() |
| constexpr Data::iterator | **[begin](Classes/structllarp_1_1AlignedBuffer.md#function-begin)**() |
| constexpr Data::iterator | **[end](Classes/structllarp_1_1AlignedBuffer.md#function-end)**() |
| constexpr Data::const_iterator | **[begin](Classes/structllarp_1_1AlignedBuffer.md#function-begin)**() const |
| constexpr Data::const_iterator | **[end](Classes/structllarp_1_1AlignedBuffer.md#function-end)**() const |
| constexpr std::string_view | **[ToView](Classes/structllarp_1_1AlignedBuffer.md#function-toview)**() const |
| bool | **[FromBytestring](Classes/structllarp_1_1AlignedBuffer.md#function-frombytestring)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| bool | **[BEncode](Classes/structllarp_1_1AlignedBuffer.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const |
| bool | **[BDecode](Classes/structllarp_1_1AlignedBuffer.md#function-bdecode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| std::string | **[ToHex](Classes/structllarp_1_1AlignedBuffer.md#function-tohex)**() const |
| std::string | **[ShortHex](Classes/structllarp_1_1AlignedBuffer.md#function-shorthex)**() const |
| bool | **[FromHex](Classes/structllarp_1_1AlignedBuffer.md#function-fromhex)**(std::string_view str) |
| constexpr size_t | **[size](Classes/structllarp_1_1AlignedBuffer.md#function-size)**() |

**Public Attributes inherited from [llarp::AlignedBuffer< 32 >](Classes/structllarp_1_1AlignedBuffer.md)**

|                | Name           |
| -------------- | -------------- |
| constexpr auto | **[SIZE](Classes/structllarp_1_1AlignedBuffer.md#variable-size)**  |


## Public Functions Documentation

### function PermitTLD

```cpp
static bool PermitTLD(
    const char * tld
)
```

return true if we permit using this tld otherwise return false 

### function ToString

```cpp
std::string ToString(
    const char * tld =".loki"
) const
```


### function FromString

```cpp
bool FromString(
    std::string_view str,
    const char * tld =".loki"
)
```


### function Address

```cpp
Address() =default
```


### function Address

```cpp
inline explicit Address(
    const std::string & str
)
```


### function Address

```cpp
inline explicit Address(
    const Data & buf
)
```


### function Address

```cpp
inline Address(
    const Address & other
)
```


### function Address

```cpp
inline explicit Address(
    const AlignedBuffer< 32 > & other
)
```


### function operator<

```cpp
inline bool operator<(
    const Address & other
) const
```


### function operator==

```cpp
inline bool operator==(
    const Address & other
) const
```


### function operator!=

```cpp
inline bool operator!=(
    const Address & other
) const
```


### function operator=

```cpp
Address & operator=(
    const Address & other
) =default
```


### function operator=

```cpp
Address & operator=(
    Address & other
) =default
```


### function ToKey

```cpp
dht::Key_t ToKey() const
```


## Public Attributes Documentation

### variable subdomain

```cpp
std::string subdomain;
```

if parsed using FromString this contains the subdomain this member is not used when comparing it's extra data for dns 

### variable AllowedTLDs

```cpp
static const std::set< std::string > AllowedTLDs;
```

list of whitelisted gtld to permit 

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

Updated on 2023-04-27 at 04:17:17 +0000