Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::com::option::Ipv4EndpointOption Class Reference

IPv4 endpoint option for both generic and service discovery purposes. More...

#include <ipv4_endpoint_option.h>

Inheritance diagram for ara::com::option::Ipv4EndpointOption:
ara::com::option::Option

Public Member Functions

virtual uint16_t Length () const noexcept override
 Get option length. More...
 
helper::Ipv4Address IpAddress () const noexcept
 Get IP address. More...
 
Layer4ProtocolType L4Proto () const noexcept
 Get protocol. More...
 
uint16_t Port () const noexcept
 Get port. More...
 
virtual std::vector< uint8_t > Payload () const override
 Get option payload. More...
 
- Public Member Functions inherited from ara::com::option::Option
OptionType Type () const noexcept
 Get option type. More...
 
bool Discardable () const noexcept
 Get discardable flag. More...
 

Static Public Member Functions

static std::unique_ptr< Ipv4EndpointOptionCreateUnitcastEndpoint (bool discardable, helper::Ipv4Address ipAddress, Layer4ProtocolType protocol, uint16_t port) noexcept
 Unitcast endpoint factory. More...
 
static std::unique_ptr< Ipv4EndpointOptionCreateMulticastEndpoint (bool discardable, helper::Ipv4Address ipAddress, uint16_t port)
 Multicast endpoint factory. More...
 
static std::unique_ptr< Ipv4EndpointOptionCreateSdEndpoint (bool discardable, helper::Ipv4Address ipAddress, Layer4ProtocolType protocol=cDefaultSdProtocol, uint16_t port=cDefaultSdPort) noexcept
 Service discovery factroy. More...
 
static std::unique_ptr< Ipv4EndpointOptionDeserialize (const std::vector< uint8_t > &payload, std::size_t &offset, OptionType type, bool discardable)
 Deserialize an option payload. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ara::com::option::Option
constexpr Option (OptionType type, bool discardable) noexcept
 Constructor. More...
 
std::vector< uint8_t > BasePayload () const
 Get base option payload. More...
 

Detailed Description

IPv4 endpoint option for both generic and service discovery purposes.

Member Function Documentation

◆ CreateMulticastEndpoint()

std::unique_ptr< Ipv4EndpointOption > ara::com::option::Ipv4EndpointOption::CreateMulticastEndpoint ( bool  discardable,
helper::Ipv4Address  ipAddress,
uint16_t  port 
)
static

Multicast endpoint factory.

Parameters
discardableIndicates whether the option can be discarded or not
ipAddressIP address
portPort number
Returns
Multicast IPv4 endpoint

◆ CreateSdEndpoint()

std::unique_ptr< Ipv4EndpointOption > ara::com::option::Ipv4EndpointOption::CreateSdEndpoint ( bool  discardable,
helper::Ipv4Address  ipAddress,
Layer4ProtocolType  protocol = cDefaultSdProtocol,
uint16_t  port = cDefaultSdPort 
)
staticnoexcept

Service discovery factroy.

Parameters
discardableIndicates whether the option can be discarded or not
ipAddressIP address
protocolLayer-4 protocol
portPort number
Returns
Service discovery IPv4 endpoint

◆ CreateUnitcastEndpoint()

std::unique_ptr< Ipv4EndpointOption > ara::com::option::Ipv4EndpointOption::CreateUnitcastEndpoint ( bool  discardable,
helper::Ipv4Address  ipAddress,
Layer4ProtocolType  protocol,
uint16_t  port 
)
staticnoexcept

Unitcast endpoint factory.

Parameters
discardableIndicates whether the option can be discarded or not
ipAddressIP address
protocolLayer-4 protocol
portPort number
Returns
Unicast IPv4 endpoint

◆ Deserialize()

std::unique_ptr< Ipv4EndpointOption > ara::com::option::Ipv4EndpointOption::Deserialize ( const std::vector< uint8_t > &  payload,
std::size_t &  offset,
OptionType  type,
bool  discardable 
)
static

Deserialize an option payload.

Parameters
payloadSerialized option payload byte array
offsetDeserializing offset in the payload
typeIPv4 endpoint option type
discardableIndicates whether the option can be discarded or not
Returns
Deserialized option
Exceptions
std::out_of_rangeThrows when the option type is not an IPv4 endpoint

◆ IpAddress()

helper::Ipv4Address ara::com::option::Ipv4EndpointOption::IpAddress ( ) const
noexcept

Get IP address.

Returns
IPv4 address

◆ L4Proto()

Layer4ProtocolType ara::com::option::Ipv4EndpointOption::L4Proto ( ) const
noexcept

Get protocol.

Returns
OSI layer-4 protocol

◆ Length()

uint16_t ara::com::option::Ipv4EndpointOption::Length ( ) const
overridevirtualnoexcept

Get option length.

Returns
Option length in bytes

Implements ara::com::option::Option.

◆ Payload()

std::vector< uint8_t > ara::com::option::Ipv4EndpointOption::Payload ( ) const
overridevirtual

Get option payload.

Returns
Byte array

Implements ara::com::option::Option.

◆ Port()

uint16_t ara::com::option::Ipv4EndpointOption::Port ( ) const
noexcept

Get port.

Returns
Network port number