|
Safe DDS
|
Stores remote address information. More...
#include <Locator.hpp>
Public Types | |
| enum class | LocatorKind : int32_t { INVALID = -1 , RESERVED = 0 , UDPv4 = 1 , UDPv6 = 2 , ETHERNET = 0x02000000 , CUSTOM = INT32_MAX } |
Locator.kind values reserved for known transport types. More... | |
| using | IPv4 = memory::container::Array< uint8_t, 4 > |
| Type for IPv4 address. More... | |
| using | IPv6 = memory::container::Array< uint8_t, ADDRESS_SIZE > |
| Type for IPv6 address. More... | |
| using | MAC = memory::container::Array< uint8_t, MAC_ADDRESS_SIZE > |
| Type for MAC address. More... | |
Public Member Functions | |
| ReturnCode | get_ipv4 (IPv4 &ipv4) const noexcept |
| Getter in Locator::IPv4 format. More... | |
| ReturnCode | get_mac (MAC &mac) const noexcept |
| Getter in Locator::MAC format. More... | |
Static Public Member Functions | |
| static Locator | from_ipv4 (const IPv4 &locator_ipv4, uint32_t locator_port) noexcept |
| Get Locator from IPv4 address. More... | |
| static Locator | from_mac (const MAC &mac_address, uint16_t logical_port, uint16_t vlan_id, uint8_t pcp) noexcept |
| Get Locator from MAC address, logical port, VLAN ID and PCP. More... | |
Public Attributes | |
| LocatorKind | kind |
| Kind of locator. More... | |
| uint32_t | port |
| Net port value. More... | |
| memory::container::Array< uint8_t, ADDRESS_SIZE > | address |
| Net address, size compatible with IPV4 and IPV6. More... | |
Static Public Attributes | |
| constexpr static uint32_t | ADDRESS_SIZE = 16 |
| Size of locator address octet array. More... | |
| constexpr static uint32_t | MAC_ADDRESS_SIZE = 6 |
| Size of MAC address octet array. More... | |
| constexpr static uint32_t | ADDRESS_IPV4_POS_1 = 12 |
| Address position of first IPv4 octet. More... | |
| constexpr static uint32_t | ADDRESS_IPV4_POS_2 = 13 |
| Address position of second IPv4 octet. More... | |
| constexpr static uint32_t | ADDRESS_IPV4_POS_3 = 14 |
| Address position of third IPv4 octet. More... | |
| constexpr static uint32_t | ADDRESS_IPV4_POS_4 = 15 |
| Address position of fourth IPv4 octet. More... | |
| constexpr static uint32_t | ADDRESS_MAC_POS_1 = 10 |
| Address position of first MAC octet. More... | |
| constexpr static uint32_t | ADDRESS_MAC_POS_2 = 11 |
| Address position of second MAC octet. More... | |
| constexpr static uint32_t | ADDRESS_MAC_POS_3 = 12 |
| Address position of third MAC octet. More... | |
| constexpr static uint32_t | ADDRESS_MAC_POS_4 = 13 |
| Address position of fourth MAC octet. More... | |
| constexpr static uint32_t | ADDRESS_MAC_POS_5 = 14 |
| Address position of fifth MAC octet. More... | |
| constexpr static uint32_t | ADDRESS_MAC_POS_6 = 15 |
| Address position of sixth MAC octet. More... | |
| constexpr static uint32_t | MAC_POS_1 = 0U |
| Position of first MAC octet. More... | |
| constexpr static uint32_t | MAC_POS_2 = 1U |
| Position of second MAC octet. More... | |
| constexpr static uint32_t | MAC_POS_3 = 2U |
| Position of third MAC octet. More... | |
| constexpr static uint32_t | MAC_POS_4 = 3U |
| Position of fourth MAC octet. More... | |
| constexpr static uint32_t | MAC_POS_5 = 4U |
| Position of fifth MAC octet. More... | |
| constexpr static uint32_t | MAC_POS_6 = 5U |
| Position of sixth MAC octet (prevent magic number detection by clang-tidy) More... | |
| constexpr static uint16_t | VLAN_ID_SHIFT = 20U |
| Shift for VLAN ID in port field. More... | |
| constexpr static uint16_t | VLAN_ID_MASK = 0x0FFFU |
| Mask for VLAN ID in port field. More... | |
| constexpr static uint16_t | VLAN_ID_MAX_VALUE = 4094U |
| Maximum value for VLAN ID (12 bits) More... | |
| constexpr static uint8_t | PCP_SHIFT = 16U |
| Shift for Priority Code Point in port field. More... | |
| constexpr static uint8_t | PCP_MASK = 0x0FU |
| Mask for Priority Code Point in port field. More... | |
| constexpr static uint8_t | PCP_MAX_VALUE = 7U |
| Maximum value for Priority Code Point (3 bits) More... | |
| static constexpr uint32_t | CDR_SERIALIZED_SIZE |
| CDR serialized size. More... | |
Stores remote address information.
| using eprosima::safedds::transport::Locator::IPv4 = memory::container::Array<uint8_t, 4> |
Type for IPv4 address.
| using eprosima::safedds::transport::Locator::IPv6 = memory::container::Array<uint8_t, ADDRESS_SIZE> |
Type for IPv6 address.
| using eprosima::safedds::transport::Locator::MAC = memory::container::Array<uint8_t, MAC_ADDRESS_SIZE> |
Type for MAC address.
|
strong |
Locator.kind values reserved for known transport types.
| Enumerator | |
|---|---|
| INVALID | |
| RESERVED | |
| UDPv4 | |
| UDPv6 | |
| ETHERNET | |
| CUSTOM | |
|
staticnoexcept |
Get Locator from IPv4 address.
| locator_ipv4 | IPv4 address. |
| locator_port | port number. |
|
staticnoexcept |
Get Locator from MAC address, logical port, VLAN ID and PCP.
| mac_address | MAC address. |
| logical_port | port number. |
| vlan_id | VLAN ID. |
| pcp | Priority Code Point. |
|
noexcept |
Getter in Locator::IPv4 format.
| [out] | ipv4 | output ipv4. |
|
noexcept |
Getter in Locator::MAC format.
| [out] | mac | output MAC address. |
| memory::container::Array<uint8_t, ADDRESS_SIZE> eprosima::safedds::transport::Locator::address |
Net address, size compatible with IPV4 and IPV6.
|
staticconstexpr |
Address position of first IPv4 octet.
|
staticconstexpr |
Address position of second IPv4 octet.
|
staticconstexpr |
Address position of third IPv4 octet.
|
staticconstexpr |
Address position of fourth IPv4 octet.
|
staticconstexpr |
Address position of first MAC octet.
|
staticconstexpr |
Address position of second MAC octet.
|
staticconstexpr |
Address position of third MAC octet.
|
staticconstexpr |
Address position of fourth MAC octet.
|
staticconstexpr |
Address position of fifth MAC octet.
|
staticconstexpr |
Address position of sixth MAC octet.
|
staticconstexpr |
Size of locator address octet array.
|
staticconstexpr |
CDR serialized size.
| LocatorKind eprosima::safedds::transport::Locator::kind |
Kind of locator.
|
staticconstexpr |
Size of MAC address octet array.
|
staticconstexpr |
Position of first MAC octet.
|
staticconstexpr |
Position of second MAC octet.
|
staticconstexpr |
Position of third MAC octet.
|
staticconstexpr |
Position of fourth MAC octet.
|
staticconstexpr |
Position of fifth MAC octet.
|
staticconstexpr |
Position of sixth MAC octet (prevent magic number detection by clang-tidy)
|
staticconstexpr |
Mask for Priority Code Point in port field.
|
staticconstexpr |
Maximum value for Priority Code Point (3 bits)
|
staticconstexpr |
Shift for Priority Code Point in port field.
| uint32_t eprosima::safedds::transport::Locator::port |
Net port value.
|
staticconstexpr |
Mask for VLAN ID in port field.
|
staticconstexpr |
Maximum value for VLAN ID (12 bits)
|
staticconstexpr |
Shift for VLAN ID in port field.