Commit 62a73ed7 authored by Brickner_cp's avatar Brickner_cp

IPv6

parent 2d5666f2
...@@ -701,6 +701,19 @@ namespace PcapDotNet.Packets ...@@ -701,6 +701,19 @@ namespace PcapDotNet.Packets
Write(buffer, offset, value); Write(buffer, offset, value);
} }
/// <summary>
/// Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written.
/// </summary>
/// <param name="buffer">The buffer to write the value to.</param>
/// <param name="offset">The offset in the buffer to start writing.</param>
/// <param name="value">The value to write.</param>
/// <param name="endianity">The endianity to use when converting the value to bytes.</param>
public static void Write(this byte[] buffer, ref int offset, UInt128 value, Endianity endianity)
{
buffer.Write(offset, value, endianity);
offset += UInt128.SizeOf;
}
/// <summary> /// <summary>
/// Writes the given amount of least significant bytes of the value to the buffer using the given endianity. /// Writes the given amount of least significant bytes of the value to the buffer using the given endianity.
/// Doesn't write leading zero bytes. /// Doesn't write leading zero bytes.
...@@ -853,6 +866,18 @@ namespace PcapDotNet.Packets ...@@ -853,6 +866,18 @@ namespace PcapDotNet.Packets
buffer.Write(offset, value.ToValue(), endianity); buffer.Write(offset, value.ToValue(), endianity);
} }
/// <summary>
/// Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written.
/// </summary>
/// <param name="buffer">The buffer to write the value to.</param>
/// <param name="offset">The offset in the buffer to start writing.</param>
/// <param name="value">The value to write.</param>
/// <param name="endianity">The endianity to use when converting the value to bytes.</param>
public static void Write(this byte[] buffer, ref int offset, IpV6Address value, Endianity endianity)
{
buffer.Write(ref offset, value.ToValue(), endianity);
}
// public static void WriteCarriageReturnLinefeed(this byte[] buffer, int offset) // public static void WriteCarriageReturnLinefeed(this byte[] buffer, int offset)
// { // {
// buffer.Write(ref offset, AsciiBytes.CarriageReturn); // buffer.Write(ref offset, AsciiBytes.CarriageReturn);
......
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