Yi Tseng | 60bf35a | 2017-06-02 17:05:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onlab.packet; |
| 18 | |
| 19 | /** |
| 20 | * Representation of an DHCPv6 Option. |
| 21 | * Base on RFC-3315. |
| 22 | */ |
| 23 | public class DHCP6Option { |
| 24 | private short code; |
| 25 | private short length; |
| 26 | private byte[] data; |
| 27 | |
| 28 | /** |
| 29 | * Sets the code of this option. |
| 30 | * |
| 31 | * @param code the code to set |
| 32 | */ |
| 33 | public void setCode(short code) { |
| 34 | this.code = code; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Sets the data and length of this option. |
| 39 | * |
| 40 | * @param data the data to set |
| 41 | */ |
| 42 | public void setData(byte[] data) { |
| 43 | this.data = data; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Sets length of this option. |
| 48 | * |
| 49 | * @param length the length to set |
| 50 | */ |
| 51 | public void setLength(short length) { |
| 52 | this.length = length; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Gets the code of this option. |
| 57 | * |
| 58 | * @return the code |
| 59 | */ |
| 60 | public short getCode() { |
| 61 | return code; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Gets the length of this option. |
| 66 | * |
| 67 | * @return the length of this option |
| 68 | */ |
| 69 | public short getLength() { |
| 70 | return length; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Gets the data of this option. |
| 75 | * |
| 76 | * @return the data of this option |
| 77 | */ |
| 78 | public byte[] getData() { |
| 79 | return data; |
| 80 | } |
| 81 | } |