---
title: llarp::AddressInfo

---

# llarp::AddressInfo





## Public Functions

|                | Name           |
| -------------- | -------------- |
| bool | **[BDecode](Classes/structllarp_1_1AddressInfo.md#function-bdecode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| bool | **[BEncode](Classes/structllarp_1_1AddressInfo.md#function-bencode)**([llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) const |
| bool | **[DecodeKey](Classes/structllarp_1_1AddressInfo.md#function-decodekey)**(const [llarp_buffer_t](Classes/structllarp__buffer__t.md) & k, [llarp_buffer_t](Classes/structllarp__buffer__t.md) * buf) |
| [IpAddress](Classes/structllarp_1_1IpAddress.md) | **[toIpAddress](Classes/structllarp_1_1AddressInfo.md#function-toipaddress)**() const<br>Return an [IpAddress]() representing the address portion of this [AddressInfo](Classes/structllarp_1_1AddressInfo.md).  |
| void | **[fromSockAddr](Classes/structllarp_1_1AddressInfo.md#function-fromsockaddr)**(const [SockAddr](Classes/structllarp_1_1SockAddr.md) & address)<br>Updates our ip and port to reflect that of the given [SockAddr]().  |
| net::ipaddr_t | **[IP](Classes/structllarp_1_1AddressInfo.md#function-ip)**() const<br>get this as an explicit v4 or explicit v6  |
| net::ipv4addr_t | **[IPv4](Classes/structllarp_1_1AddressInfo.md#function-ipv4)**() const<br>get this as an v4 or throw if it is not one  |
| std::string | **[ToString](Classes/structllarp_1_1AddressInfo.md#function-tostring)**() const |

## Public Attributes

|                | Name           |
| -------------- | -------------- |
| uint16_t | **[rank](Classes/structllarp_1_1AddressInfo.md#variable-rank)**  |
| std::string | **[dialect](Classes/structllarp_1_1AddressInfo.md#variable-dialect)**  |
| [llarp::PubKey](Classes/structllarp_1_1PubKey.md) | **[pubkey](Classes/structllarp_1_1AddressInfo.md#variable-pubkey)**  |
| in6_addr | **[ip](Classes/structllarp_1_1AddressInfo.md#variable-ip)**  |
| uint16_t | **[port](Classes/structllarp_1_1AddressInfo.md#variable-port)**  |
| uint64_t | **[version](Classes/structllarp_1_1AddressInfo.md#variable-version)**  |

## Public Functions Documentation

### function BDecode

```cpp
inline bool BDecode(
    llarp_buffer_t * buf
)
```


### function BEncode

```cpp
bool BEncode(
    llarp_buffer_t * buf
) const
```


### function DecodeKey

```cpp
bool DecodeKey(
    const llarp_buffer_t & k,
    llarp_buffer_t * buf
)
```


### function toIpAddress

```cpp
IpAddress toIpAddress() const
```

Return an [IpAddress]() representing the address portion of this [AddressInfo](Classes/structllarp_1_1AddressInfo.md). 

### function fromSockAddr

```cpp
void fromSockAddr(
    const SockAddr & address
)
```

Updates our ip and port to reflect that of the given [SockAddr](). 

### function IP

```cpp
net::ipaddr_t IP() const
```

get this as an explicit v4 or explicit v6 

### function IPv4

```cpp
inline net::ipv4addr_t IPv4() const
```

get this as an v4 or throw if it is not one 

### function ToString

```cpp
std::string ToString() const
```


## Public Attributes Documentation

### variable rank

```cpp
uint16_t rank;
```


### variable dialect

```cpp
std::string dialect;
```


### variable pubkey

```cpp
llarp::PubKey pubkey;
```


### variable ip

```cpp
in6_addr ip = {};
```


### variable port

```cpp
uint16_t port;
```


### variable version

```cpp
uint64_t version = llarp::constants::proto_version;
```


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

Updated on 2022-09-19 at 17:18:32 +0000