Skip to content

Commit 41bc492

Browse files
committed
Be consistent with the name - either "op" or "messageType".
(also some changes for "End comments with periods.")
1 parent c1550dd commit 41bc492

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

PcapDotNet/src/PcapDotNet.Packets.TestUtils/RandomDhcpExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static DhcpLayer NextDhcpLayer(this Random random)
2121
const int MaxOptions = 10;
2222

2323
DhcpLayer dhcpLayer = new DhcpLayer();
24-
dhcpLayer.MessageType = random.NextEnum<DhcpMessageType>();
24+
dhcpLayer.MessageOPCode = random.NextEnum<DhcpMessageOPCode>();
2525
dhcpLayer.HardwareType = random.NextEnum<ArpHardwareType>(Enum.GetValues(typeof(ArpHardwareType)).Cast<ArpHardwareType>().Where(p => ((short)p) > byte.MaxValue));
2626
dhcpLayer.HardwareAddressLength = random.NextByte(16);
2727
dhcpLayer.Hops = random.NextByte();

PcapDotNet/src/PcapDotNet.Packets/Dhcp/DhcpDatagram.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ private static class Offset
7676
/// RFC 2131.
7777
/// Message op code.
7878
/// </summary>
79-
public DhcpMessageType MessageType
79+
public DhcpMessageOPCode MessageOPCode
8080
{
81-
get { return (DhcpMessageType)this[Offset.Op]; }
81+
get { return (DhcpMessageOPCode)this[Offset.Op]; }
8282
}
8383

8484
/// <summary>
@@ -254,7 +254,7 @@ public override ILayer ExtractLayer()
254254
{
255255
return new DhcpLayer
256256
{
257-
MessageType = MessageType,
257+
MessageOPCode = MessageOPCode,
258258
HardwareType = HardwareType,
259259
HardwareAddressLength = HardwareAddressLength,
260260
Hops = Hops,
@@ -290,9 +290,9 @@ internal static int GetLength(bool isDhcp, IList<DhcpOption> options)
290290
return length;
291291
}
292292

293-
internal static void Write(byte[] buffer, int offset, DhcpMessageType messageType, ArpHardwareType hardwareType, byte hardwareAddressLength, byte hops, uint transactionId, ushort secondsElapsed, DhcpFlags flags, IpV4Address clientIpAddress, IpV4Address yourClientIpAddress, IpV4Address nextServerIpAddress, IpV4Address relayAgentIpAddress, DataSegment clientHardwareAddress, string serverHostName, string bootFileName, bool isDhcp, IList<DhcpOption> options)
293+
internal static void Write(byte[] buffer, int offset, DhcpMessageOPCode messageOPCode, ArpHardwareType hardwareType, byte hardwareAddressLength, byte hops, uint transactionId, ushort secondsElapsed, DhcpFlags flags, IpV4Address clientIpAddress, IpV4Address yourClientIpAddress, IpV4Address nextServerIpAddress, IpV4Address relayAgentIpAddress, DataSegment clientHardwareAddress, string serverHostName, string bootFileName, bool isDhcp, IList<DhcpOption> options)
294294
{
295-
buffer.Write(ref offset, (byte)messageType);
295+
buffer.Write(ref offset, (byte)messageOPCode);
296296
buffer.Write(ref offset, (byte)hardwareType);
297297
buffer.Write(ref offset, hardwareAddressLength);
298298
buffer.Write(ref offset, hops);

PcapDotNet/src/PcapDotNet.Packets/Dhcp/DhcpFlags.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public enum DhcpFlags : ushort
2424
{
2525
/// <summary>
2626
/// RFCs 2131.
27-
/// Response as Unicast
27+
/// Response as Unicast.
2828
/// </summary>
2929
Unicast = 0 << 15,
3030

3131
/// <summary>
3232
/// RFCs 2131.
33-
/// Response as Broadcast
33+
/// Response as Broadcast.
3434
/// </summary>
3535
Broadcast = 1 << 15
3636
}

PcapDotNet/src/PcapDotNet.Packets/Dhcp/DhcpLayer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public sealed class DhcpLayer : SimpleLayer, IEquatable<DhcpLayer>
2020
/// <summary>
2121
/// Message op code.
2222
/// </summary>
23-
public DhcpMessageType MessageType { get; set; }
23+
public DhcpMessageOPCode MessageOPCode { get; set; }
2424

2525
/// <summary>
2626
/// Hardware address type.
@@ -137,7 +137,7 @@ public override int Length
137137
protected override void Write(byte[] buffer, int offset)
138138
{
139139
DhcpDatagram.Write(buffer, offset,
140-
MessageType, HardwareType, HardwareAddressLength, Hops, TransactionId, SecondsElapsed, DhcpFlags, ClientIpAddress, YourClientIpAddress,
140+
MessageOPCode, HardwareType, HardwareAddressLength, Hops, TransactionId, SecondsElapsed, DhcpFlags, ClientIpAddress, YourClientIpAddress,
141141
NextServerIpAddress, RelayAgentIpAddress, ClientHardwareAddress, ServerHostName, BootFileName, IsDhcp, Options);
142142
}
143143

@@ -147,7 +147,7 @@ protected override void Write(byte[] buffer, int offset)
147147
public bool Equals(DhcpLayer other)
148148
{
149149
return other != null &&
150-
Equals(MessageType, other.MessageType) &&
150+
Equals(MessageOPCode, other.MessageOPCode) &&
151151
Equals(HardwareType, other.HardwareType) &&
152152
Equals(HardwareAddressLength, other.HardwareAddressLength) &&
153153
Equals(Hops, other.Hops) &&

PcapDotNet/src/PcapDotNet.Packets/Dhcp/DhcpMessageType.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ namespace PcapDotNet.Packets.Dhcp
1010
/// RFCs 2131.
1111
/// </summary>
1212
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")]
13-
public enum DhcpMessageType : byte
13+
public enum DhcpMessageOPCode : byte
1414
{
1515
/// <summary>
1616
/// RFC 2131.
17-
/// Indicates a Boot Request
17+
/// Indicates a Boot Request.
1818
/// </summary>
1919
BootRequest = 1,
2020

2121
/// <summary>
2222
/// RFC 2131.
23-
/// Indicates a Boot Reply
23+
/// Indicates a Boot Reply.
2424
/// </summary>
2525
BootReply = 2
2626
}

0 commit comments

Comments
 (0)