blob: 6413cba5add42f444449789f0ef2d7b995a1840b [file] [log] [blame]
Hyunsun Moonf4ba44f2017-03-14 03:25:52 +09001/*
2 * Copyright 2017-present 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.ofagent.api;
17
18import io.netty.channel.Channel;
19import org.onosproject.net.Port;
20import org.onosproject.net.flow.FlowRule;
21import org.onosproject.net.packet.InboundPacket;
22import org.projectfloodlight.openflow.protocol.OFMessage;
23
24/**
25 * Service for providing OpenFlow operations.
26 */
27public interface OFSwitchOperationService {
28
29 /**
30 * Processes a new port of the switch.
31 * It sends out FEATURE_REPLY message to the controllers.
32 *
33 * @param port virtual port
34 */
35 void processPortAdded(Port port);
36
37 /**
38 * Processes port link down.
39 * It sends out PORT_STATUS asynchronous message to the controllers.
40 *
41 * @param port virtual port
42 */
43 void processPortDown(Port port);
44
45 /**
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 processPortUp(Port port);
52
53 /**
54 * Processes flow removed.
55 * It sends out FLOW_REMOVED asynchronous message to the controllers.
56 *
57 * @param flowRule removed flow rule
58 */
59 void processFlowRemoved(FlowRule flowRule);
60
61 /**
62 * Processes packet in.
63 * It sends out PACKET_IN asynchronous message to the controllers.
64 *
65 * @param packet inbound packet
66 */
67 void processPacketIn(InboundPacket packet);
68
69 /**
70 * Processes commands from the controllers that modify the state of the switch.
71 * Possible message types include PACKET_OUT, FLOW_MOD, GROUP_MOD,
72 * PORT_MOD, TABLE_MOD. These types of messages can be denied based on a
73 * role of the request controller.
74 *
75 * @param channel received channel
76 * @param msg command message received
77 */
78 void processControllerCommand(Channel channel, OFMessage msg);
79
80 /**
81 * Processes a stats request from the controllers.
82 * Targeted message type is MULTIPART_REQUEST with FLOW, PORT, GROUP,
83 * GROUP_DESC subtypes.
84 *
85 * @param channel received channel
86 * @param msg stats request message received
87 */
88 void processStatsRequest(Channel channel, OFMessage msg);
89
90 /**
91 * Processes a role request from the controllers.
92 * Targeted message type is ROLE_REQUEST.
93 *
94 * @param channel received channel
95 * @param msg role request message received
96 */
97 void processRoleRequest(Channel channel, OFMessage msg);
98
99 /**
100 * Processes a features request from the controllers.
101 *
102 * @param channel received channel
103 * @param msg received features request
104 */
105 void processFeaturesRequest(Channel channel, OFMessage msg);
106
107 /**
108 * Processes LLDP packets from the controller.
109 *
110 * @param channel received channel
111 * @param msg packet out message with lldp
112 */
113 void processLldp(Channel channel, OFMessage msg);
114
115 /**
116 * Sends hello to the controller.
117 *
118 * @param channel received channel
119 */
120 void sendOfHello(Channel channel);
121
122 /**
123 * Processes echo request from the controllers.
124 *
125 * @param channel received channel
126 * @param msg echo request message
127 */
128 void processEchoRequest(Channel channel, OFMessage msg);
129}