Title: curr_time


curr_time, if non-zero, is the number of clock ticks since boot. This value is set either by get_time() or set_time().

Clients use get_time() when setting a timer. For example, the arp client calls get_time() when setting a timer to limit the amount of time it will wait for a system to respond to its arp packet.

set_time() is called by eth_rec(), which is called by the endless loop in main(). eth_rec() is called when a message is received from the ethernet task and the current time is extracted from this message.

The network service does not try to keep track of the current time. curr_time is set to zero (i.e., made invalid) each time around main()'s endless loop. (Note that reset_time() simply sets curr_time to zero.) If the current time is needed (and a message from the ethernet task wasn't just received), it is recalculated (by calling get_time()).