blob: 1eebd870951fdc323a20897b4539a225fdd01faa [file] [log] [blame]
sunish vk30637eb2016-02-16 15:19:32 +05301/*
2 * Copyright 2016 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 */
16package org.onosproject.ospf.controller;
17
18import org.onlab.packet.Ip4Address;
19
20/**
21 * Abstraction of an OSPF Router.
22 */
23public interface OspfRouter {
24
25 /**
26 * Gets IP address of the router.
27 *
28 * @return IP address of the router
29 */
30 Ip4Address routerIp();
31
32 /**
33 * Gets the area id for this device.
34 *
35 * @return the area id for this device
36 */
37 Ip4Address areaIdOfInterface();
38
39 /**
40 * Gets IP address of the interface.
41 *
42 * @return IP address of the interface
43 */
44 Ip4Address interfaceId();
45
46 /**
47 * Gets list of device TED.
48 *
49 * @return list of device TED.
50 */
51 OspfDeviceTed deviceTed();
52
53 /**
54 * Sets IP address of the Router.
55 *
56 * @param routerIp IP address of the router
57 */
58 void setRouterIp(Ip4Address routerIp);
59
60 /**
61 * Sets area id in which this device belongs to.
62 *
63 * @param areaIdOfInterface area id in which this device belongs to
64 */
65 void setAreaIdOfInterface(Ip4Address areaIdOfInterface);
66
67 /**
68 * Sets IP address of the interface.
69 *
70 * @param interfaceId IP address of the interface
71 */
72 void setInterfaceId(Ip4Address interfaceId);
73
74 /**
75 * Sets the device TED information.
76 *
77 * @param deviceTed device TED instance
78 */
79 void setDeviceTed(OspfDeviceTed deviceTed);
80
81 /**
82 * Gets if router is opaque enabled.
83 *
84 * @return true if router is opaque enabled else false.
85 */
86 boolean isOpaque();
87
88 /**
89 * Sets true if device is opaque enable if not sets false.
90 *
91 * @param opaque true if device is opaque enable if not sets false
92 */
93 void setOpaque(boolean opaque);
94
95 /**
96 * Gets IP address of the advertising router.
97 *
98 * @return IP address of the advertising router
99 */
100 Ip4Address neighborRouterId();
101
102 /**
103 * Sets IP address of the advertising router.
104 *
105 * @param advertisingRouterId IP address of the advertising router
106 */
107 void setNeighborRouterId(Ip4Address advertisingRouterId);
108
109
110 /**
111 * Gets if the router id DR or not.
112 *
113 * @return true if the router is DR else false
114 */
115 boolean isDr();
116
117 /**
118 * Sets if the router id DR or not.
119 *
120 * @param dr true if the router is DR else false
121 */
122 void setDr(boolean dr);
123}