diff options
Diffstat (limited to 'pfinet/main.c')
-rw-r--r-- | pfinet/main.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/pfinet/main.c b/pfinet/main.c index 518c8baa..5b30c4eb 100644 --- a/pfinet/main.c +++ b/pfinet/main.c @@ -18,8 +18,34 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ -#include <cthreads.h> +#include "pfinet.h" main () { + char addr[4]; + + setup_ethernet_device (); + + /* Call initialization routines */ + init_proto_init (); + + /* Simulate SIOCSIFADDR call. */ + + /* 128.52.46.37 is turing.gnu.ai.mit.edu. */ + addr[0] = 128; + addr[1] = 52; + addr[2] = 46; + addr[3] = 37; + ether_dev.pa_addr = *(u_long *)addr; + + /* Mask is 255.255.255.0. */ + addr[0] = addr[1] = addr[2] = 255; + addr[3] = 0; + ether_dev.pa_mask = *(u_long *)addr; + + ether_dev.family = AF_INET; + ether_dev.pa_brdaddr = ether_dev->pa_addr | ~ether_dev->pa_mask; + + /* Turn on device. */ + dev_open (ðer_dev); } |