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

Class used to test the neighbor discovery protocol API. More...

Inheritance diagram for NdpTest:
Collaboration diagram for NdpTest:

Public Member Functions

void SetUp () override
 set up the test fixture, the router answers every solicitation to the solicitor.
 
void TearDown () override
 tear down the test fixture.
 

Static Public Member Functions

static void SetUpTestCase ()
 set up test case.
 
static void TearDownTestCase ()
 tear down test case.
 

Static Protected Member Functions

static RouterAdvertisement settings ()
 get the advertisement the router sends.
 
static void checkSettings (const RouterAdvertisement &advert)
 check that an advertisement carries what the router sends.
 
static void inject (const std::string &wire, const IpAddress &destination, int hop=Ndp::hopLimit, const IpAddress &source=IpAddress::ipv6Wildcard)
 put raw bytes on the link, bypassing the library.
 
static std::string wireOf (const RouterAdvertisement &advert)
 serialize an advertisement.
 

Protected Attributes

Inbox< RouterSolicitation > _solicitations
 solicitations received by the router.
 
Ndp::Server _server {_device}
 router, destroyed before the solicitations its listener records.
 

Static Protected Attributes

static const std::string _device = "ndp0"
 interface name.
 
static const std::string _mac = "4e:ed:ed:ee:59:db"
 hardware address of the interface.
 
static const std::string _router = "fe80::4ced:edff:feee:59db"
 link-local address of the interface.
 
static const std::string _global = "2a01:e34:ed42:a680::1"
 global address of the interface.
 
static const int _mtu = 9000
 MTU of the interface.
 
static const std::chrono::milliseconds timeout = std::chrono::seconds (5)
 timeout.
 

Detailed Description

Class used to test the neighbor discovery protocol API.

Member Function Documentation

◆ checkSettings()

static void NdpTest::checkSettings ( const RouterAdvertisement & advert)
inlinestaticprotected

check that an advertisement carries what the router sends.

Parameters
advertadvertisement to check.

◆ inject()

static void NdpTest::inject ( const std::string & wire,
const IpAddress & destination,
int hop = Ndp::hopLimit,
const IpAddress & source = IpAddress::ipv6Wildcard )
inlinestaticprotected

put raw bytes on the link, bypassing the library.

Parameters
wiremessage to write.
destinationdestination address.
hophop limit to send the message with.
sourcesource address, wildcard to let the stack choose.

◆ settings()

static RouterAdvertisement NdpTest::settings ( )
inlinestaticprotected

get the advertisement the router sends.

Returns
the advertisement.

◆ SetUp()

void NdpTest::SetUp ( )
inlineoverride

set up the test fixture, the router answers every solicitation to the solicitor.

◆ SetUpTestCase()

static void NdpTest::SetUpTestCase ( )
inlinestatic

set up test case.

◆ TearDown()

void NdpTest::TearDown ( )
inlineoverride

tear down the test fixture.

◆ TearDownTestCase()

static void NdpTest::TearDownTestCase ( )
inlinestatic

tear down test case.

◆ wireOf()

static std::string NdpTest::wireOf ( const RouterAdvertisement & advert)
inlinestaticprotected

serialize an advertisement.

Parameters
advertadvertisement to serialize.
Returns
the serialized advertisement.

Member Data Documentation

◆ _device

const std::string NdpTest::_device = "ndp0"
staticprotected

interface name.

◆ _global

const std::string NdpTest::_global = "2a01:e34:ed42:a680::1"
staticprotected

global address of the interface.

◆ _mac

const std::string NdpTest::_mac = "4e:ed:ed:ee:59:db"
staticprotected

hardware address of the interface.

◆ _mtu

const int NdpTest::_mtu = 9000
staticprotected

MTU of the interface.

◆ _router

const std::string NdpTest::_router = "fe80::4ced:edff:feee:59db"
staticprotected

link-local address of the interface.

◆ _server

Ndp::Server NdpTest::_server {_device}
protected

router, destroyed before the solicitations its listener records.

◆ _solicitations

Inbox<RouterSolicitation> NdpTest::_solicitations
protected

solicitations received by the router.

◆ timeout

const std::chrono::milliseconds NdpTest::timeout = std::chrono::seconds (5)
staticprotected

timeout.


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