mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 21:08:51 +00:00
Update Global to call driver initialization routines for different drivers. Devices are enumerated during startup regardless of what hardware you are using. Update FrodeTest workspace to run via new NetworkDevice interface Update Builder.cs so that QEMU gets called with only either "-net tap" or "-net user", as these two options conflict Internalized most of the TCP/IP stack leaving only the User needed classes available to use. Commented most of TCP/IP stack public methods, and cleaned out code a little bit.
32 lines
1.3 KiB
C#
32 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Cosmos.Sys.Network;
|
|
|
|
namespace FrodeTest.Test
|
|
{
|
|
public static class UDPTest
|
|
{
|
|
public static void RunTests() {
|
|
var xUDP = new Cosmos.Sys.Network.UDPPacket(
|
|
// Use a different port so it does not conflict wtih listener since we
|
|
// are using the same IP on host for testing
|
|
0x0A00020F, 32001 // 10.0.2.15
|
|
, 0xFFFFFFFF, 32000 // 255.255.255.255, Broadcast
|
|
, new byte[] { 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16 });
|
|
var xEthernet = new EthernetPacket(xUDP.GetData()
|
|
, 0x525400123457, 0xFFFFFFFFFFFF
|
|
, EthernetPacket.PacketType.IP);
|
|
|
|
var xNICs = Cosmos.Hardware.Network.NetworkDevice.NetworkDevices;
|
|
var xNIC = xNICs[0];
|
|
xNIC.Enable();
|
|
|
|
Console.WriteLine("Sending bytes.");
|
|
var xBytes = xEthernet.GetData();
|
|
System.Diagnostics.Debugger.Break();
|
|
xNIC.QueueBytes(xBytes);
|
|
}
|
|
}
|
|
}
|