Interface PacketLoggingService


  • public interface PacketLoggingService
    A Packet Logging Service to log packets that were send/received by protocols or any other network related services in various formats. Its for debugging purposes.
    Author:
    Damian Minkov
    • Method Detail

      • isLoggingEnabled

        boolean isLoggingEnabled()
        Determines whether packet logging is globally enabled for this service.
        Returns:
        true if packet logging is globally enabled for this service; otherwise, false
      • isLoggingEnabled

        boolean isLoggingEnabled​(PacketLoggingService.ProtocolName protocol)
        Determines whether packet logging for a specific protocol is enabled for this service.
        Parameters:
        protocol - the packet logging protocol to check
        Returns:
        true if packet logging for protocol is enabled for this service; otherwise, false
      • logPacket

        void logPacket​(PacketLoggingService.ProtocolName protocol,
                       byte[] sourceAddress,
                       int sourcePort,
                       byte[] destinationAddress,
                       int destinationPort,
                       PacketLoggingService.TransportName transport,
                       boolean sender,
                       byte[] packetContent)
        Log a packet with all the required information.
        Parameters:
        protocol - the source protocol that logs this packet.
        sourceAddress - the source address of the packet.
        sourcePort - the source port of the packet.
        destinationAddress - the destination address.
        destinationPort - the destination port.
        transport - the transport this packet uses.
        sender - are we the sender of the packet or not.
        packetContent - the packet content.
      • logPacket

        void logPacket​(PacketLoggingService.ProtocolName protocol,
                       byte[] sourceAddress,
                       int sourcePort,
                       byte[] destinationAddress,
                       int destinationPort,
                       PacketLoggingService.TransportName transport,
                       boolean sender,
                       byte[] packetContent,
                       int packetOffset,
                       int packetLength)
        Log a packet with all the required information.
        Parameters:
        protocol - the source protocol that logs this packet.
        sourceAddress - the source address of the packet.
        sourcePort - the source port of the packet.
        destinationAddress - the destination address.
        destinationPort - the destination port.
        transport - the transport this packet uses.
        sender - are we the sender of the packet or not.
        packetContent - the packet content.
        packetOffset - the packet content offset.
        packetLength - the packet content length.
      • getConfiguration

        PacketLoggingConfiguration getConfiguration()
        Returns the current Packet Logging Configuration.
        Returns:
        the Packet Logging Configuration.