Class PacketDetectionRule
- java.lang.Object
-
- org.onosproject.net.behaviour.upf.PacketDetectionRule
-
public final class PacketDetectionRule extends Object
A single Packet Detection Rule (PDR), an entity described in the 3GPP specifications (although that does not mean that this class is 3GPP compliant). An instance of this class will be generated by a logical switch write request to the database-style PDR P4 table, and the resulting instance should contain all the information needed to reproduce that logical switch PDR in the event of a client read request. The instance should also contain sufficient information (or expose the means to retrieve such information) to generate the corresponding dataplane forwarding state that implements the PDR.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PacketDetectionRule.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PacketDetectionRule.Builder
builder()
int
counterId()
Get the dataplane PDR counter cell ID that this PDR is assigned.boolean
equals(Object obj)
int
farId()
Get the PFCP session-local ID of the far that should apply to packets that this PDR matches.boolean
hasActionParameters()
Instances created as a result of DELETE write requests will not have action parameters, only match keys.int
hashCode()
boolean
hasQfi()
Checks if the PDR has a QFI to match upon or to push on the packet.boolean
matchesEncapped()
True if this PDR matches on packets received with a GTP header, and false otherwise.boolean
matchesUnencapped()
True if this PDR matches on packets received without a GTP header, and false otherwise.boolean
matchQfi()
Returns whether QFI should be matched on the packet or not.String
matchString()
Return a string representing the match conditions of this PDR.boolean
pushQfi()
Returns whether QFi should be pushed to the packet.byte
qfi()
Get the QoS Flow Identifier for this PDR.ImmutableByteSequence
sessionId()
Get the ID of the PFCP session that produced this PDR.ImmutableByteSequence
teid()
Get the identifier of the GTP tunnel that this PDR matches on.String
toString()
Ip4Address
tunnelDest()
Get the destination IP of the GTP tunnel that this PDR matches on.Ip4Address
ueAddress()
Get the UE IP address that this PDR matches on.PacketDetectionRule
withoutActionParams()
Return a new instance of this PDR with the action parameters stripped, leaving only the match keys.
-
-
-
Method Detail
-
builder
public static PacketDetectionRule.Builder builder()
-
matchString
public String matchString()
Return a string representing the match conditions of this PDR.- Returns:
- a string representing the PDR match conditions
-
hasActionParameters
public boolean hasActionParameters()
Instances created as a result of DELETE write requests will not have action parameters, only match keys. This method should be used to avoid null pointer exceptions in those instances.- Returns:
- true if this instance has PDR action parameters, false otherwise.
-
withoutActionParams
public PacketDetectionRule withoutActionParams()
Return a new instance of this PDR with the action parameters stripped, leaving only the match keys.- Returns:
- a new PDR with only match keys
-
matchesEncapped
public boolean matchesEncapped()
True if this PDR matches on packets received with a GTP header, and false otherwise.- Returns:
- true if the PDR matches only encapsulated packets
-
matchesUnencapped
public boolean matchesUnencapped()
True if this PDR matches on packets received without a GTP header, and false otherwise.- Returns:
- true if the PDR matches only un-encapsulated packets
-
sessionId
public ImmutableByteSequence sessionId()
Get the ID of the PFCP session that produced this PDR.- Returns:
- PFCP session ID
-
ueAddress
public Ip4Address ueAddress()
Get the UE IP address that this PDR matches on.- Returns:
- UE IP address
-
teid
public ImmutableByteSequence teid()
Get the identifier of the GTP tunnel that this PDR matches on.- Returns:
- GTP tunnel ID
-
tunnelDest
public Ip4Address tunnelDest()
Get the destination IP of the GTP tunnel that this PDR matches on.- Returns:
- GTP tunnel destination IP
-
counterId
public int counterId()
Get the dataplane PDR counter cell ID that this PDR is assigned.- Returns:
- PDR counter cell ID
-
farId
public int farId()
Get the PFCP session-local ID of the far that should apply to packets that this PDR matches.- Returns:
- PFCP session-local FAR ID
-
qfi
public byte qfi()
Get the QoS Flow Identifier for this PDR.- Returns:
- QoS Flow Identifier
-
pushQfi
public boolean pushQfi()
Returns whether QFi should be pushed to the packet.- Returns:
- True if the QFI should be pushed to the packet, false otherwise
-
matchQfi
public boolean matchQfi()
Returns whether QFI should be matched on the packet or not.- Returns:
- True if QFI should be matched on the packet, false otherwise
-
hasQfi
public boolean hasQfi()
Checks if the PDR has a QFI to match upon or to push on the packet.- Returns:
- True if the PDR has a QFI, false otherwise
-
-