Ilayda Ozdemir | 4c5947c | 2020-05-05 13:14:32 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2017-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 | package org.opencord.igmpproxy.statemachine; |
| 17 | |
| 18 | import org.onlab.packet.Ip4Address; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | import org.onosproject.net.PortNumber; |
| 21 | |
| 22 | /** |
| 23 | * Manage State Machine and Igmp Timer. |
| 24 | */ |
| 25 | public interface StateMachineService { |
| 26 | |
| 27 | /** |
| 28 | * Makes the requirements of igmp-join request. |
| 29 | * |
| 30 | * @param devId device id of connect point |
| 31 | * @param groupIp group ip of igmp group |
| 32 | * @param srcIP source ip of device |
| 33 | * @param upLinkPort uplink port of device |
| 34 | * @return if this is first join from the device and group-ip return true |
| 35 | */ |
| 36 | boolean join(DeviceId devId, Ip4Address groupIp, Ip4Address srcIP, PortNumber upLinkPort); |
| 37 | |
| 38 | /** |
| 39 | * Makes the requirements of igmp-leave request. |
| 40 | * |
| 41 | * @param devId device id of connect point |
| 42 | * @param groupIp group ip of group-member |
| 43 | * @return If there are no more members of that device and group returns true |
| 44 | */ |
| 45 | boolean leave(DeviceId devId, Ip4Address groupIp); |
| 46 | |
| 47 | /** |
| 48 | * clear map of state-machine. |
| 49 | */ |
| 50 | void clearAllMaps(); |
| 51 | |
| 52 | /** |
| 53 | * Makes the requirements of special query. |
| 54 | * |
| 55 | * @param devId device id |
| 56 | * @param groupIp group ip of igmp group |
| 57 | * @param maxResp maximum resp of igmp |
| 58 | */ |
| 59 | void specialQuery(DeviceId devId, Ip4Address groupIp, int maxResp); |
| 60 | |
| 61 | /** |
| 62 | * Makes the requirements of igmp-query request. |
| 63 | * |
| 64 | * @param devId device id |
| 65 | * @param maxResp maximum resp of igmp |
| 66 | */ |
| 67 | void generalQuery(DeviceId devId, int maxResp); |
| 68 | |
| 69 | /** |
| 70 | * Makes the requirements of igmp-query request. |
| 71 | * |
| 72 | * @param maxResp maximum resp of igmp |
| 73 | */ |
| 74 | void generalQuery(int maxResp); |
| 75 | |
| 76 | /** |
| 77 | * Makes the requirements of timeout. |
| 78 | * |
| 79 | * @param devId device id |
| 80 | * @param groupIp group ip of igmp group |
| 81 | */ |
| 82 | void timeOut(DeviceId devId, Ip4Address groupIp); |
| 83 | |
| 84 | /** |
| 85 | * Checks all state-machines periodically. |
| 86 | */ |
| 87 | void timeOut1s(); |
| 88 | } |