Package org.onlab.packet.pim
Class PIMJoinPrune
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.pim.PIMJoinPrune
-
- All Implemented Interfaces:
IPacket
public class PIMJoinPrune extends BasePacket
-
-
Field Summary
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description PIMJoinPrune()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addJoin(java.lang.String saddr, java.lang.String gaddr)
Add a join given strings represending the source and group addresses.void
addJoinPrune(java.lang.String saddr, java.lang.String gaddr, boolean join)
Add the specified s,g to join field.void
addJoinPrune(IpPrefix spfx, IpPrefix gpfx, boolean join)
Add the specified S, G to the join field.void
addPrune(java.lang.String saddr, java.lang.String gaddr)
Add a prune given strings represending the source and group addresses.static Deserializer<PIMJoinPrune>
deserializer()
Return the J/P deserializer function.short
getHoldTime()
Get the J/P hold time.java.util.Collection<PIMJoinPruneGroup>
getJoinPrunes()
Get the JoinPrune Group with all the joins and prunes.PIMAddrUnicast
getUpstreamAddr()
Get the upstreamAddr for this J/P request.byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.void
setHoldTime(short holdTime)
Set the J/P holdtime in seconds.void
setUpstreamAddr(PIMAddrUnicast upstr)
Set the upstream address of this PIM J/P request.java.lang.String
toString()
-
Methods inherited from class org.onlab.packet.BasePacket
clone, equals, getParent, getPayload, hashCode, resetChecksum, setParent, setPayload
-
-
-
-
Method Detail
-
getHoldTime
public short getHoldTime()
Get the J/P hold time.- Returns:
- specified in seconds.
-
setHoldTime
public void setHoldTime(short holdTime)
Set the J/P holdtime in seconds.- Parameters:
holdTime
- return the holdtime.
-
getUpstreamAddr
public PIMAddrUnicast getUpstreamAddr()
Get the upstreamAddr for this J/P request.- Returns:
- the upstream address.
-
setUpstreamAddr
public void setUpstreamAddr(PIMAddrUnicast upstr)
Set the upstream address of this PIM J/P request.- Parameters:
upstr
- the PIM Upstream unicast address
-
getJoinPrunes
public java.util.Collection<PIMJoinPruneGroup> getJoinPrunes()
Get the JoinPrune Group with all the joins and prunes.- Returns:
- the joinPruneGroup collection
-
addJoinPrune
public void addJoinPrune(java.lang.String saddr, java.lang.String gaddr, boolean join)
Add the specified s,g to join field.- Parameters:
saddr
- the source address of the routegaddr
- the group address of the routejoin
- true for a join, false for a prune.
-
addJoinPrune
public void addJoinPrune(IpPrefix spfx, IpPrefix gpfx, boolean join)
Add the specified S, G to the join field.- Parameters:
spfx
- the source prefix of the routegpfx
- the group prefix of the routejoin
- true for join, false for prune
-
addJoin
public void addJoin(java.lang.String saddr, java.lang.String gaddr)
Add a join given strings represending the source and group addresses.- Parameters:
saddr
- source addressgaddr
- group address
-
addPrune
public void addPrune(java.lang.String saddr, java.lang.String gaddr)
Add a prune given strings represending the source and group addresses.- Parameters:
saddr
- source addressgaddr
- group address
-
serialize
public byte[] serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.- Returns:
- a byte[] containing this packet and payloads
-
deserializer
public static Deserializer<PIMJoinPrune> deserializer()
Return the J/P deserializer function.- Returns:
- a function that will deserialize a J/P message.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-