Jian Li | 672ebda | 2017-02-06 20:21:04 +0900 | [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 | package org.onosproject.lisp.msg.protocols; |
| 17 | |
Jian Li | f4bfbaa | 2017-02-08 14:59:58 +0900 | [diff] [blame] | 18 | import java.util.List; |
| 19 | |
Jian Li | 672ebda | 2017-02-06 20:21:04 +0900 | [diff] [blame] | 20 | /** |
| 21 | * LISP map referral message interface. |
| 22 | * <p> |
| 23 | * LISP map referral message format is defined in draft-ietf-lisp-ddt-09. |
| 24 | * https://tools.ietf.org/html/draft-ietf-lisp-ddt-09 |
| 25 | * |
| 26 | * <pre> |
| 27 | * {@literal |
| 28 | * 0 1 2 3 |
| 29 | * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
| 30 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 31 | * |Type=6 | Reserved | Record Count | |
| 32 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 33 | * | Nonce . . . | |
| 34 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 35 | * | . . . Nonce | |
| 36 | * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 37 | * | | Record TTL | |
| 38 | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 39 | * R | Referral Count| EID mask-len | ACT |A|I| Reserved | |
| 40 | * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 41 | * c |SigCnt | Map Version Number | EID-AFI | |
| 42 | * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 43 | * r | EID-prefix ... | |
| 44 | * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 45 | * | /| Priority | Weight | M Priority | M Weight | |
| 46 | * | R +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 47 | * | e | Unused Flags |L|p|R| Loc-AFI | |
| 48 | * | f +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 49 | * | \| Locator ... | |
| 50 | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 51 | * | ~ Sig section ~ |
| 52 | * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 53 | * }</pre> |
| 54 | */ |
Jian Li | f4bfbaa | 2017-02-08 14:59:58 +0900 | [diff] [blame] | 55 | public interface LispMapReferral extends LispMessage { |
Jian Li | 672ebda | 2017-02-06 20:21:04 +0900 | [diff] [blame] | 56 | |
Jian Li | f4bfbaa | 2017-02-08 14:59:58 +0900 | [diff] [blame] | 57 | /** |
| 58 | * Obtains record count value. |
| 59 | * |
| 60 | * @return record count value |
| 61 | */ |
| 62 | int getRecordCount(); |
| 63 | |
| 64 | /** |
| 65 | * Obtains nonce value. |
| 66 | * |
| 67 | * @return nonce |
| 68 | */ |
| 69 | long getNonce(); |
| 70 | |
| 71 | /** |
| 72 | * Obtains a collection of referral records. |
| 73 | * |
| 74 | * @return a collection of referral records |
| 75 | */ |
| 76 | List<LispReferralRecord> getReferralRecords(); |
| 77 | |
| 78 | /** |
| 79 | * A builder of LISP map referral message. |
| 80 | */ |
| 81 | interface MapReferralBuilder extends Builder { |
| 82 | |
| 83 | /** |
| 84 | * Sets nonce value. |
| 85 | * |
| 86 | * @param nonce nonce value |
| 87 | * @return MapReferralBuilder object |
| 88 | */ |
| 89 | MapReferralBuilder withNonce(long nonce); |
| 90 | |
| 91 | /** |
| 92 | * Sets a collection of referral records. |
| 93 | * |
| 94 | * @param records a collection of referral records |
| 95 | * @return MapReferralBuilder object |
| 96 | */ |
| 97 | MapReferralBuilder withReferralRecords(List<LispReferralRecord> records); |
| 98 | |
| 99 | /** |
| 100 | * Builds LISP map referral message. |
| 101 | * |
| 102 | * @return LISP map referral message |
| 103 | */ |
| 104 | LispMapReferral build(); |
| 105 | } |
Jian Li | 672ebda | 2017-02-06 20:21:04 +0900 | [diff] [blame] | 106 | } |