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

Class used to test the messages only a link peer can forge. More...

Inheritance diagram for NdpLinkTest:
Collaboration diagram for NdpLinkTest:

Public Member Functions

void SetUp () override
 set up the test fixture.
 
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.
 

Protected Member Functions

struct __attribute__ ((packed)) Pseudo
 header the ICMPv6 checksum is computed over, RFC 8200 section 8.1.
 

Static Protected Member Functions

static std::string frameOf (std::string icmp, const IpAddress &destination, const MacAddress &mac)
 frame an ICMPv6 message sent from the unspecified address.
 
static std::string solicitationOf (bool link)
 frame a router solicitation sent from the unspecified address.
 
static std::string neighborSolicitationOf (bool link)
 frame a neighbor solicitation sent from the unspecified address.
 
static std::string neighborAdvertisementOf (bool link)
 frame a neighbor advertisement sent from the unspecified address to all the nodes.
 
static void inject (const std::string &frame)
 put a frame on the wire, bypassing the IPv6 stack.
 

Protected Attributes

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

Static Protected Attributes

static const std::string _sender = "ndpa"
 interface the frames are written on.
 
static const std::string _receiver = "ndpb"
 interface the router listens on.
 
static const std::string _target = "2001:db8:24::2"
 address the receiving interface owns.
 

Detailed Description

Class used to test the messages only a link peer can forge.

Member Function Documentation

◆ __attribute__()

struct NdpLinkTest::__attribute__ ( (packed) )
inlineprotected

header the ICMPv6 checksum is computed over, RFC 8200 section 8.1.

◆ frameOf()

static std::string NdpLinkTest::frameOf ( std::string icmp,
const IpAddress & destination,
const MacAddress & mac )
inlinestaticprotected

frame an ICMPv6 message sent from the unspecified address.

Parameters
icmpmessage, its checksum is computed here.
destinationdestination address.
macdestination hardware address.
Returns
the frame.

◆ inject()

static void NdpLinkTest::inject ( const std::string & frame)
inlinestaticprotected

put a frame on the wire, bypassing the IPv6 stack.

Parameters
frameframe to write.

◆ neighborAdvertisementOf()

static std::string NdpLinkTest::neighborAdvertisementOf ( bool link)
inlinestaticprotected

frame a neighbor advertisement sent from the unspecified address to all the nodes.

Parameters
linkcarry the link layer address of the target.
Returns
the frame.

◆ neighborSolicitationOf()

static std::string NdpLinkTest::neighborSolicitationOf ( bool link)
inlinestaticprotected

frame a neighbor solicitation sent from the unspecified address.

Parameters
linkcarry the link layer address of the sender.
Returns
the frame.

◆ SetUp()

void NdpLinkTest::SetUp ( )
inlineoverride

set up the test fixture.

◆ SetUpTestCase()

static void NdpLinkTest::SetUpTestCase ( )
inlinestatic

set up test case.

◆ solicitationOf()

static std::string NdpLinkTest::solicitationOf ( bool link)
inlinestaticprotected

frame a router solicitation sent from the unspecified address.

Parameters
linkcarry the link layer address of the sender.
Returns
the frame.

◆ TearDown()

void NdpLinkTest::TearDown ( )
inlineoverride

tear down the test fixture.

◆ TearDownTestCase()

static void NdpLinkTest::TearDownTestCase ( )
inlinestatic

tear down test case.

Member Data Documentation

◆ _receiver

const std::string NdpLinkTest::_receiver = "ndpb"
staticprotected

interface the router listens on.

◆ _sender

const std::string NdpLinkTest::_sender = "ndpa"
staticprotected

interface the frames are written on.

◆ _server

Ndp::Server NdpLinkTest::_server {_receiver}
protected

router, destroyed before the solicitations its listener records.

◆ _solicitations

Inbox<RouterSolicitation> NdpLinkTest::_solicitations
protected

solicitations received by the router.

◆ _target

const std::string NdpLinkTest::_target = "2001:db8:24::2"
staticprotected

address the receiving interface owns.


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