blob: ed72706494f391762a452a64f59971fd09207791 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001/**
2* Copyright 2011, Big Switch Networks, Inc.
3* Originally created by David Erickson, Stanford University
4*
5* Licensed under the Apache License, Version 2.0 (the "License"); you may
6* not use this file except in compliance with the License. You may obtain
7* a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14* License for the specific language governing permissions and limitations
15* under the License.
16**/
17
18package net.floodlightcontroller.routing;
19
20import java.util.List;
21
22import net.floodlightcontroller.core.FloodlightContext;
23import net.floodlightcontroller.core.FloodlightContextStore;
24import net.floodlightcontroller.devicemanager.IDevice;
25import net.floodlightcontroller.devicemanager.SwitchPort;
26
27public interface IRoutingDecision {
28 public enum RoutingAction {
29 /*
30 * NONE: NO-OP, continue with the packet processing chain
31 * DROP: Drop this packet and this flow
32 * FORWARD: Forward this packet, and this flow, to the first (and only device) in getDestinationDevices(),
33 * if the destination is not known at this time, initiate a discovery action for it (e.g. ARP)
34 * FORWARD_OR_FLOOD: Forward this packet, and this flow, to the first (and only device) in getDestinationDevices(),
35 * if the destination is not known at this time, flood this packet on the source switch
36 * BROADCAST: Broadcast this packet on all links
37 * MULTICAST: Multicast this packet to all the interfaces and devices attached
38 */
39 NONE, DROP, FORWARD, FORWARD_OR_FLOOD, BROADCAST, MULTICAST
40 }
41
42 public static final FloodlightContextStore<IRoutingDecision> rtStore =
43 new FloodlightContextStore<IRoutingDecision>();
44 public static final String CONTEXT_DECISION =
45 "net.floodlightcontroller.routing.decision";
46
47 public void addToContext(FloodlightContext cntx);
48 public RoutingAction getRoutingAction();
49 public void setRoutingAction(RoutingAction action);
50 public SwitchPort getSourcePort();
51 public IDevice getSourceDevice();
52 public List<IDevice> getDestinationDevices();
53 public void addDestinationDevice(IDevice d);
54 public List<SwitchPort> getMulticastInterfaces();
55 public void setMulticastInterfaces(List<SwitchPort> lspt);
56 public Integer getWildcards();
57 public void setWildcards(Integer wildcards);
58}