Package Halberd :: Package clues :: Module Clue :: Class Clue

[show private | hide private]
[frames | no frames]

## Class Clue

A clue is what we use to tell real servers behind a virtual IP.

Clues are gathered during several connections to a web server and they allow us to try to identify patterns in its responses. Those patterns could allow us to find out which real servers are behind a VIP

Method Summary
| `__init__(self)`
| `__eq__(self, other)`
| `__ne__(self, other)`
| `__repr__(self)`
`int`. | ``getCount`(self)` Retrieve the number of times the clue has been found
| ``incCount`(self, num)` Increase the times this clue has been found.
`str` | ``normalize`(name)` Normalize string. (Static method)
| ``parse`(self, headers)` Extracts all relevant information from the MIME headers replied by the target.
| ``setTimestamp`(self, timestamp)` Sets the local clock attribute.
`int` | ``_calcDiff`(self)` Compute the time difference between the remote and local clocks.
| ``_get_age`(self, field)` Age:
| ``_get_cache_expires`(self, field)` Cache-expires:
| ``_get_content_length`(self, field)` Content-length:
| ``_get_content_location`(self, field)` Content-location:
| ``_get_content_type`(self, field)` Content-type:
| ``_get_date`(self, field)` Date:
| ``_get_etag`(self, field)` ETag:
| ``_get_expires`(self, field)` Expires:
| ``_get_last_modified`(self, field)` Last-modified:
| ``_get_server`(self, field)` Server:
| ``_get_set_cookie`(self, field)` Set-cookie:
| ``_updateDigest`(self)` Updates header fingerprint.

Instance Method Details

### getCount(self)

Retrieve the number of times the clue has been found

  Returns:
    Number of hits.
    (type=`int`.)

### incCount(self, num=1)

Increase the times this clue has been found.

  Parameters:
    `num` - A positive non-zero number of hits to increase.
    (type=`int`)
  Raises:
    `ValueError` - in case `num` is less than or equal to zero.

### parse(self, headers)

Extracts all relevant information from the MIME headers replied by the target.

  Parameters:
    `headers` - A set of MIME headers (a string as replied by the webserver or a previously parsed sequence of name, value tuples).
    (type=`str`, `list` or `tuple`)
  Raises:
    `TypeError` - If headers is neither a string nor a sequence.

### setTimestamp(self, timestamp)

Sets the local clock attribute.

  Parameters:
    `timestamp` - The local time (expressed in seconds since the Epoch) when the connection to the target was successfully completed.
    (type=`int`)

### _calcDiff(self)

Compute the time difference between the remote and local clocks.

  Returns:
    Time difference.
    (type=`int`)

### _get_age(self, field)

Age:

### _get_cache_expires(self, field)

Cache-expires:

### _get_content_length(self, field)

Content-length:

### _get_content_location(self, field)

Content-location:

### _get_content_type(self, field)

Content-type:

### _get_date(self, field)

Date:

### _get_etag(self, field)

ETag:

### _get_expires(self, field)

Expires:

### _get_last_modified(self, field)

Last-modified:

### _get_server(self, field)

Server:

### _get_set_cookie(self, field)

Set-cookie:

### _updateDigest(self)

Updates header fingerprint.

Static Method Details

### normalize(name)

Normalize string.

This method takes a string coming out of mime-fields and transforms it into a valid Python identifier. That's done by removing invalid non-alphanumeric characters and also numeric ones placed at the beginning of the string.

  Parameters:
    `name` - String to be normalized.
    (type=`str`)
  Returns:
    Normalized string.
    (type=`str`)

Generated by Epydoc 2.1 on Wed Jul 18 22:25:57 2007 | http://epydoc.sf.net