Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 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 | */ |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 16 | package org.onosproject.isis.controller; |
| 17 | |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 18 | import org.jboss.netty.buffer.ChannelBuffer; |
| 19 | import org.onlab.packet.MacAddress; |
| 20 | |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 21 | /** |
| 22 | * Representation of an ISIS Message. |
| 23 | */ |
| 24 | public interface IsisMessage { |
| 25 | |
| 26 | /** |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 27 | * Returns the interface index on which the message received. |
| 28 | * |
| 29 | * @return interface index on which the message received |
| 30 | */ |
| 31 | int interfaceIndex(); |
| 32 | |
| 33 | /** |
| 34 | * Sets the interface index on which the message received. |
| 35 | * |
| 36 | * @param interfaceIndex interface index on which the message received |
| 37 | */ |
| 38 | void setInterfaceIndex(int interfaceIndex); |
| 39 | |
| 40 | /** |
| 41 | * Returns the interface mac address on which the message received. |
| 42 | * |
| 43 | * @return interface mac address on which the message received |
| 44 | */ |
| 45 | MacAddress interfaceMac(); |
| 46 | |
| 47 | /** |
| 48 | * Sets the interface mac address on which the message received. |
| 49 | * |
| 50 | * @param interfaceMac mac address on which the message received |
| 51 | */ |
| 52 | void setInterfaceMac(MacAddress interfaceMac); |
| 53 | |
| 54 | /** |
| 55 | * Returns the mac address of the message sender. |
| 56 | * |
| 57 | * @return mac address of the message sender |
| 58 | */ |
| 59 | MacAddress sourceMac(); |
| 60 | |
| 61 | /** |
| 62 | * Sets the mac address of the message sender. |
| 63 | * |
| 64 | * @param sourceMac mac address of the message sender |
| 65 | */ |
| 66 | void setSourceMac(MacAddress sourceMac); |
| 67 | |
| 68 | /** |
| 69 | * Returns the type of ISIS PDU. |
Kiran Ramachandra | c92a122 | 2016-03-30 13:05:31 +0530 | [diff] [blame] | 70 | * |
| 71 | * @return ISIS PDU type instance |
| 72 | */ |
| 73 | IsisPduType isisPduType(); |
mohamed rahil | 8ea09d4 | 2016-04-19 20:47:21 +0530 | [diff] [blame] | 74 | |
| 75 | /** |
| 76 | * Reads from channel buffer and initializes the type of PDU. |
| 77 | * |
| 78 | * @param channelBuffer channel buffer instance |
| 79 | */ |
| 80 | void readFrom(ChannelBuffer channelBuffer); |
| 81 | |
| 82 | /** |
| 83 | * Returns IsisMessage as byte array. |
| 84 | * |
| 85 | * @return ISIS message as bytes |
| 86 | */ |
| 87 | byte[] asBytes(); |
| 88 | } |