Sponge
CS144's user-space TCP library
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Host Class Reference

Public Member Functions

 Host (const string &name, const Address &my_address, const Address &next_hop)
 
const Addressaddress ()
 
void check ()
 
void expect (const InternetDatagram &expected)
 
AsyncNetworkInterfaceinterface ()
 
const stringname ()
 
InternetDatagram send_to (const Address &destination, const uint8_t ttl=64)
 

Private Member Functions

bool expecting (const InternetDatagram &expected) const
 
void remove_expectation (const InternetDatagram &expected)
 

Private Attributes

std::list< InternetDatagram_expecting_to_receive {}
 
AsyncNetworkInterface _interface
 
Address _my_address
 
string _name
 
Address _next_hop
 

Detailed Description

Definition at line 73 of file network_simulator.cc.

Constructor & Destructor Documentation

◆ Host()

Host::Host ( const string name,
const Address my_address,
const Address next_hop 
)
inline

Definition at line 100 of file network_simulator.cc.

Member Function Documentation

◆ address()

const Address& Host::address ( )
inline

Definition at line 122 of file network_simulator.cc.

◆ check()

void Host::check ( )
inline

Definition at line 130 of file network_simulator.cc.

◆ expect()

void Host::expect ( const InternetDatagram expected)
inline

Definition at line 126 of file network_simulator.cc.

◆ expecting()

bool Host::expecting ( const InternetDatagram expected) const
inlineprivate

Definition at line 81 of file network_simulator.cc.

◆ interface()

AsyncNetworkInterface& Host::interface ( )
inline

Definition at line 124 of file network_simulator.cc.

◆ name()

const string& Host::name ( )
inline

Definition at line 128 of file network_simulator.cc.

◆ remove_expectation()

void Host::remove_expectation ( const InternetDatagram expected)
inlineprivate

Definition at line 90 of file network_simulator.cc.

◆ send_to()

InternetDatagram Host::send_to ( const Address destination,
const uint8_t  ttl = 64 
)
inline

Definition at line 106 of file network_simulator.cc.

Member Data Documentation

◆ _expecting_to_receive

std::list<InternetDatagram> Host::_expecting_to_receive {}
private

Definition at line 79 of file network_simulator.cc.

◆ _interface

AsyncNetworkInterface Host::_interface
private

Definition at line 76 of file network_simulator.cc.

◆ _my_address

Address Host::_my_address
private

Definition at line 75 of file network_simulator.cc.

◆ _name

string Host::_name
private

Definition at line 74 of file network_simulator.cc.

◆ _next_hop

Address Host::_next_hop
private

Definition at line 77 of file network_simulator.cc.


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