stuff moved here from main.c; use uint32 for IP addresses