Package org.onosproject.net.packet
Interface PacketProcessor
-
public interface PacketProcessor
Abstraction of an inbound packet processor.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ADVISOR_MAX
static int
DIRECTOR_MAX
static int
OBSERVER_MAX
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static int
advisor(int priority)
Returns a priority in the ADVISOR range, where processors can take early action and influence the packet context.static int
director(int priority)
Returns a priority in the DIRECTOR range, where processors can handle the packet.static int
observer(int priority)
Returns a priority in the OBSERVER range, where processors cannot take any action, but can observe what action has been taken until then.void
process(PacketContext context)
Processes the inbound packet as specified in the given context.
-
-
-
Field Detail
-
ADVISOR_MAX
static final int ADVISOR_MAX
- See Also:
- Constant Field Values
-
DIRECTOR_MAX
static final int DIRECTOR_MAX
- See Also:
- Constant Field Values
-
OBSERVER_MAX
static final int OBSERVER_MAX
- See Also:
- Constant Field Values
-
-
Method Detail
-
advisor
static int advisor(int priority)
Returns a priority in the ADVISOR range, where processors can take early action and influence the packet context. However, they cannot handle the packet (i.e. call send() or block()). The valid range is from 1 to ADVISOR_MAX. Processors in this range get to see the packet first.- Parameters:
priority
- priority within ADVISOR range- Returns:
- overall priority
-
director
static int director(int priority)
Returns a priority in the DIRECTOR range, where processors can handle the packet. The valid range is from ADVISOR_MAX+1 to DIRECTOR_MAX. Processors in this range get to see the packet second, after ADVISORS.- Parameters:
priority
- priority within the DIRECTOR range- Returns:
- overall priority
-
observer
static int observer(int priority)
Returns a priority in the OBSERVER range, where processors cannot take any action, but can observe what action has been taken until then. The valid range is from DIRECTOR_MAX+1 to OBSERVER_MAX. Processors in this range get to see the packet last, after ADVISORS and DIRECTORS.- Parameters:
priority
- priority within the OBSERVER range- Returns:
- overall priority
-
process
void process(PacketContext context)
Processes the inbound packet as specified in the given context.- Parameters:
context
- packet processing context
-
-