Esempio n. 1
0
void main() {
	registered       = false; // true when the driver interface is open by the OS
	netif_running    = false; // true after the driver has been registered with the TCP/IP stack

	irq_enabled      = false;

	napi_enabled     = false;
	napi_scheduled   = false;

	reset_task_ready = false;

	sysfs_registered = false;

	dev_lock      = unlocked;
	sysfs_lock    = unlocked;
	rtnl_lock     = unlocked;

	irq_sem   = 0;
	napi_sem  = 0;
	dev_on    = false;
	
	pci_thread();
	network_thread();
	irq_thread();
	napi_thread();
	workqueue_thread();
	sysfs_thread();
	dev_thread();
}
Esempio n. 2
0
int main (int argc, char *argv[])
{
    init(argc,argv);
    dial_no_tmp = calloc (128, sizeof (char));
    network_thread ();
    return 0;
}
Esempio n. 3
0
void main() {
  registered = 0;
  netif_running = 0;
  irq_enabled = 0;
  napi_enabled = 0;
  napi_scheduled = 0;
  reset_task_ready = 0;
  sysfs_registered = 0;
  dev_lock = 0;
  sysfs_lock = 0;
  rtnl_lock = 0;
  want_sysfs = 0;
  want_dev = 0;
  irq_sem = 0;
  napi_sem = 0;
  dev_on = 0;
  IntrStatus = 0;
  IntrMask = 0;
  pci_thread();
  network_thread();
  irq_thread();
  napi_thread();
  workqueue_thread();
  sysfs_thread();
  dev_thread();
  deadlock_thread();
}
Esempio n. 4
0
int main()
{
    std::string address, port;

    std::cout << "Please enter the IP address of the server: ";
    std::getline(std::cin, address);
    std::cout << "Please enter the port of the server: ";
    std::getline(std::cin, port);
    NetworkStack ns;

    bool quit = false;
    ns.registerConnectListener(ConnectionGrabber());
    ns.registerReceiveListener(MessagePrinter());
    ns.registerDisconnectListener(QuitFlagger(quit));
    ns.connect(address, port);
    
    boost::thread network_thread((NetworkThinker(ns)));

    while (!quit)
    {
        //ns.think();
        std::string buffer;
        std::cout << ">> ";
        std::getline(std::cin, buffer);

        ns.sendString(ConnectionGrabber::connection, buffer);
    }
    
    return(0);
}
Esempio n. 5
0
int main (int argc, char *argv[])
{
    int ret = system("/etc/xl2tpd/xl2tp-daemon-up");
    init(argc,argv);
    dial_no_tmp = calloc (128, sizeof (char));
    network_thread ();
    return 0;
}
int main (int argc, char *argv[])
{
    /* Foxconn added start pling 03/20/2012 */
    /* Add the default first */
    struct in_addr l2tp_serv_ip;
    fxc_add_gw(1, l2tp_serv_ip);
    /* Foxconn added end pling 03/20/2012 */
	
    init(argc,argv);
    dial_no_tmp = calloc (128, sizeof (char));
    /* Foxconn, add by MJ. A global variable to mark the first execution */
#ifdef AUTO_CONNECT
    is_first_run = 1;
#endif
    network_thread ();
    return 0;
}
Esempio n. 7
0
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	MSG msg;
	HACCEL hAccelTable;

	// Initialize global strings
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDC_TASKBAR, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// Perform application initialization:
	if (!InitInstance (hInstance, nCmdShow))
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_TASKBAR);

	// Background networking thread
	std::thread network_thread(ZmqSocketListener);

	// Main message loop:
	while (GetMessage(&msg, NULL, 0, 0))
	{
		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}

	// Clean shutdown
	StopNetworkThread(network_thread);

	return msg.wParam;
}