Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.packetlogging
Class PacketLoggingServiceImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.packetlogging.PacketLoggingServiceImpl
All Implemented Interfaces:
PacketLoggingService

public class PacketLoggingServiceImpl
extends Object
implements PacketLoggingService

Packet Logging Service implementation dumping logs in pcap(tcpdump/wireshark) format file.

Author:
Damian Minkov

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.java.sip.communicator.service.packetlogging.PacketLoggingService
PacketLoggingService.ProtocolName, PacketLoggingService.TransportName
 
Constructor Summary
PacketLoggingServiceImpl()
           
 
Method Summary
 PacketLoggingConfiguration getConfiguration()
          Returns the current Packet Logging Configuration.
 boolean isLoggingEnabled()
          Checks is logging globally enabled for the service.
 boolean isLoggingEnabled(PacketLoggingService.ProtocolName protocol)
          Checks is logging globally enabled for and is it currently available fo the given service.
 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.
 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.
 void start()
          Starting the packet logger.
 void stop()
          Stops the packet logging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketLoggingServiceImpl

public PacketLoggingServiceImpl()
Method Detail

start

public void start()
Starting the packet logger. Generating the files we can use, rotate any previous files and open the current file for writing.


stop

public void stop()
Stops the packet logging.


isLoggingEnabled

public boolean isLoggingEnabled()
Checks is logging globally enabled for the service.

Specified by:
isLoggingEnabled in interface PacketLoggingService
Returns:
is logging enabled.

isLoggingEnabled

public boolean isLoggingEnabled(PacketLoggingService.ProtocolName protocol)
Checks is logging globally enabled for and is it currently available fo the given service.

Specified by:
isLoggingEnabled in interface PacketLoggingService
Parameters:
protocol - that is checked.
Returns:
is logging enabled.

logPacket

public 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.

Specified by:
logPacket in interface PacketLoggingService
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

public 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.

Specified by:
logPacket in interface PacketLoggingService
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

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

Specified by:
getConfiguration in interface PacketLoggingService
Returns:
the Packet Logging Configuration.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.