blob: 968f89ef24353c443f083bf9cba530ce6636186e [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 Li719b3bf2016-07-22 00:38:29 +090024 *
25 * 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 Li719b3bf2016-07-22 00:38:29 +090030 * 0 1 2 3
31 * 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
32 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
33 * |Type=1 |A|M|P|S|p|s| Reserved | IRC | Record Count |
34 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35 * | Nonce . . . |
36 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
37 * | . . . Nonce |
38 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
39 * | Source-EID-AFI | Source EID Address ... |
40 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
41 * | ITR-RLOC-AFI 1 | ITR-RLOC Address 1 ... |
42 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 * | ... |
44 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 * | ITR-RLOC-AFI n | ITR-RLOC Address n ... |
46 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
47 * / | Reserved | EID mask-len | EID-Prefix-AFI |
48 * Rec +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
49 * \ | EID-Prefix ... |
50 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
51 * | Map-Reply Record ... |
52 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Yuta HIGUCHI4b022112016-08-03 10:56:55 -070053 * }</pre>
Jian Li451175e2016-07-19 23:22:20 +090054 */
55public interface LispMapRequest extends LispMessage {
Jian Li719b3bf2016-07-22 00:38:29 +090056
57 /**
58 * Obtains authoritative flag.
59 *
60 * @return authoritative flag
61 */
62 boolean isAuthoritative();
63
64 /**
65 * Obtains probe flag.
66 *
67 * @return probe flag
68 */
69 boolean isProbe();
70
71 /**
72 * Obtains SMR flag.
73 *
74 * @return SMR flag
75 */
76 boolean isSmr();
77
78 /**
79 * Obtains PITR flag.
80 *
81 * @return PITR flag
82 */
83 boolean isPitr();
84
85 /**
86 * Obtains SMR Invoked flag.
87 *
88 * @return SMR invoked flag
89 */
90 boolean isSmrInvoked();
91
92 /**
93 * Obtains record count value.
94 *
95 * @return record count value
96 */
97 byte getRecordCount();
98
99 /**
100 * Obtains nonce value.
101 *
102 * @return nonce value
103 */
104 long getNonce();
105
106 /**
107 * Obtains source EID.
108 *
109 * @return source EID
110 */
111 LispAfiAddress getSourceEid();
112
113 /**
114 * Obtains a collection of ITR RLOCs.
115 *
116 * @return a collection of ITR RLOCs
117 */
118 List<LispAfiAddress> getItrRlocs();
119
120 /**
121 * Obtains a collection of EID records.
122 *
123 * @return a collection of EID records
124 */
125 List<EidRecord> getEids();
126
127 /**
128 * A builder of LISP map request message.
129 */
130 interface RequestBuilder extends Builder {
131
132 /**
133 * Sets isAuthoritative flag.
134 *
135 * @param isAuthoritative isAuthoritative flag
136 * @return RequestBuilder object
137 */
138 RequestBuilder withIsAuthoritative(boolean isAuthoritative);
139
140 /**
141 * Sets isProbe flag.
142 *
143 * @param isProbe isProbe flag
144 * @return RequestBuilder object
145 */
146 RequestBuilder withIsProbe(boolean isProbe);
147
148 /**
149 * Sets isSmr flag.
150 *
151 * @param isSmr isSmr flag
152 * @return RequestBuilder object
153 */
154 RequestBuilder withIsSmr(boolean isSmr);
155
156 /**
157 * Sets isPitr flag.
158 *
159 * @param isPitr isPitr flag
160 * @return RequestBuilder object
161 */
162 RequestBuilder withIsPitr(boolean isPitr);
163
164 /**
165 * Sets isSmrInvoked flag.
166 *
167 * @param isSmrInvoked isSmrInvoked flag
168 * @return RequestBuilder object
169 */
170 RequestBuilder withIsSmrInvoked(boolean isSmrInvoked);
171
172 /**
173 * Sets record count.
174 *
175 * @param recordCount record count
176 * @return RequestBuilder object
177 */
178 RequestBuilder withRecordCount(byte recordCount);
179
180 /**
181 * Sets nonce value.
182 *
183 * @param nonce nonce value
184 * @return RequestBuilder object
185 */
186 RequestBuilder withNonce(long nonce);
187
188 /**
189 * Adds ITR RLOC into RLOC collection.
190 *
191 * @param itrRloc ITR RLOC
192 * @return RequestBuilder object
193 */
194 RequestBuilder withItrRloc(LispAfiAddress itrRloc);
195
196 /**
197 * Adds EID record into record collection.
198 *
199 * @param record EID record
200 * @return RequestBuilder object
201 */
202 RequestBuilder addEidRecord(EidRecord record);
203 }
Jian Li451175e2016-07-19 23:22:20 +0900204}