llmx-rtaco 0.0.1
RTNL-only netlink control-plane library for Linux (C++23).
Loading...
Searching...
No Matches
llmx::rtaco::Endpoint< Protocol > Class Template Reference

Netlink-specific endpoint wrapper for Boost.Asio. More...

#include <nl_protocol.hxx>

Public Types

using protocol_type = Protocol
using data_type = boost::asio::detail::socket_addr_type

Public Member Functions

 Endpoint () noexcept
 Default construct an Endpoint with unspecified pid/groups.
 Endpoint (uint32_t groups, uint32_t pid=AF_UNSPEC) noexcept
 Construct an Endpoint for the given multicast groups and pid.
 Endpoint (const Endpoint &other) noexcept=default
Endpointoperator= (const Endpoint &other) noexcept=default
auto protocol () const noexcept -> protocol_type
 Return the protocol type instance for this endpoint.
auto data () noexcept -> data_type *
 Get mutable pointer to raw socket address storage.
auto data () const noexcept -> const data_type *
 Get const pointer to raw socket address storage.
auto size () const noexcept -> size_t
 Size of this endpoint's address structure.
void resize (size_t) noexcept
auto capacity () const noexcept -> size_t
 Capacity of the address storage.

Private Attributes

sockaddr_nl sockaddr_ {}

Friends

bool operator== (const Endpoint &lhs, const Endpoint &rhs) noexcept
bool operator!= (const Endpoint &lhs, const Endpoint &rhs) noexcept
bool operator< (const Endpoint &lhs, const Endpoint &rhs) noexcept
bool operator> (const Endpoint &lhs, const Endpoint &rhs) noexcept
bool operator<= (const Endpoint &lhs, const Endpoint &rhs) noexcept
bool operator>= (const Endpoint &lhs, const Endpoint &rhs) noexcept

Detailed Description

template<typename Protocol>
class llmx::rtaco::Endpoint< Protocol >

Netlink-specific endpoint wrapper for Boost.Asio.

Encapsulates a sockaddr_nl instance and provides the interface required by Boost.Asio raw socket types (data/size/capacity, etc.).

Member Typedef Documentation

◆ data_type

template<typename Protocol>
using llmx::rtaco::Endpoint< Protocol >::data_type = boost::asio::detail::socket_addr_type

◆ protocol_type

template<typename Protocol>
using llmx::rtaco::Endpoint< Protocol >::protocol_type = Protocol

Constructor & Destructor Documentation

◆ Endpoint() [1/3]

template<typename Protocol>
llmx::rtaco::Endpoint< Protocol >::Endpoint ( )
inlinenoexcept

Default construct an Endpoint with unspecified pid/groups.

◆ Endpoint() [2/3]

template<typename Protocol>
llmx::rtaco::Endpoint< Protocol >::Endpoint ( uint32_t groups,
uint32_t pid = AF_UNSPEC )
inlinenoexcept

Construct an Endpoint for the given multicast groups and pid.

◆ Endpoint() [3/3]

template<typename Protocol>
llmx::rtaco::Endpoint< Protocol >::Endpoint ( const Endpoint< Protocol > & other)
defaultnoexcept

Member Function Documentation

◆ capacity()

template<typename Protocol>
auto llmx::rtaco::Endpoint< Protocol >::capacity ( ) const -> size_t
inlinenoexcept

Capacity of the address storage.

◆ data() [1/2]

template<typename Protocol>
auto llmx::rtaco::Endpoint< Protocol >::data ( ) const -> const data_type *
inlinenoexcept

Get const pointer to raw socket address storage.

◆ data() [2/2]

template<typename Protocol>
auto llmx::rtaco::Endpoint< Protocol >::data ( ) -> data_type *
inlinenoexcept

Get mutable pointer to raw socket address storage.

◆ operator=()

template<typename Protocol>
Endpoint & llmx::rtaco::Endpoint< Protocol >::operator= ( const Endpoint< Protocol > & other)
defaultnoexcept

◆ protocol()

template<typename Protocol>
auto llmx::rtaco::Endpoint< Protocol >::protocol ( ) const -> protocol_type
inlinenoexcept

Return the protocol type instance for this endpoint.

◆ resize()

template<typename Protocol>
void llmx::rtaco::Endpoint< Protocol >::resize ( size_t )
inlinenoexcept

◆ size()

template<typename Protocol>
auto llmx::rtaco::Endpoint< Protocol >::size ( ) const -> size_t
inlinenoexcept

Size of this endpoint's address structure.

◆ operator!=

template<typename Protocol>
bool operator!= ( const Endpoint< Protocol > & lhs,
const Endpoint< Protocol > & rhs )
friend

◆ operator<

template<typename Protocol>
bool operator< ( const Endpoint< Protocol > & lhs,
const Endpoint< Protocol > & rhs )
friend

◆ operator<=

template<typename Protocol>
bool operator<= ( const Endpoint< Protocol > & lhs,
const Endpoint< Protocol > & rhs )
friend

◆ operator==

template<typename Protocol>
bool operator== ( const Endpoint< Protocol > & lhs,
const Endpoint< Protocol > & rhs )
friend

◆ operator>

template<typename Protocol>
bool operator> ( const Endpoint< Protocol > & lhs,
const Endpoint< Protocol > & rhs )
friend

◆ operator>=

template<typename Protocol>
bool operator>= ( const Endpoint< Protocol > & lhs,
const Endpoint< Protocol > & rhs )
friend

Member Data Documentation

◆ sockaddr_

template<typename Protocol>
sockaddr_nl llmx::rtaco::Endpoint< Protocol >::sockaddr_ {}
private

The documentation for this class was generated from the following file: