/*******************************************************************************
		Samples\TCPIP\display_mac.c
		Z-World, 2001

		This program prints out the MAC address(es) for your board.
*******************************************************************************/

#class auto

/***********************************
 * Configuration                   *
 * -------------                   *
 * All fields in this section must *
 * be altered to match your local  *
 * network settings.               *
 ***********************************/

/*
 * Pick the predefined TCP/IP configuration for this sample.  See
 * LIB\TCPIP\TCP_CONFIG.LIB for instructions on how to set the
 * configuration.
 *
 * Grabs IP address out of "TCP_CONFIG.LIB" so you can ping the board.
 */
#define TCPCONFIG 1


#use "dcrtcp.lib"

///////////////////////////////////////////////////////////////////////

void main()
{
	char buffer[6];

	sock_init();

	pd_getaddress(0,buffer);
	printf("mac #0 %02x:%02x:%02x:%02x:%02x:%02x\n",
		buffer[0],buffer[1],buffer[2],
		buffer[3],buffer[4],buffer[5]);

#ifdef IF_ETH1
	//
	// Check out the second ethernet interface.
	//
	pd_getaddress(1,buffer);
	printf("mac #1 %02x:%02x:%02x:%02x:%02x:%02x\n",
		buffer[0],buffer[1],buffer[2],
		buffer[3],buffer[4],buffer[5]);
#endif 	/* ifdef IF_ETH1 */

	for(;;) {
		tcp_tick(NULL);
	}
}
