Jian Li | 2775935 | 2016-10-04 20:14:42 +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 | import org.onosproject.lisp.msg.protocols.LispMessage.Builder; |
| 19 | import org.onosproject.lisp.msg.types.LispAfiAddress; |
| 20 | |
| 21 | /** |
| 22 | * LISP info message interface. |
| 23 | */ |
| 24 | public interface InfoBuilder<T> extends Builder { |
| 25 | |
| 26 | /** |
| 27 | * Sets info reply flag value. |
| 28 | * |
| 29 | * @param infoReply info reply |
| 30 | * @return T object |
| 31 | */ |
Jian Li | 6ef1b3f | 2016-11-12 18:16:06 +0900 | [diff] [blame] | 32 | T withIsInfoReply(boolean infoReply); |
Jian Li | 2775935 | 2016-10-04 20:14:42 +0900 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Sets nonce value. |
| 36 | * |
| 37 | * @param nonce nonce value |
| 38 | * @return T object |
| 39 | */ |
| 40 | T withNonce(long nonce); |
| 41 | |
| 42 | /** |
| 43 | * Sets authentication data length. |
| 44 | * |
| 45 | * @param authDataLength authentication data length |
| 46 | * @return T object |
| 47 | */ |
| 48 | T withAuthDataLength(short authDataLength); |
| 49 | |
| 50 | /** |
| 51 | * Sets key identifier. |
| 52 | * |
| 53 | * @param keyId key identifier |
| 54 | * @return T object |
| 55 | */ |
| 56 | T withKeyId(short keyId); |
| 57 | |
| 58 | /** |
| 59 | * Sets authentication data. |
| 60 | * |
Jian Li | d1a109e | 2016-11-12 09:00:42 +0900 | [diff] [blame] | 61 | * @param authData authentication data |
Jian Li | 2775935 | 2016-10-04 20:14:42 +0900 | [diff] [blame] | 62 | * @return T object |
| 63 | */ |
Jian Li | d1a109e | 2016-11-12 09:00:42 +0900 | [diff] [blame] | 64 | T withAuthData(byte[] authData); |
| 65 | |
| 66 | /** |
| 67 | * Sets authentication key. |
| 68 | * |
| 69 | * @param key authentication key |
| 70 | * @return RegisterBuilder object |
| 71 | */ |
| 72 | T withAuthKey(String key); |
Jian Li | 2775935 | 2016-10-04 20:14:42 +0900 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * Sets Time-To-Live value. |
| 76 | * |
| 77 | * @param ttl Time-To-Live value |
| 78 | * @return T object |
| 79 | */ |
| 80 | T withTtl(int ttl); |
| 81 | |
| 82 | /** |
| 83 | * Sets EID prefix mask length. |
| 84 | * |
| 85 | * @param maskLength EID prefix mask length |
| 86 | * @return T object |
| 87 | */ |
| 88 | T withMaskLength(byte maskLength); |
| 89 | |
| 90 | /** |
| 91 | * Sets EID prefix. |
| 92 | * |
| 93 | * @param eidPrefix EID prefix |
| 94 | * @return T object |
| 95 | */ |
| 96 | T withEidPrefix(LispAfiAddress eidPrefix); |
| 97 | } |