join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::Arp Class Reference

ARP protocol class. More...

#include <arp.hpp>

Public Member Functions

 Arp ()=delete
 create the Arp instance.
 
 Arp (const std::string &interface)
 create the Arp instance.
 
virtual ~Arp ()=default
 destroy the Arp instance.
 
MacAddress get (const IpAddress &ip)
 get the MAC address for the given IP address using ARP cache or ARP request.
 
MacAddress request (const IpAddress &ip)
 get the MAC address for the given IP address using ARP request.
 
int add (const MacAddress &mac, const IpAddress &ip)
 add entry the MAC address of the given IP address to ARP cache.
 
MacAddress cache (const IpAddress &ip)
 get the MAC address for the given IP address using ARP cache.
 

Static Public Member Functions

static MacAddress get (const IpAddress &ip, const std::string &interface)
 discover the MAC address for the given internet layer address.
 
static MacAddress request (const IpAddress &ip, const std::string &interface)
 get the MAC address for the given IP address using ARP request.
 
static int add (const MacAddress &mac, const IpAddress &ip, const std::string &interface)
 add entry the MAC address of the given IP address to ARP cache.
 
static MacAddress cache (const IpAddress &ip, const std::string &interface)
 get the MAC address for the given IP address using ARP cache.
 

Detailed Description

ARP protocol class.

Constructor & Destructor Documentation

◆ Arp() [1/2]

join::Arp::Arp ( )
delete

create the Arp instance.

◆ Arp() [2/2]

Arp::Arp ( const std::string & interface)

create the Arp instance.

Parameters
interfaceinterface name.

◆ ~Arp()

virtual join::Arp::~Arp ( )
virtualdefault

destroy the Arp instance.

Member Function Documentation

◆ add() [1/2]

int Arp::add ( const MacAddress & mac,
const IpAddress & ip )

add entry the MAC address of the given IP address to ARP cache.

Parameters
ipMAC address.
ipIP address.
Returns
0 on success, -1 on failure.

◆ add() [2/2]

int Arp::add ( const MacAddress & mac,
const IpAddress & ip,
const std::string & interface )
static

add entry the MAC address of the given IP address to ARP cache.

Parameters
ipMAC address.
ipIP address.
interfaceinterface name.
Returns
0 on success, -1 on failure.

◆ cache() [1/2]

MacAddress Arp::cache ( const IpAddress & ip)

get the MAC address for the given IP address using ARP cache.

Parameters
ipIP address.
Returns
the MAC address.

◆ cache() [2/2]

MacAddress Arp::cache ( const IpAddress & ip,
const std::string & interface )
static

get the MAC address for the given IP address using ARP cache.

Parameters
ipIP address.
interfaceinterface name.
Returns
the MAC address.

◆ get() [1/2]

MacAddress Arp::get ( const IpAddress & ip)

get the MAC address for the given IP address using ARP cache or ARP request.

Parameters
ipIP address.
Returns
the MAC address.

◆ get() [2/2]

MacAddress Arp::get ( const IpAddress & ip,
const std::string & interface )
static

discover the MAC address for the given internet layer address.

Parameters
ipIP address.
interfaceinterface name.
Returns
the MAC address.

◆ request() [1/2]

MacAddress Arp::request ( const IpAddress & ip)

get the MAC address for the given IP address using ARP request.

Parameters
ipIP address.
Returns
the MAC address.

◆ request() [2/2]

MacAddress Arp::request ( const IpAddress & ip,
const std::string & interface )
static

get the MAC address for the given IP address using ARP request.

Parameters
ipIP address.
interfaceinterface name.
Returns
the MAC address.

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