Since the original Bupt Computer Network experiment simulator is a bit nasty
(in which the library calls exit (0);
to kill the caller :-( ),
I suppose that I need to do something to make it easier to debug our programe.
This code is reversely extracted from the orignal code (written by [email protected], without any copyright/copyleft 😂)
Just add "event.c, Impl.c, Impl.h, Init.c, log.c, network.c, physical.c, protocol.h, timer.c" to your current project, and everything will work in the same way as using dll/lib.
Store the shared global constaints and variables.
Impl function protocol_init ()
Impl function wait_for_event ()
Impl function enable_network_layer ()
, disable_network_layer ()
,
get_packe ()t
, put_packet ()
Impl function recv_frame ()
, send_frame ()
, phl_sq_len ()
, crc32 ()
Impl function get_ms ()
, start_timer ()
, stop_timer ()
,
start_ack_timer ()
, stop_ack_timer ()
Impl function log_printf ()
, lprintf ()
, station_name ()
, dbg_* ()
Just for fun. No Offense. Enjoy it :)