ARP protocol class.
More...
#include <arp.hpp>
|
| template<typename Rep , typename Period > |
| static MacAddress | get (const std::string &interface, const IpAddress &ip, std::chrono::duration< Rep, Period > timeout) |
| | discover the MAC address for the given internet layer address.
|
| |
| static MacAddress | get (const std::string &interface, const IpAddress &ip) |
| | discover the MAC address for the given internet layer address.
|
| |
| template<typename Rep , typename Period > |
| static MacAddress | request (const std::string &interface, const IpAddress &ip, std::chrono::duration< Rep, Period > timeout) |
| | get the MAC address for the given IP address using ARP request.
|
| |
| static MacAddress | request (const std::string &interface, const IpAddress &ip) |
| | get the MAC address for the given IP address using ARP request.
|
| |
| static int | add (const std::string &interface, const MacAddress &mac, const IpAddress &ip) |
| | add entry the MAC address of the given IP address to ARP cache.
|
| |
| static int | remove (const std::string &interface, const IpAddress &ip) |
| | remove the MAC address of the given IP address from ARP cache.
|
| |
| static MacAddress | cache (const std::string &interface, const IpAddress &ip) |
| | get the MAC address for the given IP address using ARP cache.
|
| |
|
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.
|
| |
◆ Arp() [1/4]
◆ Arp() [2/4]
create the Arp instance.
- Parameters
-
- Exceptions
-
| std::system_error | if the interface is unknown or the socket could not be bound to it. |
◆ Arp() [3/4]
| join::Arp::Arp |
( |
const Arp & | other | ) |
|
|
delete |
create instance by copy.
- Parameters
-
| other | other interface to copy. |
◆ Arp() [4/4]
| join::Arp::Arp |
( |
Arp && | other | ) |
|
|
delete |
create instance by move.
- Parameters
-
| other | other interface to move. |
◆ ~Arp()
destroy the Arp instance.
◆ add() [1/2]
add entry the MAC address of the given IP address to ARP cache.
- Parameters
-
| mac | MAC address. |
| ip | IP address. |
- Returns
- 0 on success, -1 on failure.
◆ add() [2/2]
add entry the MAC address of the given IP address to ARP cache.
- Parameters
-
| interface | interface name. |
| mac | MAC address. |
| ip | IP address. |
- Returns
- 0 on success, -1 on failure.
◆ cache() [1/2]
get the MAC address for the given IP address using ARP cache.
- Parameters
-
- Returns
- the MAC address.
◆ cache() [2/2]
get the MAC address for the given IP address using ARP cache.
- Parameters
-
| interface | interface name. |
| ip | IP address. |
- Returns
- the MAC address.
◆ get() [1/4]
get the MAC address for the given IP address using ARP cache or ARP request.
- Parameters
-
- Returns
- the MAC address.
◆ get() [2/4]
template<typename Rep , typename Period >
| MacAddress join::Arp::get |
( |
const IpAddress & | ip, |
|
|
std::chrono::duration< Rep, Period > | timeout ) |
|
inline |
get the MAC address for the given IP address using netlink neighbor cache or ARP request.
- Parameters
-
| ip | IP address. |
| timeout | request timeout. |
- Returns
- the MAC address.
◆ get() [3/4]
discover the MAC address for the given internet layer address.
- Parameters
-
| interface | interface name. |
| ip | IP address. |
- Returns
- the MAC address.
◆ get() [4/4]
template<typename Rep , typename Period >
| static MacAddress join::Arp::get |
( |
const std::string & | interface, |
|
|
const IpAddress & | ip, |
|
|
std::chrono::duration< Rep, Period > | timeout ) |
|
inlinestatic |
discover the MAC address for the given internet layer address.
- Parameters
-
| interface | interface name. |
| ip | IP address. |
| timeout | request timeout. |
- Returns
- the MAC address.
◆ operator=() [1/2]
| Arp & join::Arp::operator= |
( |
Arp && | other | ) |
|
|
delete |
assign instance by move.
- Parameters
-
| other | other interface to move. |
- Returns
- A reference of the current object.
◆ operator=() [2/2]
| Arp & join::Arp::operator= |
( |
const Arp & | other | ) |
|
|
delete |
assign instance by copy.
- Parameters
-
| other | other interface to copy. |
- Returns
- A reference of the current object.
◆ remove() [1/2]
remove the MAC address of the given IP address from ARP cache.
- Parameters
-
- Returns
- 0 on success, -1 on failure.
◆ remove() [2/2]
| int Arp::remove |
( |
const std::string & | interface, |
|
|
const IpAddress & | ip ) |
|
static |
remove the MAC address of the given IP address from ARP cache.
- Parameters
-
| interface | interface name. |
| ip | IP address. |
- Returns
- 0 on success, -1 on failure.
◆ request() [1/4]
get the MAC address for the given IP address using ARP request.
- Parameters
-
- Returns
- the MAC address.
◆ request() [2/4]
template<typename Rep , typename Period >
| MacAddress join::Arp::request |
( |
const IpAddress & | ip, |
|
|
std::chrono::duration< Rep, Period > | timeout ) |
|
inline |
get the MAC address for the given IP address using ARP request.
- Parameters
-
| ip | IP address. |
| timeout | request timeout. |
- Returns
- the MAC address.
◆ request() [3/4]
get the MAC address for the given IP address using ARP request.
- Parameters
-
| interface | interface name. |
| ip | IP address. |
- Returns
- the MAC address.
◆ request() [4/4]
template<typename Rep , typename Period >
| static MacAddress join::Arp::request |
( |
const std::string & | interface, |
|
|
const IpAddress & | ip, |
|
|
std::chrono::duration< Rep, Period > | timeout ) |
|
inlinestatic |
get the MAC address for the given IP address using ARP request.
- Parameters
-
| interface | interface name. |
| ip | IP address. |
| timeout | request timeout. |
- Returns
- the MAC address.
The documentation for this class was generated from the following files: