Jian Li | 10a0906 | 2016-07-26 23:58:50 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-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 | package org.onosproject.lisp.msg.protocols; |
| 17 | |
| 18 | import org.onosproject.lisp.msg.types.LispAfiAddress; |
| 19 | |
| 20 | /** |
| 21 | * LISP EID record section which is part of LISP map request message. |
| 22 | */ |
Jian Li | 631e62a | 2016-08-03 22:42:00 +0900 | [diff] [blame^] | 23 | public final class LispEidRecord { |
Jian Li | 10a0906 | 2016-07-26 23:58:50 +0900 | [diff] [blame] | 24 | |
| 25 | private final byte maskLength; |
| 26 | private final LispAfiAddress prefix; |
| 27 | |
| 28 | /** |
| 29 | * Initializes LispEidRecord with mask length and EID prefix. |
| 30 | * |
| 31 | * @param maskLength mask length |
| 32 | * @param prefix EID prefix |
| 33 | */ |
| 34 | public LispEidRecord(byte maskLength, LispAfiAddress prefix) { |
| 35 | this.maskLength = maskLength; |
| 36 | this.prefix = prefix; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Obtains mask length of the EID Record. |
| 41 | * |
| 42 | * @return mask length of the EID Record |
| 43 | */ |
| 44 | public byte getMaskLength() { |
| 45 | return maskLength; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Obtains EID prefix. |
| 50 | * |
| 51 | * @return EID prefix |
| 52 | */ |
| 53 | public LispAfiAddress getPrefix() { |
| 54 | return prefix; |
| 55 | } |
| 56 | } |