Class IGMPGroup

  • Direct Known Subclasses:
    IGMPMembership, IGMPQuery

    public abstract class IGMPGroup
    extends Object
    A class to represent Groups for membership query and reports.
    • Constructor Detail

      • IGMPGroup

        public IGMPGroup()
      • IGMPGroup

        public IGMPGroup​(IpAddress gaddr,
                         int auxInfo)
        Initialize this object with a multicast group address and additional info.
        Parameters:
        gaddr - the multicast group address for this message type.
        auxInfo - additional info potentially used by IGMPQuery
    • Method Detail

      • getGaddr

        public IpAddress getGaddr()
        Get the multicast group address.
        Returns:
        the group address
      • getAuxInfo

        public int getAuxInfo()
        Get the auxillary info.
        Returns:
        the auxillary info
      • addSource

        public void addSource​(IpAddress saddr)
        Add a unicast source address to this message.
        Parameters:
        saddr - IPv4 unicast source address
      • getSources

        public List<IpAddress> getSources()
        Return the list of source addresses.
        Returns:
        list of source addresses
      • deserialize

        public abstract IGMPGroup deserialize​(ByteBuffer bb)
                                       throws DeserializationException
        Deserialize an IGMPQuery or IGMPMembership message.
        Parameters:
        bb - the ByteBuffer wrapping the serialized message. The position of the ByteBuffer should be pointing at the head of either message type.
        Returns:
        An object populated with the respective IGMPGroup subclass
        Throws:
        DeserializationException - in case deserialization goes wrong
      • serialize

        public abstract byte[] serialize​(ByteBuffer bb)
        Serialize the IGMPGroup subclass.
        Parameters:
        bb - the ByteBuffer to write into, positioned at the next spot to be written to.
        Returns:
        The serialized message