with various data-link layer, network layer, routing and transport layer networking protocols. It has been specifically developed for undergraduate teaching."> undergraduate, teaching"> TEXT ="black" LINK="blue" VLINK="purple">

cnet's layers and functions

Descriptions of cnet's core functions are available from here. In each section functions are presented as ANSI-C prototypes, often with an example of their use.

Most library functions return the integer 0 on success and the integer -1 on failure. The most recent error status is reflected in the global variable cnet_errno. All values of cnet_errno will be instances of the enumerated type CnetError. Errors may be reported to stderr with cnet_perror() and their error message string accessed from cnet_errstr[(int)cnet_errno].


Function restrictions

Note that calls to the functions

    CNET_disable_application and
    CNET_set_handler(EV_APPLICATIONLAYER,...) and
are only valid if called from a node of node type NT_HOST. Function calls to either the Application or Physical Layers are invalid when cnet is not running (this can occur when the simulation is running under a windowing system, is paused, and a node's debug button is selected).

cnet was written and is maintained by Chris McDonald (