blob: a019677056ff97c14a46084b342b423b3e8f2889 [file] [log] [blame]
Jian Lie4f12162016-09-13 00:09:09 +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 */
Jian Li5e505c62016-12-05 02:44:24 +090016package org.onosproject.lisp.ctl.impl;
Jian Lie4f12162016-09-13 00:09:09 +090017
18import io.netty.buffer.ByteBuf;
19import org.onosproject.lisp.msg.protocols.LispMessage;
20import org.onosproject.lisp.msg.protocols.LispType;
21
Jian Liafe2d3f2016-11-01 02:49:07 +090022import java.net.InetSocketAddress;
23
Jian Lie4f12162016-09-13 00:09:09 +090024/**
25 * Adapter for testing against a LISP message.
26 */
27public 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 Liafe2d3f2016-11-01 02:49:07 +090042 public void configSender(InetSocketAddress sender) {
43
44 }
45
46 @Override
47 public InetSocketAddress getSender() {
Jonathan Hart5dc9a4e2017-01-13 09:09:57 -080048 return new InetSocketAddress(1);
Jian Liafe2d3f2016-11-01 02:49:07 +090049 }
50
51 @Override
Jian Lie4f12162016-09-13 00:09:09 +090052 public void writeTo(ByteBuf byteBuf) {
53
54 }
55
56 @Override
57 public Builder createBuilder() {
58 return null;
59 }
60}