Jian Li | 451175e | 2016-07-19 23:22:20 +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 | /** |
| 19 | * LISP map reply message interface. |
Jian Li | 719b3bf | 2016-07-22 00:38:29 +0900 | [diff] [blame] | 20 | * |
| 21 | * LISP map reply message format is defined in RFC6830. |
| 22 | * https://tools.ietf.org/html/rfc6830#page-31 |
| 23 | * |
Yuta HIGUCHI | 4b02211 | 2016-08-03 10:56:55 -0700 | [diff] [blame] | 24 | * <pre> |
| 25 | * {@literal |
Jian Li | 719b3bf | 2016-07-22 00:38:29 +0900 | [diff] [blame] | 26 | * 0 1 2 3 |
| 27 | * 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 |
| 28 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 29 | * |Type=2 |P|E|S| Reserved | Record Count | |
| 30 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 31 | * | Nonce . . . | |
| 32 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 33 | * | . . . Nonce | |
| 34 | * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 35 | * | | Record TTL | |
| 36 | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 37 | * R | Locator Count | EID mask-len | ACT |A| Reserved | |
| 38 | * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 39 | * c | Rsvd | Map-Version Number | EID-Prefix-AFI | |
| 40 | * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 41 | * r | EID-Prefix | |
| 42 | * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 43 | * | /| Priority | Weight | M Priority | M Weight | |
| 44 | * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 45 | * | o | Unused Flags |L|p|R| Loc-AFI | |
| 46 | * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
| 47 | * | \| Locator | |
| 48 | * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
Yuta HIGUCHI | 4b02211 | 2016-08-03 10:56:55 -0700 | [diff] [blame] | 49 | * }</pre> |
Jian Li | 451175e | 2016-07-19 23:22:20 +0900 | [diff] [blame] | 50 | */ |
| 51 | public interface LispMapReply extends LispMessage { |
Jian Li | 719b3bf | 2016-07-22 00:38:29 +0900 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * Obtains probe flag. |
| 55 | * |
| 56 | * @return probe flag |
| 57 | */ |
| 58 | boolean isProbe(); |
| 59 | |
| 60 | /** |
| 61 | * Obtains ETR flag. |
| 62 | * |
| 63 | * @return ETR flag |
| 64 | */ |
| 65 | boolean isEtr(); |
| 66 | |
| 67 | /** |
| 68 | * Obtains security flag. |
| 69 | * |
| 70 | * @return security flag |
| 71 | */ |
| 72 | boolean isSecurity(); |
| 73 | |
| 74 | /** |
| 75 | * Obtains record count value. |
| 76 | * |
| 77 | * @return record count value |
| 78 | */ |
| 79 | byte getRecordCount(); |
| 80 | |
| 81 | /** |
| 82 | * Obtains nonce value. |
| 83 | * |
| 84 | * @return nonce value |
| 85 | */ |
| 86 | long getNonce(); |
| 87 | |
| 88 | /** |
| 89 | * A builder of LISP map reply message. |
| 90 | */ |
| 91 | interface ReplyBuilder extends Builder { |
| 92 | |
| 93 | /** |
| 94 | * Sets isProbe flag. |
| 95 | * |
| 96 | * @param isProbe isProbe flag |
| 97 | * @return ReplyBuilder object |
| 98 | */ |
| 99 | ReplyBuilder withIsProbe(boolean isProbe); |
| 100 | |
| 101 | /** |
| 102 | * Sets isEtr flag. |
| 103 | * |
| 104 | * @param isEtr isEtr flag |
| 105 | * @return ReplyBuilder object |
| 106 | */ |
| 107 | ReplyBuilder withIsEtr(boolean isEtr); |
| 108 | |
| 109 | /** |
| 110 | * Sets isSecurity flag. |
| 111 | * |
| 112 | * @param isSecurity isSecurity flag |
| 113 | * @return ReplyBuilder object |
| 114 | */ |
| 115 | ReplyBuilder withIsSecurity(boolean isSecurity); |
| 116 | |
| 117 | /** |
| 118 | * Sets record count. |
| 119 | * |
| 120 | * @param recordCount record count |
| 121 | * @return ReplyBuilder object |
| 122 | */ |
| 123 | ReplyBuilder withRecordCount(byte recordCount); |
| 124 | |
| 125 | /** |
| 126 | * Sets nonce value. |
| 127 | * |
| 128 | * @param nonce nonce value |
| 129 | * @return ReplyBuilder object |
| 130 | */ |
| 131 | ReplyBuilder withNonce(long nonce); |
| 132 | } |
Jian Li | 451175e | 2016-07-19 23:22:20 +0900 | [diff] [blame] | 133 | } |