Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame^] | 2 | * Copyright 2017-present Open Networking Foundation |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [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 | */ |
| 16 | package org.onosproject.ofagent.api; |
| 17 | |
| 18 | import io.netty.channel.Channel; |
| 19 | import org.onosproject.net.Port; |
| 20 | import org.onosproject.net.flow.FlowRule; |
| 21 | import org.onosproject.net.packet.InboundPacket; |
| 22 | import org.projectfloodlight.openflow.protocol.OFMessage; |
| 23 | |
| 24 | /** |
| 25 | * Service for providing OpenFlow operations. |
| 26 | */ |
| 27 | public interface OFSwitchOperationService { |
| 28 | |
| 29 | /** |
| 30 | * Processes a new port of the switch. |
Claudine Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 31 | * It sends out PORT_STATUS asynchronous message to the controllers. |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 32 | * |
| 33 | * @param port virtual port |
| 34 | */ |
| 35 | void processPortAdded(Port port); |
| 36 | |
| 37 | /** |
Claudine Chiu | 785ef2d | 2017-07-04 13:13:28 -0400 | [diff] [blame] | 38 | * Processes the removal of a port from the switch. |
| 39 | * It sends out PORT_STATUS asynchronous message to the controllers. |
| 40 | * |
| 41 | * @param port virtual port |
| 42 | */ |
| 43 | void processPortRemoved(Port port); |
| 44 | |
| 45 | /** |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 46 | * Processes port link down. |
| 47 | * It sends out PORT_STATUS asynchronous message to the controllers. |
| 48 | * |
| 49 | * @param port virtual port |
| 50 | */ |
| 51 | void processPortDown(Port port); |
| 52 | |
| 53 | /** |
| 54 | * Processes port link down. |
| 55 | * It sends out PORT_STATUS asynchronous message to the controllers. |
| 56 | * |
| 57 | * @param port virtual port |
| 58 | */ |
| 59 | void processPortUp(Port port); |
| 60 | |
| 61 | /** |
| 62 | * Processes flow removed. |
| 63 | * It sends out FLOW_REMOVED asynchronous message to the controllers. |
| 64 | * |
| 65 | * @param flowRule removed flow rule |
| 66 | */ |
| 67 | void processFlowRemoved(FlowRule flowRule); |
| 68 | |
| 69 | /** |
| 70 | * Processes packet in. |
| 71 | * It sends out PACKET_IN asynchronous message to the controllers. |
| 72 | * |
| 73 | * @param packet inbound packet |
| 74 | */ |
| 75 | void processPacketIn(InboundPacket packet); |
| 76 | |
| 77 | /** |
| 78 | * Processes commands from the controllers that modify the state of the switch. |
| 79 | * Possible message types include PACKET_OUT, FLOW_MOD, GROUP_MOD, |
| 80 | * PORT_MOD, TABLE_MOD. These types of messages can be denied based on a |
| 81 | * role of the request controller. |
| 82 | * |
| 83 | * @param channel received channel |
| 84 | * @param msg command message received |
| 85 | */ |
| 86 | void processControllerCommand(Channel channel, OFMessage msg); |
| 87 | |
| 88 | /** |
| 89 | * Processes a stats request from the controllers. |
| 90 | * Targeted message type is MULTIPART_REQUEST with FLOW, PORT, GROUP, |
| 91 | * GROUP_DESC subtypes. |
| 92 | * |
| 93 | * @param channel received channel |
| 94 | * @param msg stats request message received |
| 95 | */ |
| 96 | void processStatsRequest(Channel channel, OFMessage msg); |
| 97 | |
| 98 | /** |
| 99 | * Processes a role request from the controllers. |
| 100 | * Targeted message type is ROLE_REQUEST. |
| 101 | * |
| 102 | * @param channel received channel |
| 103 | * @param msg role request message received |
| 104 | */ |
| 105 | void processRoleRequest(Channel channel, OFMessage msg); |
| 106 | |
| 107 | /** |
| 108 | * Processes a features request from the controllers. |
| 109 | * |
| 110 | * @param channel received channel |
| 111 | * @param msg received features request |
| 112 | */ |
| 113 | void processFeaturesRequest(Channel channel, OFMessage msg); |
| 114 | |
| 115 | /** |
| 116 | * Processes LLDP packets from the controller. |
| 117 | * |
| 118 | * @param channel received channel |
| 119 | * @param msg packet out message with lldp |
| 120 | */ |
| 121 | void processLldp(Channel channel, OFMessage msg); |
| 122 | |
| 123 | /** |
| 124 | * Sends hello to the controller. |
| 125 | * |
| 126 | * @param channel received channel |
| 127 | */ |
| 128 | void sendOfHello(Channel channel); |
| 129 | |
| 130 | /** |
| 131 | * Processes echo request from the controllers. |
| 132 | * |
| 133 | * @param channel received channel |
| 134 | * @param msg echo request message |
| 135 | */ |
| 136 | void processEchoRequest(Channel channel, OFMessage msg); |
Claudine Chiu | e2d5acc | 2017-06-08 22:49:21 -0400 | [diff] [blame] | 137 | |
| 138 | /** |
| 139 | * Processes GetConfig request from the controllers. |
| 140 | * |
| 141 | * @param channel received channel |
| 142 | * @param msg GetConfig request message |
| 143 | */ |
| 144 | void processGetConfigRequest(Channel channel, OFMessage msg); |
| 145 | |
| 146 | /** |
| 147 | * Processes SetConfig message from the controllers. |
| 148 | * |
| 149 | * @param channel received channel |
| 150 | * @param msg SetConfig message |
| 151 | */ |
| 152 | void processSetConfigMessage(Channel channel, OFMessage msg); |
| 153 | |
| 154 | /** |
| 155 | * Processes barrier request from the controllers. |
| 156 | * |
| 157 | * @param channel received channel |
| 158 | * @param msg barrier request message |
| 159 | */ |
| 160 | void processBarrierRequest(Channel channel, OFMessage msg); |
Hyunsun Moon | f4ba44f | 2017-03-14 03:25:52 +0900 | [diff] [blame] | 161 | } |