public class XorMappedAddressAttribute extends AddressAttribute
Modifier and Type | Field and Description |
---|---|
static String |
NAME
The name of this attribute
|
address, ADDRESS_FAMILY_IPV4, ADDRESS_FAMILY_IPV6
ALTERNATE_SERVER, attributeType, CHANGE_REQUEST, CHANGED_ADDRESS, CHANNEL_NUMBER, CONNECTION_ID, DATA, DESTINATION_ADDRESS, DONT_FRAGMENT, ERROR_CODE, EVEN_PORT, FINGERPRINT, HEADER_LENGTH, ICE_CONTROLLED, ICE_CONTROLLING, LIFETIME, MAGIC_COOKIE, MAPPED_ADDRESS, MESSAGE_INTEGRITY, NONCE, PASSWORD, PRIORITY, REALM, REFLECTED_FROM, REMOTE_ADDRESS, REQUESTED_ADDRESS_FAMILY, REQUESTED_TRANSPORT, RESERVATION_TOKEN, RESPONSE_ADDRESS, SOFTWARE, SOURCE_ADDRESS, UNKNOWN_ATTRIBUTES, UNKNOWN_OPTIONAL_ATTRIBUTE, USE_CANDIDATE, USERNAME, XOR_MAPPED_ADDRESS, XOR_ONLY, XOR_PEER_ADDRESS, XOR_RELAYED_ADDRESS
Constructor and Description |
---|
XorMappedAddressAttribute()
Creates an instance of this attribute
|
XorMappedAddressAttribute(char type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
TransportAddress |
applyXor(byte[] xorMask)
Returns the result of applying XOR on this attribute's address, using the
specified XOR mask.
|
static TransportAddress |
applyXor(TransportAddress address,
byte[] transactionID)
Returns the result of applying XOR on the specified attribute's address.
|
TransportAddress |
getAddress(byte[] transactionID)
Returns the result of applying XOR on this attribute's address, using the
specified transaction ID when converting IPv6 addresses.
|
void |
setAddress(TransportAddress address,
byte[] transactionID)
Applies a XOR mask to the specified address and then sets it as the value
transported by this attribute.
|
decodeAttributeBody, encode, equals, getAddress, getAddressBytes, getDataLength, getFamily, getName, getPort, setAddress, setAttributeType
getAttributeType, getLocationInMessage, setLocationInMessage
public static final String NAME
XorMappedAddressAttribute()
XorMappedAddressAttribute(char type)
type
- other type than XOR-MAPPED-ADDRESSpublic static TransportAddress applyXor(TransportAddress address, byte[] transactionID)
address
- the address on which XOR should be appliedtransactionID
- the transaction id to use for the XORpublic TransportAddress getAddress(byte[] transactionID)
transactionID
- the transaction ID to use in case this attribute is
encapsulating an IPv6 address.public TransportAddress applyXor(byte[] xorMask)
xorMask
- the XOR mask to use when obtaining the original address.public void setAddress(TransportAddress address, byte[] transactionID)
address
- the address that we should xor and then record in this
attribute.transactionID
- the transaction identifier that we should use
when creating the XOR mask.Copyright © 2018. All rights reserved.