senthil | caaa74e | 2024-03-21 19:06:32 +0530 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2024-present Open Networking Foundation |
| 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 | |
| 17 | package org.onosproject.bgpmonitoring; |
| 18 | |
| 19 | import org.onosproject.bgpio.protocol.BgpMessage; |
| 20 | import java.net.InetAddress; |
| 21 | |
| 22 | /** |
| 23 | * Abstraction of an BMP peer up notification message. |
| 24 | */ |
| 25 | public abstract class PeerUpNotificationMessage extends BmpMessage { |
| 26 | |
| 27 | public static final int PEERUP_NOTIFICATION_HEADER_MIN_LENGTH = 40; |
| 28 | |
| 29 | public static final int PADDING_BYTES = 16; |
| 30 | |
| 31 | public static final int IPV4_ADDRS = 4; |
| 32 | |
| 33 | public static final int IPV6_ADDRS = 16; |
| 34 | |
| 35 | public static final int BGP_LENGTH_FIELD = 16; |
| 36 | |
| 37 | /** |
| 38 | * Returns BMP per peer header of BMP message. |
| 39 | * |
| 40 | * @return BMP per peer header of BMP message |
| 41 | */ |
| 42 | public abstract PerPeer getPerPeer(); |
| 43 | |
| 44 | /** |
| 45 | * Returns local ip address. |
| 46 | * |
| 47 | * @return local ip address |
| 48 | */ |
| 49 | public abstract InetAddress getLocalAddress(); |
| 50 | |
| 51 | /** |
| 52 | * Returns local port number. |
| 53 | * |
| 54 | * @return local port number |
| 55 | */ |
| 56 | public abstract int getLocalPort(); |
| 57 | |
| 58 | /** |
| 59 | * Returns remote port number. |
| 60 | * |
| 61 | * @return remote port number |
| 62 | */ |
| 63 | public abstract int getRemotePort(); |
| 64 | |
| 65 | /** |
| 66 | * Returns Bgp sent open message. |
| 67 | * |
| 68 | * @return Bgp sent open message |
| 69 | */ |
| 70 | public abstract BgpMessage getSentOpenMsg(); |
| 71 | |
| 72 | /** |
| 73 | * Returns Bgp received open message. |
| 74 | * |
| 75 | * @return Bgp received open message |
| 76 | */ |
| 77 | public abstract BgpMessage getReceivedOpenMsg(); |
| 78 | |
| 79 | /** |
| 80 | * Returns BMP peer information. |
| 81 | * |
| 82 | * @return BMP peer information |
| 83 | */ |
| 84 | public abstract byte[] getInformation(); |
| 85 | |
| 86 | } |