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

Public Member Functions

 Network ()
 
Hosthost (const string &name)
 
void simulate ()
 
void simulate_physical_connections ()
 

Private Member Functions

void deliver (const string &src_name, const queue< EthernetFrame > &src, const string &dst_name, AsyncNetworkInterface &dst)
 
void exchange_frames (const string &x_name, AsyncNetworkInterface &x, const string &y_name, AsyncNetworkInterface &y)
 
void exchange_frames (const string &x_name, AsyncNetworkInterface &x, const string &y_name, AsyncNetworkInterface &y, const string &z_name, AsyncNetworkInterface &z)
 

Private Attributes

std::unordered_map< string, Host_hosts {}
 
Router _router {}
 
size_t default_id
 
size_t eth0_id
 
size_t eth1_id
 
size_t eth2_id
 
size_t hs4_id
 
size_t mit5_id
 
size_t uun3_id
 

Detailed Description

Definition at line 150 of file network_simulator.cc.

Constructor & Destructor Documentation

◆ Network()

Network::Network ( )
inline

Definition at line 208 of file network_simulator.cc.

Member Function Documentation

◆ deliver()

void Network::deliver ( const string src_name,
const queue< EthernetFrame > &  src,
const string dst_name,
AsyncNetworkInterface dst 
)
inlineprivate

Definition at line 193 of file network_simulator.cc.

◆ exchange_frames() [1/2]

void Network::exchange_frames ( const string x_name,
AsyncNetworkInterface x,
const string y_name,
AsyncNetworkInterface y 
)
inlineprivate

Definition at line 158 of file network_simulator.cc.

◆ exchange_frames() [2/2]

void Network::exchange_frames ( const string x_name,
AsyncNetworkInterface x,
const string y_name,
AsyncNetworkInterface y,
const string z_name,
AsyncNetworkInterface z 
)
inlineprivate

Definition at line 171 of file network_simulator.cc.

◆ host()

Host& Network::host ( const string name)
inline

Definition at line 260 of file network_simulator.cc.

◆ simulate()

void Network::simulate ( )
inline

Definition at line 249 of file network_simulator.cc.

◆ simulate_physical_connections()

void Network::simulate_physical_connections ( )
inline

Definition at line 235 of file network_simulator.cc.

Member Data Documentation

◆ _hosts

std::unordered_map<string, Host> Network::_hosts {}
private

Definition at line 156 of file network_simulator.cc.

◆ _router

Router Network::_router {}
private

Definition at line 152 of file network_simulator.cc.

◆ default_id

size_t Network::default_id
private

Definition at line 154 of file network_simulator.cc.

◆ eth0_id

size_t Network::eth0_id
private

Definition at line 154 of file network_simulator.cc.

◆ eth1_id

size_t Network::eth1_id
private

Definition at line 154 of file network_simulator.cc.

◆ eth2_id

size_t Network::eth2_id
private

Definition at line 154 of file network_simulator.cc.

◆ hs4_id

size_t Network::hs4_id
private

Definition at line 154 of file network_simulator.cc.

◆ mit5_id

size_t Network::mit5_id
private

Definition at line 154 of file network_simulator.cc.

◆ uun3_id

size_t Network::uun3_id
private

Definition at line 154 of file network_simulator.cc.


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