blob: f548f65a9cd3b3ce350e71b7dd908a34f0e94452 [file] [log] [blame]
Jian Li451175e2016-07-19 23:22:20 +09001/*
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 */
16package org.onosproject.lisp.msg.protocols;
17
Jian Li719b3bf2016-07-22 00:38:29 +090018import org.onosproject.lisp.msg.types.LispAfiAddress;
19
20import java.util.List;
21
Jian Li451175e2016-07-19 23:22:20 +090022/**
23 * LISP map request message interface.
Jian Lif59c0ad2016-08-02 18:11:30 +090024 * <p>
Jian Li719b3bf2016-07-22 00:38:29 +090025 * LISP map request message format is defined in RFC6830.
26 * https://tools.ietf.org/html/rfc6830#page-27
27 *
Yuta HIGUCHI4b022112016-08-03 10:56:55 -070028 * <pre>
29 * {@literal
Jian Lif59c0ad2016-08-02 18:11:30 +090030 * <p>
Jian Li8fc2d2f2016-08-08 14:43:53 +090031 * 0 1 2 3
32 * 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
Jian Li719b3bf2016-07-22 00:38:29 +090033 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 * |Type=1 |A|M|P|S|p|s| Reserved | IRC | Record Count |
35 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36 * | Nonce . . . |
37 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38 * | . . . Nonce |
39 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 * | Source-EID-AFI | Source EID Address ... |
41 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
42 * | ITR-RLOC-AFI 1 | ITR-RLOC Address 1 ... |
43 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44 * | ... |
45 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
46 * | ITR-RLOC-AFI n | ITR-RLOC Address n ... |
47 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
48 * / | Reserved | EID mask-len | EID-Prefix-AFI |
49 * Rec +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
50 * \ | EID-Prefix ... |
51 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52 * | Map-Reply Record ... |
53 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Yuta HIGUCHI4b022112016-08-03 10:56:55 -070054 * }</pre>
Jian Li451175e2016-07-19 23:22:20 +090055 */
56public interface LispMapRequest extends LispMessage {
Jian Li719b3bf2016-07-22 00:38:29 +090057
58 /**
59 * Obtains authoritative flag.
60 *
61 * @return authoritative flag
62 */
63 boolean isAuthoritative();
64
65 /**
Jian Lif59c0ad2016-08-02 18:11:30 +090066 * Obtains map data present flag.
67 *
68 * @return map data present flag
69 */
70 boolean isMapDataPresent();
71
72 /**
Jian Li719b3bf2016-07-22 00:38:29 +090073 * Obtains probe flag.
74 *
75 * @return probe flag
76 */
77 boolean isProbe();
78
79 /**
80 * Obtains SMR flag.
81 *
82 * @return SMR flag
83 */
84 boolean isSmr();
85
86 /**
87 * Obtains PITR flag.
88 *
89 * @return PITR flag
90 */
91 boolean isPitr();
92
93 /**
94 * Obtains SMR Invoked flag.
95 *
96 * @return SMR invoked flag
97 */
98 boolean isSmrInvoked();
99
100 /**
101 * Obtains record count value.
102 *
103 * @return record count value
104 */
105 byte getRecordCount();
106
107 /**
108 * Obtains nonce value.
109 *
110 * @return nonce value
111 */
112 long getNonce();
113
114 /**
115 * Obtains source EID.
116 *
117 * @return source EID
118 */
119 LispAfiAddress getSourceEid();
120
121 /**
122 * Obtains a collection of ITR RLOCs.
123 *
124 * @return a collection of ITR RLOCs
125 */
126 List<LispAfiAddress> getItrRlocs();
127
128 /**
129 * Obtains a collection of EID records.
130 *
131 * @return a collection of EID records
132 */
Jian Li10a09062016-07-26 23:58:50 +0900133 List<LispEidRecord> getEids();
Jian Li719b3bf2016-07-22 00:38:29 +0900134
135 /**
136 * A builder of LISP map request message.
137 */
138 interface RequestBuilder extends Builder {
139
140 /**
Jian Lif59c0ad2016-08-02 18:11:30 +0900141 * Sets authoritative flag.
Jian Li719b3bf2016-07-22 00:38:29 +0900142 *
Jian Lif59c0ad2016-08-02 18:11:30 +0900143 * @param authoritative authoritative flag
Jian Li719b3bf2016-07-22 00:38:29 +0900144 * @return RequestBuilder object
145 */
Jian Lif59c0ad2016-08-02 18:11:30 +0900146 RequestBuilder withIsAuthoritative(boolean authoritative);
Jian Li719b3bf2016-07-22 00:38:29 +0900147
148 /**
Jian Lif59c0ad2016-08-02 18:11:30 +0900149 * Sets probe flag.
Jian Li719b3bf2016-07-22 00:38:29 +0900150 *
Jian Lif59c0ad2016-08-02 18:11:30 +0900151 * @param probe probe flag
Jian Li719b3bf2016-07-22 00:38:29 +0900152 * @return RequestBuilder object
153 */
Jian Lif59c0ad2016-08-02 18:11:30 +0900154 RequestBuilder withIsProbe(boolean probe);
Jian Li719b3bf2016-07-22 00:38:29 +0900155
156 /**
Jian Lif59c0ad2016-08-02 18:11:30 +0900157 * Sets map data resent flag.
Jian Li719b3bf2016-07-22 00:38:29 +0900158 *
Jian Lif59c0ad2016-08-02 18:11:30 +0900159 * @param mapDataPresent map data present flag
Jian Li719b3bf2016-07-22 00:38:29 +0900160 * @return RequestBuilder object
161 */
Jian Lif59c0ad2016-08-02 18:11:30 +0900162 RequestBuilder withIsMapDataPresent(boolean mapDataPresent);
Jian Li719b3bf2016-07-22 00:38:29 +0900163
164 /**
Jian Lif59c0ad2016-08-02 18:11:30 +0900165 * Sets smr flag.
Jian Li719b3bf2016-07-22 00:38:29 +0900166 *
Jian Lif59c0ad2016-08-02 18:11:30 +0900167 * @param smr smr flag
Jian Li719b3bf2016-07-22 00:38:29 +0900168 * @return RequestBuilder object
169 */
Jian Lif59c0ad2016-08-02 18:11:30 +0900170 RequestBuilder withIsSmr(boolean smr);
Jian Li719b3bf2016-07-22 00:38:29 +0900171
172 /**
Jian Lif59c0ad2016-08-02 18:11:30 +0900173 * Sets pitr flag.
Jian Li719b3bf2016-07-22 00:38:29 +0900174 *
Jian Lif59c0ad2016-08-02 18:11:30 +0900175 * @param pitr pitr flag
Jian Li719b3bf2016-07-22 00:38:29 +0900176 * @return RequestBuilder object
177 */
Jian Lif59c0ad2016-08-02 18:11:30 +0900178 RequestBuilder withIsPitr(boolean pitr);
179
180 /**
181 * Sets smrInvoked flag.
182 *
183 * @param smrInvoked smrInvoked flag
184 * @return RequestBuilder object
185 */
186 RequestBuilder withIsSmrInvoked(boolean smrInvoked);
Jian Li719b3bf2016-07-22 00:38:29 +0900187
188 /**
189 * Sets record count.
190 *
191 * @param recordCount record count
192 * @return RequestBuilder object
193 */
194 RequestBuilder withRecordCount(byte recordCount);
195
196 /**
197 * Sets nonce value.
198 *
199 * @param nonce nonce value
200 * @return RequestBuilder object
201 */
202 RequestBuilder withNonce(long nonce);
203
204 /**
Jian Lif59c0ad2016-08-02 18:11:30 +0900205 * Sets source EID address.
206 *
207 * @param sourceEid source EID
208 * @return RequestBuilder object
209 */
210 RequestBuilder withSourceEid(LispAfiAddress sourceEid);
211
212 /**
Jian Li47671902016-08-11 01:18:18 +0900213 * Sets a collection of ITR RLOCs.
Jian Li719b3bf2016-07-22 00:38:29 +0900214 *
Jian Li47671902016-08-11 01:18:18 +0900215 * @param itrRlocs a collection of ITR RLOCs
Jian Li719b3bf2016-07-22 00:38:29 +0900216 * @return RequestBuilder object
217 */
Jian Li47671902016-08-11 01:18:18 +0900218 RequestBuilder withItrRlocs(List<LispAfiAddress> itrRlocs);
Jian Li719b3bf2016-07-22 00:38:29 +0900219
220 /**
Jian Li47671902016-08-11 01:18:18 +0900221 * Sets a collection of EID records.
Jian Li719b3bf2016-07-22 00:38:29 +0900222 *
Jian Li47671902016-08-11 01:18:18 +0900223 * @param records a collection of EID records
Jian Li719b3bf2016-07-22 00:38:29 +0900224 * @return RequestBuilder object
225 */
Jian Li47671902016-08-11 01:18:18 +0900226 RequestBuilder withEidRecords(List<LispEidRecord> records);
Jian Li525fded2016-08-04 01:15:33 +0900227
228 /**
229 * Builds LISP map request message.
230 *
231 * @return LISP map request message
232 */
233 LispMapRequest build();
Jian Li719b3bf2016-07-22 00:38:29 +0900234 }
Jian Li451175e2016-07-19 23:22:20 +0900235}