Exemple #1
0
        public override bool InitServer()
        {
            tysos.Syscalls.ProcessFunctions.RegisterSpecialProcess(this,
                                                                   tysos.Syscalls.ProcessFunctions.SpecialProcessType.Net);

            // Register handlers for devices
            while (tysos.Syscalls.ProcessFunctions.GetVfs() == null)
            {
                ;
            }
            vfs = tysos.Syscalls.ProcessFunctions.GetVfs();

            vfs.RegisterAddHandler("class", "netdev", tysos.Messages.Message.MESSAGE_NET_REGISTER_DEVICE, true);

            /* Start protocol handlers */
            var _arp = new arp();

            tysos.Process p_arp = tysos.Process.CreateProcess("arp",
                                                              new System.Threading.ThreadStart(_arp.MessageLoop),
                                                              new object[] { _arp });
            p_arp.Start();
            arp = _arp;

            ipv4 _ipv4 = new ipv4();

            tysos.Process p_ipv4 = tysos.Process.CreateProcess("ipv4",
                                                               new System.Threading.ThreadStart(_ipv4.MessageLoop),
                                                               new object[] { _ipv4 });
            p_ipv4.Start();

            return(true);
        }
Exemple #2
0
        public override bool InitServer()
        {
            _net = Syscalls.ProcessFunctions.GetNet() as INetInternal;
            net  = _net as net;
            var ret = _net.RegisterPacketHandler(0x0800, this);


            /* Start protocol handlers */
            icmp = new icmp(this);
            tysos.Process p_icmp = tysos.Process.CreateProcess("icmp",
                                                               new System.Threading.ThreadStart(icmp.MessageLoop),
                                                               new object[] { icmp });
            p_icmp.Start();

            return(ret.Sync());
        }