|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface CaptureFactory.Factory
An Abstract Factory pattern which creates concrete capture objects.
| Method Summary | |
|---|---|
void |
append(Capture source,
FileCapture destination)
Copies all of the CapturePackets returned by the source into the already open capture file. |
void |
catFile(java.io.File dst,
Capture... srcs)
Concatenate all the files into the |
void |
catFile(java.io.File dst,
java.io.File... srcs)
Concatenate all the files into the |
boolean |
compactFile(java.io.File file)
Cleans up and compacts the file contents to most efficient size and layout. |
void |
convertFile(java.io.File source,
java.io.File destination,
FileType destinationType)
Converts the source file into new file with the destinationType file format. |
java.util.List<MutableCaptureInterface> |
listInterfaces()
Gets a list of all the devices capable of doing live capture on this or remote system. |
MutableFileCapture |
newFile(java.io.File file,
FileType type)
Creates a new empty file of the user specified type. |
MutableFileCapture |
newFile(java.io.File file,
SuppliedFileTypes type,
Capture capture)
Creates a new file and dumps all of the packet from capture to the new file in the proper format. |
MutableFileCapture |
newFile(java.io.File file,
SuppliedFileTypes type,
Version version,
java.nio.ByteOrder encoding)
Creates a new file in the specified format and of the specified version and using the specified byte ordering for all block and data record headers. |
MutableCaptureInterface |
newInterface()
Creates a new empty, uninitialized CaptureInterface instance. |
MutableCaptureInterface |
newInterface(java.net.NetworkInterface netint)
Creates a new instance of a CaptureInterface initialized from a java.net.NetworkInterface object. |
MutableFileCapture |
openFile(java.io.File file)
Gets a mutable FileCapture instance for the specified file. |
MutableFileCapture |
openFile(java.io.File file,
Filter filter)
Gets a mutable FileCapture instance for the specified file. |
LiveCapture |
openLive()
Opens up all interfaces, except loopback and dialup interfaces, for live capture. |
LiveCapture |
openLive(Filter fiter)
Opens up all interfaces, except loopback and dialup interfaces, for live capture. |
LiveCapture |
openLive(Filter filter,
CaptureInterface... nics)
|
LiveCapture |
openLive(Filter filter,
java.util.Collection<CaptureInterface> nics)
|
java.util.List<java.io.File> |
splitFile(java.io.File file)
Splits the file into smaller files according to default rules defined for each file format. |
java.util.List<java.io.File> |
splitFile(java.io.File file,
long packetCount,
boolean maxCompression)
Split the specified file into smaller files containing specified number of packets each from the source file. |
FileType |
typeOfFile(java.io.File file)
Determines the file type of the supplied file. |
boolean |
validateFile(java.io.File file)
Checks if the specified file is in a proper format 100% compabile with specification. |
| Method Detail |
|---|
void append(Capture source,
FileCapture destination)
throws java.io.IOException
source - capture source to read packets fromdestination - capture file to write the packets into
java.io.IOException - any IO errors
void catFile(java.io.File dst,
java.io.File... srcs)
throws java.io.FileNotFoundException,
java.io.IOException
dst - file to store all the concatenated datasrcs - array of source files to concatenate together
java.io.IOException
java.io.FileNotFoundException
void catFile(java.io.File dst,
Capture... srcs)
dst - file to store all the concatenated datasrcs - array of source files to concatenate togetherboolean compactFile(java.io.File file)
file - file to compact
void convertFile(java.io.File source,
java.io.File destination,
FileType destinationType)
throws java.io.IOException
source - source file to do conversion ondestination - will create a new destination file in the destinationType formatdestinationType - the format that new destination file will be created
java.io.IOException - any IO errors
MutableFileCapture newFile(java.io.File file,
FileType type)
throws java.io.IOException
file - file to createtype - type of file to create
java.io.IOException - any IO errors
MutableFileCapture newFile(java.io.File file,
SuppliedFileTypes type,
Capture capture)
throws java.io.IOException
file - file to createtype - the type of file to createcapture - source of CapturePackets which will be dumped into the new file
java.io.IOException - any IO errors
MutableFileCapture newFile(java.io.File file,
SuppliedFileTypes type,
Version version,
java.nio.ByteOrder encoding)
throws java.io.IOException
file - file to createtype - type of file to createversion - version of the file to createencoding - byte order of all integer values in the block record (file header) or data record (file records) headers.
java.io.IOException - any IO errors
MutableFileCapture openFile(java.io.File file)
throws java.io.IOException
file - filename to open for reading and writting
java.io.IOException - any IO or format errors
MutableFileCapture openFile(java.io.File file,
Filter filter)
throws java.io.IOException
file - filename to open for reading and writting
java.io.IOException - any IO or format errors
LiveCapture openLive()
throws java.io.IOException
IOIterator#hasNext
and IOIterator#next. There is no guarrantee as to the order in which captured packets
are returned between multiple interfaces, with the exception that for each interface the packets
will be returned in the order they were captured on that interface.
java.io.IOException - any IO errors
LiveCapture openLive(Filter fiter)
throws java.io.IOException
Opens up all interfaces, except loopback and dialup interfaces, for live capture.
The captured packets can be iterated over using the inherited methods IOIterator#hasNext
and IOIterator#next. There is no guarrantee as to the order in which captured packets
are returned between multiple interfaces, with the exception that for each interface the packets
will be returned in the order they were captured on that interface.
The filter is used to limit the number of packets captured to ones that match the filter criteria. Each packet after capture is matched by the filter. For efficiency this is done at the kernel level for operating systems that support this feature. On operating systems that do not, the filter match is performed in "userland" or user space which is less efficient
fiter -
java.io.IOException
LiveCapture openLive(Filter filter,
java.util.Collection<CaptureInterface> nics)
throws java.io.IOException
java.io.IOException
LiveCapture openLive(Filter filter,
CaptureInterface... nics)
throws java.io.IOException
java.io.IOException
java.util.List<java.io.File> splitFile(java.io.File file)
throws java.io.IOException
Splits the file into smaller files according to default rules defined for each file format. For NAP the file will be split with each Block Record being split into its own seperate file. For other files, the defaults are to split the files into byte files.
The base filename supplied is used as the base filename for all newly created files with the -XXXX appended to them.
The source file is unmodified
file - file to be split
java.io.IOException
java.util.List<java.io.File> splitFile(java.io.File file,
long packetCount,
boolean maxCompression)
throws java.io.IOException
Split the specified file into smaller files containing specified number of packets each from the source file. New files are created to hold only the specified number of packets and associated meta records. The supplied filename is used as a base filename for all newly created files with the post fix of -XXXX appended to them.
The source file is unmodified
file - source file to splitpacketCount - split using this many packets from the source file copied into the newly created filesmaxCompression - true means produce the smallest possible file, while false means leave it upto the default
algorithm for each spcific file type. For example NAP files pad their files to 512Kb by default
which means that files containing even only a single packet are of minimum size 512 Kb, but this
can be overriden by setting maxCompression to true. Notice that it will be harder to split the NAP file
with regular unix commands if default padding is not used.
java.io.IOException
FileType typeOfFile(java.io.File file)
throws java.io.IOException
file - file to check and return file type
java.io.IOException
boolean validateFile(java.io.File file)
throws java.io.IOException
file - file to validate
java.io.IOExceptionMutableCaptureInterface newInterface()
MutableCaptureInterface newInterface(java.net.NetworkInterface netint)
throws java.io.IOException
netint - network interface object to initialize from
java.io.IOException
java.util.List<MutableCaptureInterface> listInterfaces()
throws java.io.IOException
java.io.IOException - any IO errors
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||