Skip to content

Latest commit

 

History

History

Reversed

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Motivation

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 😂)

How to Use

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.

Code Layout

Impl.h/Impl.c

Store the shared global constaints and variables.

Init.c

Impl function protocol_init ()

event.c

Impl function wait_for_event ()

network.c

Impl function enable_network_layer (), disable_network_layer (), get_packe ()t, put_packet ()

physical.c

Impl function recv_frame (), send_frame (), phl_sq_len (), crc32 ()

timer.c

Impl function get_ms (), start_timer (), stop_timer (), start_ack_timer (), stop_ack_timer ()

log.c

Impl function log_printf (), lprintf (), station_name (), dbg_* ()

By the way

Just for fun. No Offense. Enjoy it :)