Public Member Functions | |
def | __init__ |
def | set_top_block |
def | phy_rx_callback |
Invoked by thread associated with PHY to pass received packet up. | |
def | main_loop |
Main loop for MAC. | |
Public Attributes | |
tun_fd | |
verbose | |
tb |
Reads packets from the TUN/TAP interface, and sends them to the PHY. Receives packets from the PHY via phy_rx_callback, and sends them into the TUN/TAP interface.
Of course, we're not restricted to getting packets via TUN/TAP, this is just an example.
def tunnel::cs_mac::__init__ | ( | self, | ||
tun_fd, | ||||
verbose = False | ||||
) |
def tunnel::cs_mac::main_loop | ( | self | ) |
Main loop for MAC.
Only returns if we get an error reading from TUN.
FIXME: may want to check for EINTR and EAGAIN and reissue read
def tunnel::cs_mac::phy_rx_callback | ( | self, | ||
ok, | ||||
payload | ||||
) |
Invoked by thread associated with PHY to pass received packet up.
ok,: | bool indicating whether payload CRC was OK | |
payload,: | contents of the packet (string) |
def tunnel::cs_mac::set_top_block | ( | self, | ||
tb | ||||
) |