2 * Copyright (c) 2013 IBM and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.samples.simpleforwarding;
11 import org.opendaylight.controller.sal.core.NodeConnector;
12 import org.opendaylight.controller.sal.packet.RawPacket;
13 import org.opendaylight.controller.topologymanager.ITopologyManager;
16 * Provides support for flooding/broadcasting of packets.
18 public interface IBroadcastHandler {
21 * The mode to select which ports to broadcast a given packet. See the
22 * individual modes for the expected behavior.
24 static enum BroadcastMode {
26 * Turn off broadcast handling and ignore all received data packets.
31 * sends broadcast packets out ports where there are known hosts as
32 * discovered by {@link ITopologyManager#getNodeConnectorWithHost}.
37 * sends broadcast packets out all non-internal links as discovered by
38 * {@link ITopologyManager#isInternal}. Also ignores ports which have
39 * {@link NodeConnector#getType} of "SW" indicating OFPP_LOCAL.
41 BROADCAST_TO_NONINTERNAL,
44 * sends broadcast packets out the ports specified by an external
45 * implementation of {@link IBroadcastPortSelector}.
51 * Set the {@link BroadcastMode} for this {@link IBroadcastHandler}.
54 void setMode(BroadcastMode m);
57 * Safely flood/broadcast a {@link RawPacket} received on a given
58 * {@link NodeConnector}.
61 * The packet to flood/broadcast
62 * @return <tt>true</tt> if the broadcast is successful, <tt>false</tt>
65 boolean broadcastPacket(RawPacket pkt);