Package org.onosproject.net.packet
Interface PacketInFilter
-
- All Known Implementing Classes:
DefaultPacketInFilter
public interface PacketInFilter
Abstraction of incoming packet filter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PacketInFilter.FilterAction
Types of filter action applied to incoming packets.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
droppedPackets()
Get the count of the dropped packets for this filter type.java.lang.String
name()
Get the name of the counter.int
pendingPackets()
Get the current value of the count of packets for this particular filter type waiting to get processed.PacketInFilter.FilterAction
preProcess(PacketContext packet)
Returns FilterAction before processing the packet.void
setGuardTime(int guardTime)
Set the Guard time in case WinThres is crossed.void
setPps(int pps)
Set the pps rate for the current filter type to calculate the max counter allowed with window size.void
setWinSize(int winSize)
Set the window size for rate limiting.void
setWinThres(int winThres)
Set the Window Threshold for dropping the packet.void
stop()
Stop the threads running for this filter.
-
-
-
Method Detail
-
preProcess
PacketInFilter.FilterAction preProcess(PacketContext packet)
Returns FilterAction before processing the packet. Decides if the packet is allowed to be processed or not.- Parameters:
packet
- PackerContext holding the packet information- Returns:
- FilterAction
-
name
java.lang.String name()
Get the name of the counter.- Returns:
- name of the counter
-
pendingPackets
int pendingPackets()
Get the current value of the count of packets for this particular filter type waiting to get processed.- Returns:
- count of packets with current filter type waiting to get processed
-
droppedPackets
int droppedPackets()
Get the count of the dropped packets for this filter type.- Returns:
- count of dropped packets for this filter type
-
setPps
void setPps(int pps)
Set the pps rate for the current filter type to calculate the max counter allowed with window size.- Parameters:
pps
- Packet per second rate expected
-
setWinSize
void setWinSize(int winSize)
Set the window size for rate limiting.- Parameters:
winSize
- Window size in milli seconds
-
setGuardTime
void setGuardTime(int guardTime)
Set the Guard time in case WinThres is crossed.- Parameters:
guardTime
- Guard time in seconds
-
setWinThres
void setWinThres(int winThres)
Set the Window Threshold for dropping the packet.- Parameters:
winThres
- Threshold count of the consecutive windows with packet drops
-
stop
void stop()
Stop the threads running for this filter.
-
-