join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
ndp_protocol.hpp
Go to the documentation of this file.
1
25#ifndef JOIN_FABRIC_NDP_PROTOCOL_HPP
26#define JOIN_FABRIC_NDP_PROTOCOL_HPP
27
28// libjoin.
29#include <join/socket.hpp>
30
31namespace join
32{
33 template <class Protocol>
34 class BasicNdp;
35
36 template <class Protocol>
38
39 template <class Protocol>
41
45 class Ndp
46 {
47 public:
48 using Transport = Icmp;
49 using Endpoint = typename Transport::Endpoint;
50 using Socket = typename Transport::Socket;
53
57 constexpr Ndp () noexcept
58 : _transport (AF_INET6)
59 {
60 }
61
66 constexpr int family () const noexcept
67 {
68 return _transport.family ();
69 }
70
75 constexpr int type () const noexcept
76 {
77 return _transport.type ();
78 }
79
84 constexpr int protocol () const noexcept
85 {
86 return _transport.protocol ();
87 }
88
90 static constexpr int hopLimit = 255;
91
93 static constexpr size_t maxMsgSize = 65535;
94
95 private:
97 Transport _transport;
98 };
99
106 constexpr bool operator== (const Ndp& a, const Ndp& b) noexcept
107 {
108 return a.family () == b.family ();
109 }
110}
111
112#endif
NDP client, solicits routers and receives their advertisements.
Definition ndp_protocol.hpp:37
NDP server, receives router solicitations and sends advertisements.
Definition ndp_protocol.hpp:40
carries NDP messages over an ICMPv6 socket.
Definition ndp_protocol.hpp:34
ICMP protocol class.
Definition protocol.hpp:365
constexpr int family() const noexcept
get the protocol IP address family.
Definition protocol.hpp:404
constexpr int protocol() const noexcept
get the protocol type.
Definition protocol.hpp:422
constexpr int type() const noexcept
get the protocol communication semantic.
Definition protocol.hpp:413
BasicInternetEndpoint< Icmp > Endpoint
Definition protocol.hpp:367
BasicDatagramSocket< Icmp > Socket
Definition protocol.hpp:368
neighbor discovery protocol class.
Definition ndp_protocol.hpp:46
typename Transport::Endpoint Endpoint
Definition ndp_protocol.hpp:49
constexpr int family() const noexcept
get the protocol IP address family.
Definition ndp_protocol.hpp:66
constexpr Ndp() noexcept
construct the NDP protocol instance.
Definition ndp_protocol.hpp:57
typename Transport::Socket Socket
Definition ndp_protocol.hpp:50
static constexpr size_t maxMsgSize
maximum NDP message size, the biggest payload an IPv6 packet can carry.
Definition ndp_protocol.hpp:93
constexpr int type() const noexcept
get the protocol communication semantic.
Definition ndp_protocol.hpp:75
constexpr int protocol() const noexcept
get the protocol type.
Definition ndp_protocol.hpp:84
static constexpr int hopLimit
hop limit every neighbor discovery message is sent and received with, RFC 4861 section 6....
Definition ndp_protocol.hpp:90
Definition acceptor.hpp:32
bool operator==(const BasicLinkLayerEndpoint< Protocol > &a, const BasicLinkLayerEndpoint< Protocol > &b) noexcept
compare if endpoints are equal.
Definition endpoint.hpp:196