Interface PacketService


  • public interface PacketService
    Service for intercepting data plane packets and for emitting synthetic outbound packets.
    • 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 added
        priority - 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 packets
        priority - the priority of the rule
        appId - 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 packets
        priority - the priority of the rule
        appId - the application ID of the requester
        deviceId - 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 packets
        priority - the priority of the rule
        appId - 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 packets
        priority - the priority of the rule
        appId - the application ID of the requester
        deviceId - 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.