blob: b278beb06a858a497d2cc9a7133d08b814142d11 [file] [log] [blame]
Priyanka B425e3c52015-11-13 14:31:15 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Priyanka B425e3c52015-11-13 14:31:15 +05303 *
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
17package org.onosproject.bgpio.protocol;
18
19import java.util.List;
20
Shashikanth VH44967ec2016-02-04 19:46:16 +053021import org.jboss.netty.buffer.ChannelBuffer;
Priyanka B425e3c52015-11-13 14:31:15 +053022import org.onlab.packet.IpPrefix;
23import org.onosproject.bgpio.protocol.ver4.BgpPathAttributes;
Shashikanth VH44967ec2016-02-04 19:46:16 +053024import org.onosproject.bgpio.types.BgpValueType;
25import org.onosproject.bgpio.types.BgpHeader;
Priyanka B425e3c52015-11-13 14:31:15 +053026
27/**
28 * Abstraction of an entity providing BGP Update Message.
29 */
Shashikanth VH5dd8dbe2015-11-26 13:22:18 +053030public interface BgpUpdateMsg extends BgpMessage {
Shashikanth VH44967ec2016-02-04 19:46:16 +053031
32 @Override
33 BgpVersion getVersion();
34
35 @Override
36 BgpType getType();
37
38 @Override
39 void writeTo(ChannelBuffer channelBuffer);
40
41 @Override
42 BgpHeader getHeader();
43
44 /**
45 * Builder interface with set functions to build update message.
46 */
47 interface Builder extends BgpMessage.Builder {
48 @Override
49 BgpUpdateMsg build();
50
51 Builder setBgpPathAttributes(List<BgpValueType> attributes);
52
Shashikanth VH44967ec2016-02-04 19:46:16 +053053 @Override
54 Builder setHeader(BgpHeader bgpMsgHeader);
55 }
56
Priyanka B425e3c52015-11-13 14:31:15 +053057 /**
58 * Returns path attributes in BGP Update Message.
59 *
60 * @return path attributes in BGP Update Message
61 */
62 BgpPathAttributes bgpPathAttributes();
63
64 /**
65 * Returns withdrawn Routes.
66 *
67 * @return withdrawn Routes
68 */
69 List<IpPrefix> withdrawnRoutes();
70
71 /**
72 * Returns NLRI list of prefix.
73 *
74 * @return NLRI list of prefix
75 */
76 List<IpPrefix> nlri();
77}