/* Copyright 1999 PSO Systems Inc */

#include "stdio.h"

extern int blastee();
extern int blaster();

extern int bsd_compat_initialized;
extern int socket_lib_initialized;
extern int ifunit();

extern void init_bsd_compat();
extern void init_socket_lib();
extern int sp();
extern int loattach();

void
pso_init(int packet_sz, int howmany)
{

        if (bsd_compat_initialized == 0) {
                printf("initialize BSD compat stuff\n");
                init_bsd_compat();
        }
        if (socket_lib_initialized == 0) {
                printf("initialize socket lib\n");
                init_socket_lib();
        }
        if (ifunit("lo0") == 0) {
                printf("attach loopback\n");
                loattach();
        }

        /* testing */

        if (packet_sz == 0)
                packet_sz = 1000;
        if (howmany == 0)
                howmany = 1;

	sp(blastee, packet_sz, howmany);
	sp(blaster, "127.0.0.1",packet_sz, howmany,0);
}

extern int ttcp();

void
ttcprun(int port)
{
        if (port == 0)
                port = 9999;

	sp(ttcp,0,0,0,10,100,1,port,0);
	sp(ttcp,0,1,0,10,100,1,port,0,"127.0.0.1");
}

void
ttcprun2(int port)
{
        if (port == 0)
                port = 8888;

	sp(ttcp,0,0,0,10,9000,1,port,0);
	sp(ttcp,0,1,0,10,9000,1,port,0,"127.0.0.1");
}


/* to pull in various routines from the library */
void
pull_in()
{
        net_info_init();  
	tulip_pci_attach(); 
/*	fxp_attach(); */
}


/* E.g. config_devices("mainbus") */
void
config_devices(char *name)
{
	if (config_rootfound(name, NULL) == NULL)
		printf("<%s> not configured\n",name);
}

void
pso_init2()
{
	config_devices("mainbus");
	ifconfig("de0","addr",inet_addr("222.222.222.132"));
}

/* XXX stubs */
int bsdSock43ApiFlag = 0;

int _func_dec2114xMediaSelect;
int dec21x4xEndLoad;


