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

Class StunChangeRequestAttribute

source code



CHANGE-REQUEST

The CHANGE-REQUEST attribute is used by the client to request that
the server use a different address and/or port when sending the
response.  The attribute is 32 bits long, although only two bits (A
and B) are used:

 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A B 0|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

The meaning of the flags is:

A: This is the "change IP" flag.  If true, it requests the server
   to send the Binding Response with a different IP address than the
   one the Binding Request was received on.

B: This is the "change port" flag.  If true, it requests the
   server to send the Binding Response with a different port than the
   one the Binding Request was received on.

Instance Methods [hide private]
 
__init__(self, group, changeIp, changePort, value=None) source code
 
_getValue(self)
Override me!
source code
 
next(self) source code

Inherited from StunAttribute: getRawValue

Class Variables [hide private]
  CHANGE_IP = 4
  CHANGE_PORT = 2
  _value = None
  _changeIp = None
  _changePort = 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, changeIp, changePort, value=None)
(Constructor)

source code 
Parameters:
  • group (Group) - Group to use
  • changeIp (Generator) - changeIp value (0 or 4)
  • changePort (Generator) - changePort value (0 or 2)
  • value (Generator) - 32bit value (optional)
Overrides: StunAttribute.__init__

_getValue(self)

source code 

Override me!

Overrides: StunAttribute._getValue
(inherited documentation)