Package twisted :: Package protocols :: Module gnutella

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

## Module twisted.protocols.gnutella

Gnutella, v0.4 http://www9.limewire.com/developer/gnutella_protocol_0.4.pdf

This module is incomplete. The "GnutellaTalker" class is complete. The "GnutellaPinger" and "GnutellaPonger" are complete and able to chat with one another. The "GnutellaRouter" and "GnutellaServent" classes are yet to be written.

Classes
`GnutellaPinger` | Just for testing.
`GnutellaPonger` | Just for testing.
`GnutellaRouter` | This is a well-behaved Gnutella servent that routes messages as it should.
`GnutellaTalker` | This just speaks the Gnutella protocol and translates it into Python methods for higher-level services to program with.

Function Summary
| ``is_ipv4`(s)` Return true if and only if s is a canonical IPv4 address
| `popTrailingNulls(s)`

Variable Summary
`string` | `ACKSTRING`
`string` | `CONNSTRING`
`SRE_Pattern` | `CONNSTRINGRE`
`int` | `DESCRIPTORLENGTH`
`int` | `false`
`string` | `HEADERENCODING`
`int` | `HEADERLENGTH`
`int` | `MAXUINT16`
`long int` | `MAXUINT32`
`int` | `MAXUINT8`
`int` | `OURMAXPAYLOADLENGTH`
`string` | `PARTIALQUERYHITPAYLOADENCODING`
`int` | `PARTIALQUERYHITPAYLOADLENGTH`
`string` | `PARTIALQUERYHITRESULTENCODING`
`int` | `PARTIALQUERYHITRESULTLENGTH`
`dictionary` | `payloadDescriptor2Name`
`string` | `PAYLOADENCODING`
`int` | `PAYLOADLENGTHLENGTH`
`int` | `PAYLOADLENGTHOFFSET`
`int` | `PINGPD`
`string` | `PONGPAYLOADENCODING`
`int` | `PONGPD`
`string` | `PUSHPAYLOADENCODING`
`int` | `PUSHPD`
`int` | `QUERYHITPD`
`int` | `QUERYPD`
`SelectReactor` | `reactor`
`string` | `SERVENTIDENTIFIERENCODING`
`int` | `true`

Function Details

### is_ipv4(s)

  Returns:
    true if and only if s is a canonical IPv4 address

Variable Details

### ACKSTRING

  Type:
    `string`
  Value:

        'GNUTELLA OK'

### CONNSTRING

  Type:
    `string`
  Value:

        'GNUTELLA CONNECT/0.4'

### CONNSTRINGRE

  Type:
    `SRE_Pattern`
  Value:

        ^GNUTELLA CONNECT/([^\r\n]*)

### DESCRIPTORLENGTH

  Type:
    `int`
  Value:

        16

### false

  Type:
    `int`
  Value:

        0

### HEADERENCODING

  Type:
    `string`
  Value:

        '<16sBBBI'

### HEADERLENGTH

  Type:
    `int`
  Value:

        23

### MAXUINT16

  Type:
    `int`
  Value:

        65535

### MAXUINT32

  Type:
    `long int`
  Value:

        4294967295L

### MAXUINT8

  Type:
    `int`
  Value:

        255

### OURMAXPAYLOADLENGTH

  Type:
    `int`
  Value:

        655360

### PARTIALQUERYHITPAYLOADENCODING

  Type:
    `string`
  Value:

        '<BHBBBBI'

### PARTIALQUERYHITPAYLOADLENGTH

  Type:
    `int`
  Value:

        11

### PARTIALQUERYHITRESULTENCODING

  Type:
    `string`
  Value:

        '<II'

### PARTIALQUERYHITRESULTLENGTH

  Type:
    `int`
  Value:

        8

### payloadDescriptor2Name

  Type:
    `dictionary`
  Value:

        {128: 'Query', 129: 'QueryHit', 0: 'Ping', 1: 'Pong', 64: 'Push'}

### PAYLOADENCODING

  Type:
    `string`
  Value:

        '<I'

### PAYLOADLENGTHLENGTH

  Type:
    `int`
  Value:

        4

### PAYLOADLENGTHOFFSET

  Type:
    `int`
  Value:

        19

### PINGPD

  Type:
    `int`
  Value:

        0

### PONGPAYLOADENCODING

  Type:
    `string`
  Value:

        '<HBBBBII'

### PONGPD

  Type:
    `int`
  Value:

        1

### PUSHPAYLOADENCODING

  Type:
    `string`
  Value:

        '<16sIBBBBH'

### PUSHPD

  Type:
    `int`
  Value:

        64

### QUERYHITPD

  Type:
    `int`
  Value:

        129

### QUERYPD

  Type:
    `int`
  Value:

        128

### reactor

  Type:
    `SelectReactor`
  Value:

        <twisted.internet.default.SelectReactor instance at 0x834759c>

### SERVENTIDENTIFIERENCODING

  Type:
    `string`
  Value:

        '<16s'

### true

  Type:
    `int`
  Value:

        1

Generated by Epydoc 1.1 on Sat Feb 15 21:19:12 2003 | http://epydoc.sf.net