Jian Li | e4f1216 | 2016-09-13 00:09:09 +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 | */ |
Jian Li | 5e505c6 | 2016-12-05 02:44:24 +0900 | [diff] [blame] | 16 | package org.onosproject.lisp.ctl.impl; |
Jian Li | e4f1216 | 2016-09-13 00:09:09 +0900 | [diff] [blame] | 17 | |
| 18 | import io.netty.buffer.ByteBuf; |
| 19 | import org.onosproject.lisp.msg.protocols.LispMessage; |
| 20 | import org.onosproject.lisp.msg.protocols.LispType; |
| 21 | |
Jian Li | afe2d3f | 2016-11-01 02:49:07 +0900 | [diff] [blame] | 22 | import java.net.InetSocketAddress; |
| 23 | |
Jian Li | e4f1216 | 2016-09-13 00:09:09 +0900 | [diff] [blame] | 24 | /** |
| 25 | * Adapter for testing against a LISP message. |
| 26 | */ |
| 27 | public class LispMessageAdapter implements LispMessage { |
| 28 | LispType type; |
| 29 | |
| 30 | private LispMessageAdapter() {} |
| 31 | |
| 32 | public LispMessageAdapter(LispType type) { |
| 33 | this.type = type; |
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | public LispType getType() { |
| 38 | return type; |
| 39 | } |
| 40 | |
| 41 | @Override |
Jian Li | afe2d3f | 2016-11-01 02:49:07 +0900 | [diff] [blame] | 42 | public void configSender(InetSocketAddress sender) { |
| 43 | |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | public InetSocketAddress getSender() { |
Jonathan Hart | 5dc9a4e | 2017-01-13 09:09:57 -0800 | [diff] [blame^] | 48 | return new InetSocketAddress(1); |
Jian Li | afe2d3f | 2016-11-01 02:49:07 +0900 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | @Override |
Jian Li | e4f1216 | 2016-09-13 00:09:09 +0900 | [diff] [blame] | 52 | public void writeTo(ByteBuf byteBuf) { |
| 53 | |
| 54 | } |
| 55 | |
| 56 | @Override |
| 57 | public Builder createBuilder() { |
| 58 | return null; |
| 59 | } |
| 60 | } |