blob: de823f23035d88066758c487c40377f5ad5503af [file] [log] [blame]
Kiran Ramachandrac92a1222016-03-30 13:05:31 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Kiran Ramachandrac92a1222016-03-30 13:05:31 +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 */
Kiran Ramachandrac92a1222016-03-30 13:05:31 +053016package org.onosproject.isis.controller;
17
mohamed rahil8ea09d42016-04-19 20:47:21 +053018import org.jboss.netty.buffer.ChannelBuffer;
19import org.onlab.packet.MacAddress;
20
Kiran Ramachandrac92a1222016-03-30 13:05:31 +053021/**
22 * Representation of an ISIS Message.
23 */
24public interface IsisMessage {
25
26 /**
mohamed rahil8ea09d42016-04-19 20:47:21 +053027 * 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 Ramachandrac92a1222016-03-30 13:05:31 +053070 *
71 * @return ISIS PDU type instance
72 */
73 IsisPduType isisPduType();
mohamed rahil8ea09d42016-04-19 20:47:21 +053074
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}