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

Class StunMappedAddressAttribute

source code



MAPPED-ADDRESS

The MAPPED-ADDRESS attribute indicates the mapped IP address and
port.  It consists of an eight bit address family, and a sixteen bit
port, followed by a fixed length value representing the IP address.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|x x x x x x x x|    Family     |           Port                |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             Address                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The port is a network byte ordered representation of the mapped port.
The address family is always 0x01, corresponding to IPv4.  The first
8 bits of the MAPPED-ADDRESS are ignored, for the purposes of
aligning parameters on natural boundaries.  The IPv4 address is 32
bits.

Instance Methods [hide private]
 
__init__(self, group, port, address, family=Static('\01')) source code
 
_getValue(self)
Override me!
source code
 
reset(self) source code
 
next(self) source code

Inherited from StunAttribute: getRawValue

Class Variables [hide private]
  _empty = 0
  _family = 0x01
  _port = None
  _address = None

Inherited from StunAttribute: CHANGED_ADDRESS, CHANGE_REQUEST, ERROR_CODE, MAPPED_ADDRESS, MESSAGE_INTEGRITY, PASSWORD, REFLECTED_FROM, RESPONSE_ADDRESS, SOURCE_ADDRESS, UNKNOWN_ATTRIBUTES, USERNAME

Inherited from StunAttribute (private): _generator, _length, _type

Method Details [hide private]

__init__(self, group, port, address, family=Static('\01'))
(Constructor)

source code 
Parameters:
  • group (Group) - Group to use
  • family (Generator) - Family (defaults to 0x01 IPV4)
  • port (Generator) - Port number
  • address (Generator) - 32bit IPv4 address
Overrides: StunAttribute.__init__

_getValue(self)

source code 

Override me!

Overrides: StunAttribute._getValue
(inherited documentation)