The different source code files for the stack

The actual TCP/IP stack and the driver for the ethernet chip consists of the following files:
The main file you have to interface from an application point of view is ip_arp_udp_tcp.h. The ip_config.h allows you to customize the stack and switch off features that you might not need. This will keep the size always to the minimal. It is recommended to use the Makefile for compiling the files and thus keep track of the dependencies. Windows users might want to customize winmake.bat which will then call the Makefile.

The files websrv_help_functions.c and websrv_help_functions.h contain useful helper function for parsing URLs or for URL-encoding/decoding.

DNS and DHCP

The files dnslkup.c and dnslkup.h implement a tiny but very capable DNS resolver.

The DHCP client is: dhcp_client.c and dhcp_client.h

Examples on how to use the stack

The different examples and applications in this package are:

What are those callback functions?

Some functions want a pointer to a function as one of the arguments. That function gets then called at a later point in time when some result is available.

Why are we doing this? In a microcontroller the execution has always to continue (or at least you have to have the possibility to do so). That way you can still be responsive to other events (key button events, monitoring of voltages...).

The callback function gets then automatically executed when the result is ready but in the mean time you could be doing something else if you wanted.
//Example of a callback function:

void arpresolver_result_callback(uint8_t *ip,uint8_t transaction_number,uint8_t *mac){
        uint8_t i=0;
        if (transaction_number==TRANS_NUM_GWMAC){
                // copy mac address over:
                while(i<6){gwmac[i]=mac[i];i++;}
        }
}

// a pointer to arpresolver_result_callback is passed to get_mac_with_arp():
get_mac_with_arp(gwip,TRANS_NUM_GWMAC,&arpresolver_result_callback);


Copyright of the software and all diagrams: Guido Socher, tuxgraphics.org

License for all application code: GPL V2
See http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
License for the stack: GPL V2
See http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html

Other licenses are available on request.
vim:sw=8:ts=8:si:et