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.packet.RawPacket;
15 * Provides support for flooding/broadcasting of packets.
17 public interface IBroadcastHandler {
20 * The mode to select which ports to broadcast a given packet. See the
21 * individual modes for the expected behavior.
23 static enum BroadcastMode {
25 * Turn off broadcast handling and ignore all received data packets.
30 * sends broadcast packets out ports where there are known hosts as
31 * discovered by {@link ITopologyManager#getNodeConnectorWithHost}.
36 * sends broadcast packets out all non-internal links as discovered by
37 * {@link ITopologyManager#isInternal}. Also ignores ports which have
38 * {@link NodeConnector#getType} of "SW" indicating OFPP_LOCAL.
40 BROADCAST_TO_NONINTERNAL,
43 * sends broadcast packets out the ports specified by an external
44 * implementation of {@link IBroadcastPortSelector}.
50 * Set the {@link BroadcastMode} for this {@link IBroadcastHandler}.
53 void setMode(BroadcastMode m);
56 * Safely flood/broadcast a {@link RawPacket} received on a given
57 * {@link NodeConnector}.
60 * The packet to flood/broadcast
61 * @return <tt>true</tt> if the broadcast is successful, <tt>false</tt>
64 boolean broadcastPacket(RawPacket pkt);