blob: a36c386529f7450c1441bca132c3bec7823f8606 [file] [log] [blame]
Jian Li35734392016-07-14 11:55:24 +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 Li6b77dc02016-07-14 16:04:25 +090016package org.onosproject.lisp.msg.types;
Jian Li35734392016-07-14 11:55:24 +090017
Jian Li115d8602016-08-15 20:21:53 +090018import io.netty.buffer.ByteBuf;
19import org.onosproject.lisp.msg.exceptions.LispParseError;
GUNiba871702016-08-22 21:06:02 +090020import org.onosproject.lisp.msg.exceptions.LispWriterException;
Jian Li115d8602016-08-15 20:21:53 +090021
Jian Li35734392016-07-14 11:55:24 +090022/**
Jian Li6b77dc02016-07-14 16:04:25 +090023 * No address.
Jian Li35734392016-07-14 11:55:24 +090024 */
Jian Li6b77dc02016-07-14 16:04:25 +090025public class LispNoAddress extends LispAfiAddress {
Jian Li35734392016-07-14 11:55:24 +090026
Jian Li6b77dc02016-07-14 16:04:25 +090027 /**
28 * Initializes no address.
29 */
30 public LispNoAddress() {
31 super(AddressFamilyIdentifierEnum.NO_ADDRESS);
32 }
Jian Li115d8602016-08-15 20:21:53 +090033
34 /**
35 * LISP no address reader class.
36 */
37 public static class NoAddressReader implements LispAddressReader<LispNoAddress> {
38
39 @Override
40 public LispNoAddress readFrom(ByteBuf byteBuf) throws LispParseError {
41 return new LispNoAddress();
42 }
43 }
GUNiba871702016-08-22 21:06:02 +090044
45 /**
46 * LISP no address writer class.
47 */
48 public static class NoAddressWriter implements LispAddressWriter<LispNoAddress> {
49
50 @Override
51 public void writeTo(ByteBuf byteBuf, LispNoAddress address) throws LispWriterException {
Jian Li6ef1b3f2016-11-12 18:16:06 +090052 // since there is nothing to write to channel, we just leave it empty
GUNiba871702016-08-22 21:06:02 +090053 }
54 }
Jian Li35734392016-07-14 11:55:24 +090055}