next up previous contents
Next: 5 Interface Description Up: 4 SAM Detailed Design Previous: 4.2 Data Decomposition   Contents

Subsections

4.3 NetLogger Module Decomposition

In order to minimise the flow of data between Python code and Python modules written in C, low level packet capturing and saving of this data will be performed by a C module. This is the ``NetLogger'' module.

This module has been further decomposed into 5 modules, each of which performs a specific task related to the logging. They are described here.

4.3.1 NetLogger

Description:
Contains all the functions which are called from Python.
Responsibilities:
This module is responsible for
  1. Calling the lower-level modules to provide a simple interface for Python.
  2. Initialising output files and the network interface.
  3. Beginning logging.
  4. Ending logging.
  5. Adding fields to be logged.
  6. Setting the interval at which logging will occur.
  7. Determining whether logging is currently occurring.
  8. Determining how many packets have been logged.
SRS References:
3.2.1.9a, 3.2.1.9b, 3.2.1.9c, 3.2.1.9d, 3.2.1.9e

4.3.2 Network

Description:
Accesses the network device to capture packets, and extract data from them.
Responsibilities:
This module is responsible for
  1. Initialising the network device ready to capture packets.
  2. Capturing packets and passing them on to the two output modules.
  3. Determining whether logging is occurring.
  4. Determining how many packets have been logged.
SRS References:
3.2.1.9b

4.3.3 NetLogOutput

Description:
Writes data to an output file in NETLOG format.
Responsibilities:
This module is responsible for
  1. Opening an output file ready for writing.
  2. Setting the fields which will be written.
  3. Writing a header containing the file format, including the fields which the file contains.
  4. Writing data for a packet, based on the fields already set.
  5. Writing data at the required interval.
  6. Closing the output file.
SRS References:
3.2.1.9a, 3.2.1.9c, 3.2.1.9d

4.3.4 StreamsLogOutput

Description:
Writes data to an output file in STREAMSLOG format.
Responsibilities:
This module is responsible for
  1. Opening an output file ready for writing.
  2. Writing a header containing the file format.
  3. Writing data for new streams.
  4. Returning the data for a stream, given a packet.
  5. Closing the output file.
SRS References:
3.2.1.9c

4.3.5 StreamsHash

Description:
Keeps a record of streams which have been seen.
Responsibilities:
This module is responsible for
  1. Initialising internal data structures.
  2. Recording streams which are seen.
  3. Allowing access to recorded streams and their data.
  4. Merging data about a packet into the record for its stream.
  5. Preparing information about a stream ready to be printed.
  6. Freeing memory from internal data structures.
SRS References:
3.2.1.9a, 3.2.1.9d


next up previous contents
Next: 5 Interface Description Up: 4 SAM Detailed Design Previous: 4.2 Data Decomposition   Contents