Package org.onlab.packet
Class IGMP
- java.lang.Object
- 
- org.onlab.packet.BasePacket
- 
- org.onlab.packet.IGMP
 
 
- 
- All Implemented Interfaces:
- IPacket
 - Direct Known Subclasses:
- IGMP.IGMPv2,- IGMP.IGMPv3
 
 public abstract class IGMP extends BasePacket Implements IGMP control packet format.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classIGMP.IGMPv2static classIGMP.IGMPv3
 - 
Field SummaryFields Modifier and Type Field Description protected shortchecksumprotected byteigmpTypeprotected byteresFieldstatic byteTYPE_IGMPV1_MEMBERSHIP_REPORTstatic byteTYPE_IGMPV2_LEAVE_GROUPstatic byteTYPE_IGMPV2_MEMBERSHIP_REPORTstatic byteTYPE_IGMPV3_MEMBERSHIP_QUERYstatic byteTYPE_IGMPV3_MEMBERSHIP_REPORT- 
Fields inherited from class org.onlab.packet.BasePacketparent, payload
 
- 
 - 
Constructor SummaryConstructors Constructor Description IGMP()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanaddGroup(IGMPGroup group)Add a multicast group to this IGMP message.static Deserializer<IGMP>deserializer()Deserializer function for IPv4 packets.booleanequals(Object obj)shortgetChecksum()Get the checksum of this message.List<IGMPGroup>getGroups()Get the list of IGMPGroups.bytegetIgmpType()Get the IGMP message type.bytegetMaxRespField()get the Max Resp Code.inthashCode()byte[]serialize()Serialize this IGMP packet.voidsetIgmpType(byte msgType)Set the IGMP message type.abstract voidsetMaxRespCode(byte respCode)Set the Max Resp Code.StringtoString()protected abstract booleanvalidChecksum()Validates the message's checksum.- 
Methods inherited from class org.onlab.packet.BasePacketclone, getParent, getPayload, resetChecksum, setParent, setPayload
 
- 
 
- 
- 
- 
Field Detail- 
TYPE_IGMPV3_MEMBERSHIP_QUERYpublic static final byte TYPE_IGMPV3_MEMBERSHIP_QUERY - See Also:
- Constant Field Values
 
 - 
TYPE_IGMPV1_MEMBERSHIP_REPORTpublic static final byte TYPE_IGMPV1_MEMBERSHIP_REPORT - See Also:
- Constant Field Values
 
 - 
TYPE_IGMPV2_MEMBERSHIP_REPORTpublic static final byte TYPE_IGMPV2_MEMBERSHIP_REPORT - See Also:
- Constant Field Values
 
 - 
TYPE_IGMPV2_LEAVE_GROUPpublic static final byte TYPE_IGMPV2_LEAVE_GROUP - See Also:
- Constant Field Values
 
 - 
TYPE_IGMPV3_MEMBERSHIP_REPORTpublic static final byte TYPE_IGMPV3_MEMBERSHIP_REPORT - See Also:
- Constant Field Values
 
 - 
igmpTypeprotected byte igmpType 
 - 
resFieldprotected byte resField 
 - 
checksumprotected short checksum 
 
- 
 - 
Method Detail- 
getIgmpTypepublic byte getIgmpType() Get the IGMP message type.- Returns:
- the IGMP message type
 
 - 
setIgmpTypepublic void setIgmpType(byte msgType) Set the IGMP message type.- Parameters:
- msgType- IGMP message type
 
 - 
getChecksumpublic short getChecksum() Get the checksum of this message.- Returns:
- the checksum
 
 - 
getMaxRespFieldpublic byte getMaxRespField() get the Max Resp Code.- Returns:
- The Maximum Time allowed before before sending a responding report.
 
 - 
setMaxRespCodepublic abstract void setMaxRespCode(byte respCode) Set the Max Resp Code.- Parameters:
- respCode- the Maximum Response Code.
 
 - 
getGroupspublic List<IGMPGroup> getGroups() Get the list of IGMPGroups. The group objects will be either IGMPQuery or IGMPMembership depending on the IGMP message type. For IGMP Query, the groups list should only be one group.- Returns:
- The list of IGMP groups.
 
 - 
addGrouppublic abstract boolean addGroup(IGMPGroup group) Add a multicast group to this IGMP message.- Parameters:
- group- the IGMPGroup will be IGMPQuery or IGMPMembership depending on the message type.
- Returns:
- true if group was valid and added, false otherwise.
 
 - 
serializepublic byte[] serialize() Serialize this IGMP packet. This will take care of serializing IGMPv3 Queries and IGMPv3 Membership Reports.- Returns:
- the serialized IGMP message
 
 - 
deserializerpublic static Deserializer<IGMP> deserializer() Deserializer function for IPv4 packets.- Returns:
- deserializer function
 
 - 
validChecksumprotected abstract boolean validChecksum() Validates the message's checksum.- Returns:
- true if valid, false if not
 
 - 
equalspublic boolean equals(Object obj) - Overrides:
- equalsin class- BasePacket
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- BasePacket
 
 
- 
 
-