Committed by
Gerrit Code Review
ONOS-2197 Adding DHCP options and message type enum
Change-Id: I2e0d69c2581f2a6841a9c9a98e0947ad97b38d8a
Showing
1 changed file
with
22 additions
and
5 deletions
... | @@ -54,11 +54,12 @@ public class DHCP extends BasePacket { | ... | @@ -54,11 +54,12 @@ public class DHCP extends BasePacket { |
54 | public static final byte HWTYPE_ETHERNET = 0x1; | 54 | public static final byte HWTYPE_ETHERNET = 0x1; |
55 | 55 | ||
56 | public enum DHCPOptionCode { | 56 | public enum DHCPOptionCode { |
57 | - OptionCode_SubnetMask((byte) 1), OptionCode_RequestedIP((byte) 50), OptionCode_LeaseTime( | 57 | + OptionCode_SubnetMask((byte) 1), OptionCode_RouterAddress((byte) 3), OptionCode_DomainServer((byte) 6), |
58 | - (byte) 51), OptionCode_MessageType((byte) 53), OptionCode_DHCPServerIp( | 58 | + OptionCode_HostName((byte) 12), OptionCode_DomainName((byte) 15), OptionCode_BroadcastAddress((byte) 28), |
59 | - (byte) 54), OptionCode_RequestedParameters((byte) 55), OptionCode_RenewalTime( | 59 | + OptionCode_RequestedIP((byte) 50), OptionCode_LeaseTime((byte) 51), OptionCode_MessageType((byte) 53), |
60 | - (byte) 58), OPtionCode_RebindingTime((byte) 59), OptionCode_ClientID( | 60 | + OptionCode_DHCPServerIp((byte) 54), OptionCode_RequestedParameters((byte) 55), |
61 | - (byte) 61), OptionCode_END((byte) 255); | 61 | + OptionCode_RenewalTime((byte) 58), OPtionCode_RebindingTime((byte) 59), OptionCode_ClientID((byte) 61), |
62 | + OptionCode_END((byte) 255); | ||
62 | 63 | ||
63 | protected byte value; | 64 | protected byte value; |
64 | 65 | ||
... | @@ -71,6 +72,22 @@ public class DHCP extends BasePacket { | ... | @@ -71,6 +72,22 @@ public class DHCP extends BasePacket { |
71 | } | 72 | } |
72 | } | 73 | } |
73 | 74 | ||
75 | + public enum DHCPMessageType { | ||
76 | + MessageType_Discover((byte) 1), MessageType_Offer((byte) 2), MessageType_Request((byte) 3), | ||
77 | + MessageType_Decline((byte) 4), MessageType_ACK((byte) 5), MessageType_Nak((byte) 6), | ||
78 | + MessageType_Release((byte) 7), MessageType_Inform((byte) 8); | ||
79 | + | ||
80 | + protected byte value; | ||
81 | + | ||
82 | + private DHCPMessageType(final byte value) { | ||
83 | + this.value = value; | ||
84 | + } | ||
85 | + | ||
86 | + public byte getValue() { | ||
87 | + return this.value; | ||
88 | + } | ||
89 | + } | ||
90 | + | ||
74 | protected byte opCode; | 91 | protected byte opCode; |
75 | protected byte hardwareType; | 92 | protected byte hardwareType; |
76 | protected byte hardwareAddressLength; | 93 | protected byte hardwareAddressLength; | ... | ... |
-
Please register or login to post a comment