Commit a64c0c7f authored by Brickner_cp's avatar Brickner_cp

--no commit message

--no commit message
parent 2da3e5e9
...@@ -11,7 +11,7 @@ namespace Packets ...@@ -11,7 +11,7 @@ namespace Packets
/// </summary> /// </summary>
public class EthernetDatagram : Datagram public class EthernetDatagram : Datagram
{ {
private class Offset private static class Offset
{ {
public const int Destination = 0; public const int Destination = 0;
public const int Source = 6; public const int Source = 6;
......
...@@ -4,11 +4,11 @@ namespace Packets ...@@ -4,11 +4,11 @@ namespace Packets
{ {
public static class PacketBuilder public static class PacketBuilder
{ {
public static Packet Ethernet(DateTime timestamp, MacAddress ethernetSource, MacAddress ethernetDestination, EthernetType ethernetType, Datagram etherentPayload) public static Packet Ethernet(DateTime timestamp, MacAddress ethernetSource, MacAddress ethernetDestination, EthernetType ethernetType, Datagram ethernetPayload)
{ {
byte[] buffer = new byte[EthernetDatagram.HeaderLength + etherentPayload.Length]; byte[] buffer = new byte[EthernetDatagram.HeaderLength + ethernetPayload.Length];
EthernetDatagram.WriteHeader(buffer, 0, ethernetSource, ethernetDestination, ethernetType); EthernetDatagram.WriteHeader(buffer, 0, ethernetSource, ethernetDestination, ethernetType);
etherentPayload.Write(buffer, EthernetDatagram.HeaderLength); ethernetPayload.Write(buffer, EthernetDatagram.HeaderLength);
return new Packet(buffer, timestamp, new DataLink(DataLinkKind.Ethernet)); return new Packet(buffer, timestamp, new DataLink(DataLinkKind.Ethernet));
} }
} }
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment