Committed by
Thomas Vachuska
[ONOS-4718] Initial implementation of LISP control message objects
Change-Id: I22cdb1a4b5d7bb7f0681c9fa9a45223b60bdb282
Showing
11 changed files
with
916 additions
and
1 deletions
... | @@ -17,6 +17,8 @@ package org.onosproject.lisp.msg.protocols; | ... | @@ -17,6 +17,8 @@ package org.onosproject.lisp.msg.protocols; |
17 | 17 | ||
18 | import io.netty.buffer.ByteBuf; | 18 | import io.netty.buffer.ByteBuf; |
19 | 19 | ||
20 | +import java.util.List; | ||
21 | + | ||
20 | /** | 22 | /** |
21 | * Default LISP map notify message class. | 23 | * Default LISP map notify message class. |
22 | */ | 24 | */ |
... | @@ -36,4 +38,67 @@ public class DefaultLispMapNotify implements LispMapNotify { | ... | @@ -36,4 +38,67 @@ public class DefaultLispMapNotify implements LispMapNotify { |
36 | public Builder createBuilder() { | 38 | public Builder createBuilder() { |
37 | return null; | 39 | return null; |
38 | } | 40 | } |
41 | + | ||
42 | + @Override | ||
43 | + public long getNonce() { | ||
44 | + return 0; | ||
45 | + } | ||
46 | + | ||
47 | + @Override | ||
48 | + public byte getRecordCount() { | ||
49 | + return 0; | ||
50 | + } | ||
51 | + | ||
52 | + @Override | ||
53 | + public short getKeyId() { | ||
54 | + return 0; | ||
55 | + } | ||
56 | + | ||
57 | + @Override | ||
58 | + public byte[] getAuthenticationData() { | ||
59 | + return new byte[0]; | ||
60 | + } | ||
61 | + | ||
62 | + @Override | ||
63 | + public List<LispRecord> getLispRecords() { | ||
64 | + return null; | ||
65 | + } | ||
66 | + | ||
67 | + public static final class DefaultNotifyBuilder implements NotifyBuilder { | ||
68 | + | ||
69 | + @Override | ||
70 | + public LispMessage build() { | ||
71 | + return null; | ||
72 | + } | ||
73 | + | ||
74 | + @Override | ||
75 | + public LispType getType() { | ||
76 | + return null; | ||
77 | + } | ||
78 | + | ||
79 | + @Override | ||
80 | + public NotifyBuilder withNonce(long nonce) { | ||
81 | + return null; | ||
82 | + } | ||
83 | + | ||
84 | + @Override | ||
85 | + public NotifyBuilder withRecordCount(byte recordCount) { | ||
86 | + return null; | ||
87 | + } | ||
88 | + | ||
89 | + @Override | ||
90 | + public NotifyBuilder withKeyId(short keyId) { | ||
91 | + return null; | ||
92 | + } | ||
93 | + | ||
94 | + @Override | ||
95 | + public NotifyBuilder withAuthenticationData(byte[] authenticationData) { | ||
96 | + return null; | ||
97 | + } | ||
98 | + | ||
99 | + @Override | ||
100 | + public NotifyBuilder addRecord(LispRecord record) { | ||
101 | + return null; | ||
102 | + } | ||
103 | + } | ||
39 | } | 104 | } | ... | ... |
... | @@ -17,6 +17,8 @@ package org.onosproject.lisp.msg.protocols; | ... | @@ -17,6 +17,8 @@ package org.onosproject.lisp.msg.protocols; |
17 | 17 | ||
18 | import io.netty.buffer.ByteBuf; | 18 | import io.netty.buffer.ByteBuf; |
19 | 19 | ||
20 | +import java.util.List; | ||
21 | + | ||
20 | /** | 22 | /** |
21 | * Default LISP map register message class. | 23 | * Default LISP map register message class. |
22 | */ | 24 | */ |
... | @@ -35,4 +37,87 @@ public class DefaultLispMapRegister implements LispMapRegister { | ... | @@ -35,4 +37,87 @@ public class DefaultLispMapRegister implements LispMapRegister { |
35 | public Builder createBuilder() { | 37 | public Builder createBuilder() { |
36 | return null; | 38 | return null; |
37 | } | 39 | } |
40 | + | ||
41 | + @Override | ||
42 | + public boolean isProxyMapReply() { | ||
43 | + return false; | ||
44 | + } | ||
45 | + | ||
46 | + @Override | ||
47 | + public boolean isWantMapNotify() { | ||
48 | + return false; | ||
49 | + } | ||
50 | + | ||
51 | + @Override | ||
52 | + public byte getRecordCount() { | ||
53 | + return 0; | ||
54 | + } | ||
55 | + | ||
56 | + @Override | ||
57 | + public long getNonce() { | ||
58 | + return 0; | ||
59 | + } | ||
60 | + | ||
61 | + @Override | ||
62 | + public short getKeyId() { | ||
63 | + return 0; | ||
64 | + } | ||
65 | + | ||
66 | + @Override | ||
67 | + public byte[] getAuthenticationData() { | ||
68 | + return new byte[0]; | ||
69 | + } | ||
70 | + | ||
71 | + @Override | ||
72 | + public List<LispRecord> getLispRecords() { | ||
73 | + return null; | ||
74 | + } | ||
75 | + | ||
76 | + public static final class DefaultRegisterBuilder implements RegisterBuilder { | ||
77 | + | ||
78 | + @Override | ||
79 | + public LispMessage build() { | ||
80 | + return null; | ||
81 | + } | ||
82 | + | ||
83 | + @Override | ||
84 | + public LispType getType() { | ||
85 | + return null; | ||
86 | + } | ||
87 | + | ||
88 | + @Override | ||
89 | + public RegisterBuilder withIsProxyMapReply(boolean isProxyMapReply) { | ||
90 | + return null; | ||
91 | + } | ||
92 | + | ||
93 | + @Override | ||
94 | + public RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify) { | ||
95 | + return null; | ||
96 | + } | ||
97 | + | ||
98 | + @Override | ||
99 | + public RegisterBuilder withRecordCount(byte recordCount) { | ||
100 | + return null; | ||
101 | + } | ||
102 | + | ||
103 | + @Override | ||
104 | + public RegisterBuilder withNonce(long nonce) { | ||
105 | + return null; | ||
106 | + } | ||
107 | + | ||
108 | + @Override | ||
109 | + public RegisterBuilder withKeyId(short keyId) { | ||
110 | + return null; | ||
111 | + } | ||
112 | + | ||
113 | + @Override | ||
114 | + public RegisterBuilder withAuthenticationData(byte[] authenticationData) { | ||
115 | + return null; | ||
116 | + } | ||
117 | + | ||
118 | + @Override | ||
119 | + public RegisterBuilder addRecord(LispRecord record) { | ||
120 | + return null; | ||
121 | + } | ||
122 | + } | ||
38 | } | 123 | } | ... | ... |
... | @@ -35,4 +35,67 @@ public class DefaultLispMapReply implements LispMapReply { | ... | @@ -35,4 +35,67 @@ public class DefaultLispMapReply implements LispMapReply { |
35 | public Builder createBuilder() { | 35 | public Builder createBuilder() { |
36 | return null; | 36 | return null; |
37 | } | 37 | } |
38 | + | ||
39 | + @Override | ||
40 | + public boolean isProbe() { | ||
41 | + return false; | ||
42 | + } | ||
43 | + | ||
44 | + @Override | ||
45 | + public boolean isEtr() { | ||
46 | + return false; | ||
47 | + } | ||
48 | + | ||
49 | + @Override | ||
50 | + public boolean isSecurity() { | ||
51 | + return false; | ||
52 | + } | ||
53 | + | ||
54 | + @Override | ||
55 | + public byte getRecordCount() { | ||
56 | + return 0; | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + public long getNonce() { | ||
61 | + return 0; | ||
62 | + } | ||
63 | + | ||
64 | + public static final class DefaultReplyBuilder implements ReplyBuilder { | ||
65 | + | ||
66 | + @Override | ||
67 | + public LispMessage build() { | ||
68 | + return null; | ||
69 | + } | ||
70 | + | ||
71 | + @Override | ||
72 | + public LispType getType() { | ||
73 | + return null; | ||
74 | + } | ||
75 | + | ||
76 | + @Override | ||
77 | + public ReplyBuilder withIsProbe(boolean isProbe) { | ||
78 | + return null; | ||
79 | + } | ||
80 | + | ||
81 | + @Override | ||
82 | + public ReplyBuilder withIsEtr(boolean isEtr) { | ||
83 | + return null; | ||
84 | + } | ||
85 | + | ||
86 | + @Override | ||
87 | + public ReplyBuilder withIsSecurity(boolean isSecurity) { | ||
88 | + return null; | ||
89 | + } | ||
90 | + | ||
91 | + @Override | ||
92 | + public ReplyBuilder withRecordCount(byte recordCount) { | ||
93 | + return null; | ||
94 | + } | ||
95 | + | ||
96 | + @Override | ||
97 | + public ReplyBuilder withNonce(long nonce) { | ||
98 | + return null; | ||
99 | + } | ||
100 | + } | ||
38 | } | 101 | } | ... | ... |
... | @@ -16,6 +16,9 @@ | ... | @@ -16,6 +16,9 @@ |
16 | package org.onosproject.lisp.msg.protocols; | 16 | package org.onosproject.lisp.msg.protocols; |
17 | 17 | ||
18 | import io.netty.buffer.ByteBuf; | 18 | import io.netty.buffer.ByteBuf; |
19 | +import org.onosproject.lisp.msg.types.LispAfiAddress; | ||
20 | + | ||
21 | +import java.util.List; | ||
19 | 22 | ||
20 | /** | 23 | /** |
21 | * Default LISP map request message class. | 24 | * Default LISP map request message class. |
... | @@ -35,4 +38,112 @@ public class DefaultLispMapRequest implements LispMapRequest { | ... | @@ -35,4 +38,112 @@ public class DefaultLispMapRequest implements LispMapRequest { |
35 | public Builder createBuilder() { | 38 | public Builder createBuilder() { |
36 | return null; | 39 | return null; |
37 | } | 40 | } |
41 | + | ||
42 | + @Override | ||
43 | + public boolean isAuthoritative() { | ||
44 | + return false; | ||
45 | + } | ||
46 | + | ||
47 | + @Override | ||
48 | + public boolean isProbe() { | ||
49 | + return false; | ||
50 | + } | ||
51 | + | ||
52 | + @Override | ||
53 | + public boolean isSmr() { | ||
54 | + return false; | ||
55 | + } | ||
56 | + | ||
57 | + @Override | ||
58 | + public boolean isPitr() { | ||
59 | + return false; | ||
60 | + } | ||
61 | + | ||
62 | + @Override | ||
63 | + public boolean isSmrInvoked() { | ||
64 | + return false; | ||
65 | + } | ||
66 | + | ||
67 | + @Override | ||
68 | + public byte getRecordCount() { | ||
69 | + return 0; | ||
70 | + } | ||
71 | + | ||
72 | + @Override | ||
73 | + public long getNonce() { | ||
74 | + return 0; | ||
75 | + } | ||
76 | + | ||
77 | + @Override | ||
78 | + public LispAfiAddress getSourceEid() { | ||
79 | + return null; | ||
80 | + } | ||
81 | + | ||
82 | + @Override | ||
83 | + public List<LispAfiAddress> getItrRlocs() { | ||
84 | + return null; | ||
85 | + } | ||
86 | + | ||
87 | + @Override | ||
88 | + public List<EidRecord> getEids() { | ||
89 | + return null; | ||
90 | + } | ||
91 | + | ||
92 | + public static final class DefaultRequestBuilder implements RequestBuilder { | ||
93 | + | ||
94 | + @Override | ||
95 | + public LispMessage build() { | ||
96 | + return null; | ||
97 | + } | ||
98 | + | ||
99 | + @Override | ||
100 | + public LispType getType() { | ||
101 | + return null; | ||
102 | + } | ||
103 | + | ||
104 | + @Override | ||
105 | + public RequestBuilder withIsAuthoritative(boolean isAuthoritative) { | ||
106 | + return null; | ||
107 | + } | ||
108 | + | ||
109 | + @Override | ||
110 | + public RequestBuilder withIsProbe(boolean isProbe) { | ||
111 | + return null; | ||
112 | + } | ||
113 | + | ||
114 | + @Override | ||
115 | + public RequestBuilder withIsSmr(boolean isSmr) { | ||
116 | + return null; | ||
117 | + } | ||
118 | + | ||
119 | + @Override | ||
120 | + public RequestBuilder withIsPitr(boolean isPitr) { | ||
121 | + return null; | ||
122 | + } | ||
123 | + | ||
124 | + @Override | ||
125 | + public RequestBuilder withIsSmrInvoked(boolean isSmrInvoked) { | ||
126 | + return null; | ||
127 | + } | ||
128 | + | ||
129 | + @Override | ||
130 | + public RequestBuilder withRecordCount(byte recordCount) { | ||
131 | + return null; | ||
132 | + } | ||
133 | + | ||
134 | + @Override | ||
135 | + public RequestBuilder withNonce(long nonce) { | ||
136 | + return null; | ||
137 | + } | ||
138 | + | ||
139 | + @Override | ||
140 | + public RequestBuilder withItrRloc(LispAfiAddress itrRloc) { | ||
141 | + return null; | ||
142 | + } | ||
143 | + | ||
144 | + @Override | ||
145 | + public RequestBuilder addEidRecord(EidRecord record) { | ||
146 | + return null; | ||
147 | + } | ||
148 | + } | ||
38 | } | 149 | } | ... | ... |
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 EID record section which is part of LISP map request message. | ||
20 | + */ | ||
21 | +public class EidRecord { | ||
22 | +} |
... | @@ -15,8 +15,123 @@ | ... | @@ -15,8 +15,123 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.lisp.msg.protocols; | 16 | package org.onosproject.lisp.msg.protocols; |
17 | 17 | ||
18 | +import java.util.List; | ||
19 | + | ||
18 | /** | 20 | /** |
19 | * LISP map notify message interface. | 21 | * LISP map notify message interface. |
22 | + * | ||
23 | + * LISP map notify message format is defined in RFC6830. | ||
24 | + * https://tools.ietf.org/html/rfc6830#page-39 | ||
25 | + * | ||
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=4 | Reserved | Record Count | | ||
30 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
31 | + * | Nonce . . . | | ||
32 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
33 | + * | . . . Nonce | | ||
34 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
35 | + * | Key ID | Authentication Data Length | | ||
36 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
37 | + * ~ Authentication Data ~ | ||
38 | + * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
39 | + * | | Record TTL | | ||
40 | + * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
41 | + * R | Locator Count | EID mask-len | ACT |A| Reserved | | ||
42 | + * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
43 | + * c | Rsvd | Map-Version Number | EID-Prefix-AFI | | ||
44 | + * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
45 | + * r | EID-Prefix | | ||
46 | + * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
47 | + * | /| Priority | Weight | M Priority | M Weight | | ||
48 | + * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
49 | + * | o | Unused Flags |L|p|R| Loc-AFI | | ||
50 | + * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
51 | + * | \| Locator | | ||
52 | + * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
53 | + * | ||
20 | */ | 54 | */ |
21 | public interface LispMapNotify extends LispMessage { | 55 | public interface LispMapNotify extends LispMessage { |
56 | + | ||
57 | + /** | ||
58 | + * Obtains nonce value. | ||
59 | + * | ||
60 | + * @return nonce value | ||
61 | + */ | ||
62 | + long getNonce(); | ||
63 | + | ||
64 | + /** | ||
65 | + * Obtains record count value. | ||
66 | + * | ||
67 | + * @return record count value | ||
68 | + */ | ||
69 | + byte getRecordCount(); | ||
70 | + | ||
71 | + /** | ||
72 | + * Obtains key identifier. | ||
73 | + * | ||
74 | + * @return key identifier | ||
75 | + */ | ||
76 | + short getKeyId(); | ||
77 | + | ||
78 | + /** | ||
79 | + * Obtains authentication data. | ||
80 | + * | ||
81 | + * @return authentication data | ||
82 | + */ | ||
83 | + byte[] getAuthenticationData(); | ||
84 | + | ||
85 | + /** | ||
86 | + * Obtains a collection of records. | ||
87 | + * | ||
88 | + * @return a collection of records | ||
89 | + */ | ||
90 | + List<LispRecord> getLispRecords(); | ||
91 | + | ||
92 | + /** | ||
93 | + * A builder of LISP map notify message. | ||
94 | + */ | ||
95 | + interface NotifyBuilder extends Builder { | ||
96 | + | ||
97 | + /** | ||
98 | + * Sets nonce value. | ||
99 | + * | ||
100 | + * @param nonce nonce value | ||
101 | + * @return NotifyBuilder object | ||
102 | + */ | ||
103 | + NotifyBuilder withNonce(long nonce); | ||
104 | + | ||
105 | + /** | ||
106 | + * Sets record count. | ||
107 | + * | ||
108 | + * @param recordCount record count | ||
109 | + * @return NotifyBuilder object | ||
110 | + */ | ||
111 | + NotifyBuilder withRecordCount(byte recordCount); | ||
112 | + | ||
113 | + /** | ||
114 | + * Sets key identitifer. | ||
115 | + * | ||
116 | + * @param keyId key identifier | ||
117 | + * @return NotifyBuilder object | ||
118 | + */ | ||
119 | + NotifyBuilder withKeyId(short keyId); | ||
120 | + | ||
121 | + /** | ||
122 | + * Sets authentication data. | ||
123 | + * | ||
124 | + * @param authenticationData authentication data | ||
125 | + * @return NotifyBuilder object | ||
126 | + */ | ||
127 | + NotifyBuilder withAuthenticationData(byte[] authenticationData); | ||
128 | + | ||
129 | + /** | ||
130 | + * Adds a new record to record list. | ||
131 | + * | ||
132 | + * @param record record | ||
133 | + * @return NotifyBuilder object | ||
134 | + */ | ||
135 | + NotifyBuilder addRecord(LispRecord record); | ||
136 | + } | ||
22 | } | 137 | } | ... | ... |
... | @@ -15,8 +15,152 @@ | ... | @@ -15,8 +15,152 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.lisp.msg.protocols; | 16 | package org.onosproject.lisp.msg.protocols; |
17 | 17 | ||
18 | +import java.util.List; | ||
19 | + | ||
18 | /** | 20 | /** |
19 | * LISP map register message interface. | 21 | * LISP map register message interface. |
22 | + * | ||
23 | + * LISP map register message format is defined in RFC6830. | ||
24 | + * https://tools.ietf.org/html/rfc6830#page-37 | ||
25 | + * | ||
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=3 |P| Reserved |M| Record Count | | ||
30 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
31 | + * | Nonce . . . | | ||
32 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
33 | + * | . . . Nonce | | ||
34 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
35 | + * | Key ID | Authentication Data Length | | ||
36 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
37 | + * ~ Authentication Data ~ | ||
38 | + * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
39 | + * | | Record TTL | | ||
40 | + * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
41 | + * R | Locator Count | EID mask-len | ACT |A| Reserved | | ||
42 | + * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
43 | + * c | Rsvd | Map-Version Number | EID-Prefix-AFI | | ||
44 | + * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
45 | + * r | EID-Prefix | | ||
46 | + * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
47 | + * | /| Priority | Weight | M Priority | M Weight | | ||
48 | + * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
49 | + * | o | Unused Flags |L|p|R| Loc-AFI | | ||
50 | + * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
51 | + * | \| Locator | | ||
52 | + * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
20 | */ | 53 | */ |
21 | public interface LispMapRegister extends LispMessage { | 54 | public interface LispMapRegister extends LispMessage { |
55 | + | ||
56 | + /** | ||
57 | + * Obtains proxy map reply flag. | ||
58 | + * | ||
59 | + * @return proxy map reply flag | ||
60 | + */ | ||
61 | + boolean isProxyMapReply(); | ||
62 | + | ||
63 | + /** | ||
64 | + * Obtains want map notify flag. | ||
65 | + * | ||
66 | + * @return want map notify flag | ||
67 | + */ | ||
68 | + boolean isWantMapNotify(); | ||
69 | + | ||
70 | + /** | ||
71 | + * Obtains record count value. | ||
72 | + * | ||
73 | + * @return record count value | ||
74 | + */ | ||
75 | + byte getRecordCount(); | ||
76 | + | ||
77 | + /** | ||
78 | + * Obtains nonce value. | ||
79 | + * | ||
80 | + * @return nonce value | ||
81 | + */ | ||
82 | + long getNonce(); | ||
83 | + | ||
84 | + /** | ||
85 | + * Obtains key identifier. | ||
86 | + * | ||
87 | + * @return key identifier | ||
88 | + */ | ||
89 | + short getKeyId(); | ||
90 | + | ||
91 | + /** | ||
92 | + * Obtains authentication data. | ||
93 | + * | ||
94 | + * @return authentication data | ||
95 | + */ | ||
96 | + byte[] getAuthenticationData(); | ||
97 | + | ||
98 | + /** | ||
99 | + * Obtains a collection of records. | ||
100 | + * | ||
101 | + * @return a collection of records | ||
102 | + */ | ||
103 | + List<LispRecord> getLispRecords(); | ||
104 | + | ||
105 | + /** | ||
106 | + * A builder of LISP map register message. | ||
107 | + */ | ||
108 | + interface RegisterBuilder extends Builder { | ||
109 | + | ||
110 | + /** | ||
111 | + * Sets isProxyMapReply flag. | ||
112 | + * | ||
113 | + * @param isProxyMapReply isProxyMapReply | ||
114 | + * @return RegisterBuilder object | ||
115 | + */ | ||
116 | + RegisterBuilder withIsProxyMapReply(boolean isProxyMapReply); | ||
117 | + | ||
118 | + /** | ||
119 | + * Sets isWantMapNotify flag. | ||
120 | + * | ||
121 | + * @param isWantMapNotify isWantMapNotify | ||
122 | + * @return RegisterBuilder object | ||
123 | + */ | ||
124 | + RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify); | ||
125 | + | ||
126 | + /** | ||
127 | + * Sets record count. | ||
128 | + * | ||
129 | + * @param recordCount record count | ||
130 | + * @return RegisterBuilder object | ||
131 | + */ | ||
132 | + RegisterBuilder withRecordCount(byte recordCount); | ||
133 | + | ||
134 | + /** | ||
135 | + * Sets nonce value. | ||
136 | + * | ||
137 | + * @param nonce nonce value | ||
138 | + * @return RegisterBuilder object | ||
139 | + */ | ||
140 | + RegisterBuilder withNonce(long nonce); | ||
141 | + | ||
142 | + /** | ||
143 | + * Sets key identifier. | ||
144 | + * | ||
145 | + * @param keyId key identifier | ||
146 | + * @return RegisterBuilder object | ||
147 | + */ | ||
148 | + RegisterBuilder withKeyId(short keyId); | ||
149 | + | ||
150 | + /** | ||
151 | + * Sets authentication data. | ||
152 | + * | ||
153 | + * @param authenticationData authentication data | ||
154 | + * @return RegisterBuilder object | ||
155 | + */ | ||
156 | + RegisterBuilder withAuthenticationData(byte[] authenticationData); | ||
157 | + | ||
158 | + /** | ||
159 | + * Adds a new record to record list. | ||
160 | + * | ||
161 | + * @param record record | ||
162 | + * @return RegisterBuilder object | ||
163 | + */ | ||
164 | + RegisterBuilder addRecord(LispRecord record); | ||
165 | + } | ||
22 | } | 166 | } | ... | ... |
... | @@ -17,6 +17,114 @@ package org.onosproject.lisp.msg.protocols; | ... | @@ -17,6 +17,114 @@ package org.onosproject.lisp.msg.protocols; |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * LISP map reply message interface. | 19 | * LISP map reply message interface. |
20 | + * | ||
21 | + * LISP map reply message format is defined in RFC6830. | ||
22 | + * https://tools.ietf.org/html/rfc6830#page-31 | ||
23 | + * | ||
24 | + * 0 1 2 3 | ||
25 | + * 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 | ||
26 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
27 | + * |Type=2 |P|E|S| Reserved | Record Count | | ||
28 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
29 | + * | Nonce . . . | | ||
30 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
31 | + * | . . . Nonce | | ||
32 | + * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
33 | + * | | Record TTL | | ||
34 | + * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
35 | + * R | Locator Count | EID mask-len | ACT |A| Reserved | | ||
36 | + * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
37 | + * c | Rsvd | Map-Version Number | EID-Prefix-AFI | | ||
38 | + * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
39 | + * r | EID-Prefix | | ||
40 | + * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
41 | + * | /| Priority | Weight | M Priority | M Weight | | ||
42 | + * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
43 | + * | o | Unused Flags |L|p|R| Loc-AFI | | ||
44 | + * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
45 | + * | \| Locator | | ||
46 | + * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
20 | */ | 47 | */ |
21 | public interface LispMapReply extends LispMessage { | 48 | public interface LispMapReply extends LispMessage { |
49 | + | ||
50 | + /** | ||
51 | + * Obtains probe flag. | ||
52 | + * | ||
53 | + * @return probe flag | ||
54 | + */ | ||
55 | + boolean isProbe(); | ||
56 | + | ||
57 | + /** | ||
58 | + * Obtains ETR flag. | ||
59 | + * | ||
60 | + * @return ETR flag | ||
61 | + */ | ||
62 | + boolean isEtr(); | ||
63 | + | ||
64 | + /** | ||
65 | + * Obtains security flag. | ||
66 | + * | ||
67 | + * @return security flag | ||
68 | + */ | ||
69 | + boolean isSecurity(); | ||
70 | + | ||
71 | + /** | ||
72 | + * Obtains record count value. | ||
73 | + * | ||
74 | + * @return record count value | ||
75 | + */ | ||
76 | + byte getRecordCount(); | ||
77 | + | ||
78 | + /** | ||
79 | + * Obtains nonce value. | ||
80 | + * | ||
81 | + * @return nonce value | ||
82 | + */ | ||
83 | + long getNonce(); | ||
84 | + | ||
85 | + /** | ||
86 | + * A builder of LISP map reply message. | ||
87 | + */ | ||
88 | + interface ReplyBuilder extends Builder { | ||
89 | + | ||
90 | + /** | ||
91 | + * Sets isProbe flag. | ||
92 | + * | ||
93 | + * @param isProbe isProbe flag | ||
94 | + * @return ReplyBuilder object | ||
95 | + */ | ||
96 | + ReplyBuilder withIsProbe(boolean isProbe); | ||
97 | + | ||
98 | + /** | ||
99 | + * Sets isEtr flag. | ||
100 | + * | ||
101 | + * @param isEtr isEtr flag | ||
102 | + * @return ReplyBuilder object | ||
103 | + */ | ||
104 | + ReplyBuilder withIsEtr(boolean isEtr); | ||
105 | + | ||
106 | + /** | ||
107 | + * Sets isSecurity flag. | ||
108 | + * | ||
109 | + * @param isSecurity isSecurity flag | ||
110 | + * @return ReplyBuilder object | ||
111 | + */ | ||
112 | + ReplyBuilder withIsSecurity(boolean isSecurity); | ||
113 | + | ||
114 | + /** | ||
115 | + * Sets record count. | ||
116 | + * | ||
117 | + * @param recordCount record count | ||
118 | + * @return ReplyBuilder object | ||
119 | + */ | ||
120 | + ReplyBuilder withRecordCount(byte recordCount); | ||
121 | + | ||
122 | + /** | ||
123 | + * Sets nonce value. | ||
124 | + * | ||
125 | + * @param nonce nonce value | ||
126 | + * @return ReplyBuilder object | ||
127 | + */ | ||
128 | + ReplyBuilder withNonce(long nonce); | ||
129 | + } | ||
22 | } | 130 | } | ... | ... |
... | @@ -15,8 +15,187 @@ | ... | @@ -15,8 +15,187 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.lisp.msg.protocols; | 16 | package org.onosproject.lisp.msg.protocols; |
17 | 17 | ||
18 | +import org.onosproject.lisp.msg.types.LispAfiAddress; | ||
19 | + | ||
20 | +import java.util.List; | ||
21 | + | ||
18 | /** | 22 | /** |
19 | * LISP map request message interface. | 23 | * LISP map request message interface. |
24 | + * | ||
25 | + * LISP map request message format is defined in RFC6830. | ||
26 | + * https://tools.ietf.org/html/rfc6830#page-27 | ||
27 | + * | ||
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=1 |A|M|P|S|p|s| Reserved | IRC | Record Count | | ||
32 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
33 | + * | Nonce . . . | | ||
34 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
35 | + * | . . . Nonce | | ||
36 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
37 | + * | Source-EID-AFI | Source EID Address ... | | ||
38 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
39 | + * | ITR-RLOC-AFI 1 | ITR-RLOC Address 1 ... | | ||
40 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
41 | + * | ... | | ||
42 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
43 | + * | ITR-RLOC-AFI n | ITR-RLOC Address n ... | | ||
44 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
45 | + * / | Reserved | EID mask-len | EID-Prefix-AFI | | ||
46 | + * Rec +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
47 | + * \ | EID-Prefix ... | | ||
48 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
49 | + * | Map-Reply Record ... | | ||
50 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
20 | */ | 51 | */ |
21 | public interface LispMapRequest extends LispMessage { | 52 | public interface LispMapRequest extends LispMessage { |
53 | + | ||
54 | + /** | ||
55 | + * Obtains authoritative flag. | ||
56 | + * | ||
57 | + * @return authoritative flag | ||
58 | + */ | ||
59 | + boolean isAuthoritative(); | ||
60 | + | ||
61 | + /** | ||
62 | + * Obtains probe flag. | ||
63 | + * | ||
64 | + * @return probe flag | ||
65 | + */ | ||
66 | + boolean isProbe(); | ||
67 | + | ||
68 | + /** | ||
69 | + * Obtains SMR flag. | ||
70 | + * | ||
71 | + * @return SMR flag | ||
72 | + */ | ||
73 | + boolean isSmr(); | ||
74 | + | ||
75 | + /** | ||
76 | + * Obtains PITR flag. | ||
77 | + * | ||
78 | + * @return PITR flag | ||
79 | + */ | ||
80 | + boolean isPitr(); | ||
81 | + | ||
82 | + /** | ||
83 | + * Obtains SMR Invoked flag. | ||
84 | + * | ||
85 | + * @return SMR invoked flag | ||
86 | + */ | ||
87 | + boolean isSmrInvoked(); | ||
88 | + | ||
89 | + /** | ||
90 | + * Obtains record count value. | ||
91 | + * | ||
92 | + * @return record count value | ||
93 | + */ | ||
94 | + byte getRecordCount(); | ||
95 | + | ||
96 | + /** | ||
97 | + * Obtains nonce value. | ||
98 | + * | ||
99 | + * @return nonce value | ||
100 | + */ | ||
101 | + long getNonce(); | ||
102 | + | ||
103 | + /** | ||
104 | + * Obtains source EID. | ||
105 | + * | ||
106 | + * @return source EID | ||
107 | + */ | ||
108 | + LispAfiAddress getSourceEid(); | ||
109 | + | ||
110 | + /** | ||
111 | + * Obtains a collection of ITR RLOCs. | ||
112 | + * | ||
113 | + * @return a collection of ITR RLOCs | ||
114 | + */ | ||
115 | + List<LispAfiAddress> getItrRlocs(); | ||
116 | + | ||
117 | + /** | ||
118 | + * Obtains a collection of EID records. | ||
119 | + * | ||
120 | + * @return a collection of EID records | ||
121 | + */ | ||
122 | + List<EidRecord> getEids(); | ||
123 | + | ||
124 | + /** | ||
125 | + * A builder of LISP map request message. | ||
126 | + */ | ||
127 | + interface RequestBuilder extends Builder { | ||
128 | + | ||
129 | + /** | ||
130 | + * Sets isAuthoritative flag. | ||
131 | + * | ||
132 | + * @param isAuthoritative isAuthoritative flag | ||
133 | + * @return RequestBuilder object | ||
134 | + */ | ||
135 | + RequestBuilder withIsAuthoritative(boolean isAuthoritative); | ||
136 | + | ||
137 | + /** | ||
138 | + * Sets isProbe flag. | ||
139 | + * | ||
140 | + * @param isProbe isProbe flag | ||
141 | + * @return RequestBuilder object | ||
142 | + */ | ||
143 | + RequestBuilder withIsProbe(boolean isProbe); | ||
144 | + | ||
145 | + /** | ||
146 | + * Sets isSmr flag. | ||
147 | + * | ||
148 | + * @param isSmr isSmr flag | ||
149 | + * @return RequestBuilder object | ||
150 | + */ | ||
151 | + RequestBuilder withIsSmr(boolean isSmr); | ||
152 | + | ||
153 | + /** | ||
154 | + * Sets isPitr flag. | ||
155 | + * | ||
156 | + * @param isPitr isPitr flag | ||
157 | + * @return RequestBuilder object | ||
158 | + */ | ||
159 | + RequestBuilder withIsPitr(boolean isPitr); | ||
160 | + | ||
161 | + /** | ||
162 | + * Sets isSmrInvoked flag. | ||
163 | + * | ||
164 | + * @param isSmrInvoked isSmrInvoked flag | ||
165 | + * @return RequestBuilder object | ||
166 | + */ | ||
167 | + RequestBuilder withIsSmrInvoked(boolean isSmrInvoked); | ||
168 | + | ||
169 | + /** | ||
170 | + * Sets record count. | ||
171 | + * | ||
172 | + * @param recordCount record count | ||
173 | + * @return RequestBuilder object | ||
174 | + */ | ||
175 | + RequestBuilder withRecordCount(byte recordCount); | ||
176 | + | ||
177 | + /** | ||
178 | + * Sets nonce value. | ||
179 | + * | ||
180 | + * @param nonce nonce value | ||
181 | + * @return RequestBuilder object | ||
182 | + */ | ||
183 | + RequestBuilder withNonce(long nonce); | ||
184 | + | ||
185 | + /** | ||
186 | + * Adds ITR RLOC into RLOC collection. | ||
187 | + * | ||
188 | + * @param itrRloc ITR RLOC | ||
189 | + * @return RequestBuilder object | ||
190 | + */ | ||
191 | + RequestBuilder withItrRloc(LispAfiAddress itrRloc); | ||
192 | + | ||
193 | + /** | ||
194 | + * Adds EID record into record collection. | ||
195 | + * | ||
196 | + * @param record EID record | ||
197 | + * @return RequestBuilder object | ||
198 | + */ | ||
199 | + RequestBuilder addEidRecord(EidRecord record); | ||
200 | + } | ||
22 | } | 201 | } | ... | ... |
... | @@ -46,7 +46,7 @@ public interface LispMessage { | ... | @@ -46,7 +46,7 @@ public interface LispMessage { |
46 | /** | 46 | /** |
47 | * LISP message builder interface. | 47 | * LISP message builder interface. |
48 | */ | 48 | */ |
49 | - interface Builder { | 49 | + interface Builder { |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Builds LISP message. | 52 | * Builds LISP message. | ... | ... |
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 record section which is part of LISP map register message. | ||
20 | + */ | ||
21 | +public class LispRecord { | ||
22 | + | ||
23 | +} |
-
Please register or login to post a comment