|
| using | Socket = typename Protocol::Socket |
| |
| using | Endpoint = typename Protocol::Endpoint |
| |
| using | NeighborSolicitationNotify = Function<void (const NeighborSolicitation& solicitation)> |
| | neighbor solicitation notification callback.
|
| |
| using | NeighborAdvertisementNotify = Function<void (const NeighborAdvertisement& advert)> |
| | neighbor advertisement notification callback.
|
| |
| void | attach () |
| | register with the reactor, to be called by the final class once fully constructed.
|
| |
| void | detach () noexcept |
| | unregister from the reactor, to be called by the final class before destruction starts.
|
| |
| int | applyFilter (uint8_t type, bool pass) noexcept |
| | pass or block a message type in the ICMPv6 filter.
|
| |
| int | send (const char *data, size_t size, const IpAddress &destination) |
| | write a message on the interface.
|
| |
| ssize_t | receive (char *data, size_t maxSize, IpAddress &from) |
| | read a message that passed the checks common to every NDP message.
|
| |
| bool | onNeighborMessage (size_t size, const IpAddress &from) noexcept |
| | hand a received neighbor message to its listener, and an advertisement to the solicitations waiting for it.
|
| |
| | BasicNdp ()=delete |
| | create the BasicNdp instance.
|
| |
| | BasicNdp (const std::string &interface, uint8_t filter, const IpAddress &group, Reactor &reactor) |
| | create the instance bound to the given interface.
|
| |
| | BasicNdp (const BasicNdp &other)=delete |
| | create instance by copy.
|
| |
| BasicNdp & | operator= (const BasicNdp &other)=delete |
| | assign instance by copy.
|
| |
| | BasicNdp (BasicNdp &&other)=delete |
| | create instance by move.
|
| |
| BasicNdp & | operator= (BasicNdp &&other)=delete |
| | assign instance by move.
|
| |
| virtual | ~BasicNdp ()=default |
| | destroy the instance.
|
| |
| int | neighborSolicit (const IpAddress &target, NeighborAdvertisement &advert, std::chrono::milliseconds timeout=std::chrono::seconds(1)) noexcept |
| | send a neighbor solicitation and wait for the advertisement of the target.
|
| |
| int | neighborAdvertise (const NeighborAdvertisement &advert, const IpAddress &destination=IpAddress::ipv6AllNodes) noexcept |
| | send a neighbor advertisement, the interface hardware address is used if it carries none.
|
| |
| int | neighborAdvertise (const NeighborAdvertisement &advert, const NeighborSolicitation &solicitation) noexcept |
| | answer a neighbor solicitation, to the solicitor or to all the nodes of the link if it has no address.
|
| |
| int | setNeighborSolicitationListener (NeighborSolicitationNotify cb) noexcept |
| | set the callback called on every neighbor solicitation received.
|
| |
| int | unsetNeighborSolicitationListener () noexcept |
| | unset the neighbor solicitation callback, it is no longer called once this returns.
|
| |
| int | setNeighborAdvertisementListener (NeighborAdvertisementNotify cb) noexcept |
| | set the callback called on every neighbor advertisement received, solicited or not.
|
| |
| int | unsetNeighborAdvertisementListener () noexcept |
| | unset the neighbor advertisement callback, it is no longer called once this returns.
|
| |
| const std::string & | interface () const noexcept |
| | get the name of the interface the instance is bound to.
|
| |
| unsigned int | index () const noexcept |
| | get the index of the interface the instance is bound to.
|
| |
| const MacAddress & | hardware () const noexcept |
| | get the hardware address of the interface the instance is bound to.
|
| |
Protected Member Functions inherited from join::EventHandler |
| virtual void | onEvent (int fd, uint32_t revents) |
| | method called when events are reported on handle.
|
| |
| virtual void | onWriteable (int fd) |
| | method called when data are ready to be written on handle.
|
| |
| virtual void | onClose (int fd) |
| | method called when handle was closed by the peer.
|
| |
| virtual void | onError (int fd) |
| | method called when an error occurred on handle.
|
| |
| | EventHandler ()=default |
| | create instance.
|
| |
| | EventHandler (const EventHandler &other)=default |
| | copy constructor.
|
| |
| EventHandler & | operator= (const EventHandler &other)=default |
| | copy assignment operator.
|
| |
| | EventHandler (EventHandler &&other)=default |
| | move constructor.
|
| |
| EventHandler & | operator= (EventHandler &&other)=default |
| | move assignment operator.
|
| |
| virtual | ~EventHandler ()=default |
| | destroy instance.
|
| |
| static unsigned int | lookup (const std::string &interface) |
| | get the index of the given interface.
|
| |
| Socket | _socket |
| | underlying socket.
|
| |
| NdpMessage | _message |
| | NDP message codec.
|
| |
| std::unique_ptr< char[]> | _buffer |
| | receive buffer.
|
| |
| const std::string | _interface |
| | interface name.
|
| |
| const unsigned int | _index |
| | interface index.
|
| |
| const MacAddress | _hardware |
| | hardware address of the interface.
|
| |
| Reactor & | _reactor |
| | event loop reactor.
|
| |
| struct icmp6_filter | _filter |
| | ICMPv6 filter applied to the socket, only accessed from the reactor thread once constructed.
|
| |
| std::vector< NeighborRequest * > | _neighborPending |
| | neighbor solicitations waiting for an advertisement, only accessed from the reactor thread.
|
| |
| Mutex | _neighborMutex |
| | neighbor solicitations protection mutex.
|
| |
| NeighborSolicitationNotify | _neighborSolicitationListener |
| | neighbor solicitation listener, only accessed from the reactor thread.
|
| |
| bool | _neighborSolicitationCalling = false |
| |
| NeighborAdvertisementNotify | _neighborAdvertisementListener |
| | neighbor advertisement listener, only accessed from the reactor thread.
|
| |
| bool | _neighborAdvertisementCalling = false |
| |
template<class Protocol>
class join::BasicNdpServer< Protocol >
NDP server, receives router solicitations and sends advertisements.