Package org.onosproject.net.packet
Interface PacketService
-
public interface PacketService
Service for intercepting data plane packets and for emitting synthetic outbound packets.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
addFilter(PacketInFilter filter)
Adds the specified filter to the list of packet filters.void
addProcessor(PacketProcessor processor, int priority)
Adds the specified processor to the list of packet processors.void
cancelPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId)
Cancels previous packet requests for packets matching the given selector to be punted from the dataplane to the controller.void
cancelPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId, java.util.Optional<DeviceId> deviceId)
Cancels previous packet requests for packets matching the given selector to be punted from the dataplane to the controller.default void
clearFilters()
Clear all packet filters in one shot.void
emit(OutboundPacket packet)
Emits the specified outbound packet onto the network.default java.util.List<PacketInFilter>
getFilters()
Get the list of packet filters present in ONOS.java.util.List<PacketProcessorEntry>
getProcessors()
Returns priority bindings of all registered packet processor entries.java.util.List<PacketRequest>
getRequests()
Returns list of all existing requests ordered by priority.default void
removeFilter(PacketInFilter filter)
Removes the specified filter from the filters list.void
removeProcessor(PacketProcessor processor)
Removes the specified processor from the processing pipeline.void
requestPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId)
Requests that packets matching the given selector are punted from the dataplane to the controller.void
requestPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId, java.util.Optional<DeviceId> deviceId)
Requests that packets matching the given selector are punted from the dataplane to the controller.
-
-
-
Method Detail
-
addProcessor
void addProcessor(PacketProcessor processor, int priority)
Adds the specified processor to the list of packet processors. It will be added into the list in the order of priority. The higher numbers will be processing the packets after the lower numbers.- Parameters:
processor
- processor to be addedpriority
- priority in the reverse natural order- Throws:
java.lang.IllegalArgumentException
- if a processor with the given priority already exists
-
removeProcessor
void removeProcessor(PacketProcessor processor)
Removes the specified processor from the processing pipeline.- Parameters:
processor
- packet processor
-
addFilter
default void addFilter(PacketInFilter filter)
Adds the specified filter to the list of packet filters. It will be added into the list in the order in which it is added.- Parameters:
filter
- filter to be added
-
removeFilter
default void removeFilter(PacketInFilter filter)
Removes the specified filter from the filters list.- Parameters:
filter
- filter to be removed
-
getProcessors
java.util.List<PacketProcessorEntry> getProcessors()
Returns priority bindings of all registered packet processor entries.- Returns:
- list of existing packet processor entries
-
requestPackets
void requestPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId)
Requests that packets matching the given selector are punted from the dataplane to the controller.- Parameters:
selector
- the traffic selector used to match packetspriority
- the priority of the ruleappId
- the application ID of the requester
-
requestPackets
void requestPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId, java.util.Optional<DeviceId> deviceId)
Requests that packets matching the given selector are punted from the dataplane to the controller. If a deviceId is specified then the packet request is only installed at the device represented by that deviceId.- Parameters:
selector
- the traffic selector used to match packetspriority
- the priority of the ruleappId
- the application ID of the requesterdeviceId
- an optional deviceId
-
cancelPackets
void cancelPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId)
Cancels previous packet requests for packets matching the given selector to be punted from the dataplane to the controller.- Parameters:
selector
- the traffic selector used to match packetspriority
- the priority of the ruleappId
- the application ID of the requester
-
cancelPackets
void cancelPackets(TrafficSelector selector, PacketPriority priority, ApplicationId appId, java.util.Optional<DeviceId> deviceId)
Cancels previous packet requests for packets matching the given selector to be punted from the dataplane to the controller. If a deviceId is specified then the packet request is only withdrawn from the device represented by that deviceId.- Parameters:
selector
- the traffic selector used to match packetspriority
- the priority of the ruleappId
- the application ID of the requesterdeviceId
- an optional deviceId
-
getRequests
java.util.List<PacketRequest> getRequests()
Returns list of all existing requests ordered by priority.- Returns:
- list of existing packet requests
-
emit
void emit(OutboundPacket packet)
Emits the specified outbound packet onto the network.- Parameters:
packet
- outbound packet
-
getFilters
default java.util.List<PacketInFilter> getFilters()
Get the list of packet filters present in ONOS.- Returns:
- List of packet filters
-
clearFilters
default void clearFilters()
Clear all packet filters in one shot.
-
-