Package Peach :: Package Generators :: Module stun :: Class StunHeader
[hide private]

Class StunHeader

source code


This generator creates a STUN header. A STUN header is 20 bytes long.

Instance Methods [hide private]
 
__init__(self, group, messageType, transactionId, length)
Base constructor, please call me!
source code
string
getRawValue(self)
Return raw value w/o passing through transformer if set.
source code
 
reset(self)
Called to reset the generator to its initial state.
source code

Inherited from generator.Generator: __iter__, getGroup, getName, getTransformer, getValue, identity, next, setGroup, setName, setTransformer

Static Methods [hide private]
 
unittest() source code
Class Variables [hide private]
  BINDING_REQUEST = 0x0001
  BINDING_RESPONSE = 0x0101
  BINDING_ERROR_RESPONSE = 0x0111
  SHARED_SECRET_REQUEST = 0x0002
  SHARED_SECRET_RESPONSE = 0x0102
  SHARED_SECRET_ERROR_RESPONSE = 0x0112
  _messageType = None
  _length = None
  _transactionId = None
Method Details [hide private]

__init__(self, group, messageType, transactionId, length)
(Constructor)

source code 

Base constructor, please call me!

Parameters:
  • group (Group) - Group to use
  • messageType (Generator) - Message type we are generating
  • transactionId (Generator) - Transaction Id
  • length (Generator) - Length of STUN payload
Overrides: generator.Generator.__init__

getRawValue(self)

source code 

Return raw value w/o passing through transformer if set. OVERRIDE

Returns: string
Data before transformations
Overrides: generator.Generator.getRawValue
(inherited documentation)

reset(self)

source code 

Called to reset the generator to its initial state. OVERRIDE

Overrides: generator.Generator.reset
(inherited documentation)