cnet's Miscellaneous functions

int
CNET_set_handler(CnetEvent ev, void (*func)(), CnetData data)
Register func as the void ``returning'' function to be invoked when the event ev occurs.
int
CNET_get_handler(CnetEvent ev, void (**handler)(), CnetData *data)
Obtains the address of the void ``returning'' function which will be invoked when the indicated event occurs, together with the user-specified data value that will be passed to the handler.
int
CNET_read_keyboard(char *line, int *len)
Requests the specified maximum number of bytes from the keyboard buffer placing them in the address pointed to by line. On invocation, len will point to an integer indicating the maximum number of bytes that may be copied into line. On return, line will be NULL-byte terminated (and not include a newline) and the integer pointed to by len will contain strlen(line)+1.
int
CNET_set_debug_string(CnetEvent ev, char *str)
Change the string on the indicated X-windows debug button (for EV_DEBUG1..EV_DEBUG5) to str. If str is NULL or the empty string, the indicated button is removed.
int
CNET_set_time_of_day(long newsec, long newms)
Change the node's notion of the wall-clock time of day. As nodeinfo should be considered a read-only structure, this is the only method to set time_of_day.sec and time_of_day.ms . (time_of_day.sec is the number of seconds since Jan. 1, 1970, and may be used in a call to ctime(3c)).
int
CNET_trace(const char *, ...)
If tracing is requested (globally, or for certain nodes) this printf()-like function will produce its output on the stderr stream.
int
checksum_internet(unsigned short *addr, int nbytes)
unsigned short
checksum_ccitt(unsigned char *addr, int nbytes)
unsigned short
checksum_crc16(unsigned char *addr, int nbytes)
unsigned int
checksum_crc32(unsigned char *addr, int nbytes)
Functions which take a memory address and perform the specified checksum calculation on the indicated number of bytes starting from that address.


cnet was written and is maintained by Chris McDonald (chris@cs.uwa.edu.au)