file header update

This commit is contained in:
emcho 2010-04-25 14:40:58 +00:00
parent fb8267afc8
commit 78f1393764
39 changed files with 239 additions and 340 deletions

View File

@ -1,19 +1,15 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j;
/**
* A StunException is thrown when a general STUN exception is encountered.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organization: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
* @author Emil Ivov
* @version 0.1
*/
public class StunException extends Exception
{

View File

@ -8,7 +8,7 @@ package org.ice4j.attribute;
/**
* The ALTERNATE-SERVER attribute indicates the IP address and
* port of an alternate server the client could use. For example,
* port of an alternate server the client could use. For example,
* alternate servers may contains special capabilities.
*
* It consists of an eight bit address family, and a sixteen bit
@ -28,11 +28,7 @@ package org.ice4j.attribute;
* aligning parameters on natural boundaries. The IPv4 address is 32
* bits.
*
* <p>Copyright: Copyright (c) 2008</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Sebastien Vincent
* @version 0.1
*/
public class AlternateServerAttribute extends AddressAttribute

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -51,20 +51,16 @@ import org.ice4j.*;
* 0x0019: REQUESTED-TRANSPORT <br/>
* 0x001A: DONT-FRAGMENT <br/>
* 0x0022: RESERVATION-TOKEN <br/>
*
*
* ICE attributes:<br/>
* 0x0024: PRIORITY <br/>
* 0x0025: USE-CANDIDATE <br/>
* 0x8029: ICE-CONTROLLED <br/>
* 0x802A: ICE-CONTROLLING <br/>
*
* <p>Copyright: Copyright (c) 2003-2008</p>
* <p> Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p> Network Research Team (http://www-r2.u-strasbg.fr)</p>
* @author Emil Ivov
* @author Sebastien Vincent
* @author Namal Senarathne
* @version 0.1
*/
public abstract class Attribute
{
@ -180,8 +176,8 @@ public abstract class Attribute
* @param attributeValue a binary array containing this attribute's field
* values and NOT containing the attribute header.
* @param offset the position where attribute values begin (most often
* offset is equal to the index of the first byte after
* length)
* offset is equal to the index of the first byte after
* length)
* @param length the length of the binary array.
* @throws StunException if attrubteValue contains invalid data.
*/

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -12,12 +12,8 @@ import org.ice4j.*;
* The class provides utilities for decoding a binary stream into an Attribute
* class.
*
* <p>Copyright: Copyright (c) 2003-2008</p>
* <p>Organization: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
* @author Emil Ivov
* @author Sebastien Vincent
* @version 0.1
*/
public class AttributeDecoder
{

View File

@ -1,24 +1,20 @@
/** Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
/*
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
import org.ice4j.*;
/**
*
* This class provides factory methods to allow an application to create
* STUN / TURN / ICE Attributes from a particular implementation.
*
* <p>Copyright: Copyright (c) 2003-2008</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @author Sebastien Vincent
* @author Namal Senarathne
* @version 0.1
*/
public class AttributeFactory
{

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -30,11 +30,7 @@ import org.ice4j.*;
* server to send the Binding Response with a different port than the
* one the Binding Request was received on.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class ChangeRequestAttribute
@ -197,8 +193,8 @@ public class ChangeRequestAttribute
* @param attributeValue a binary array containing this attribute's field
* values and NOT containing the attribute header.
* @param offset the position where attribute values begin (most often
* offset is equal to the index of the first byte after
* length)
* offset is equal to the index of the first byte after
* length)
* @param length the length of the binary array.
* @throws StunException if attrubteValue contains invalid data.
*/

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -15,11 +15,7 @@ package org.ice4j.attribute;
* Response, independent of the value of the flags. Its syntax is
* identical to MAPPED-ADDRESS.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class ChangedAddressAttribute extends AddressAttribute

View File

@ -1,19 +1,18 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
import org.ice4j.*;
/**
* The CHANNEL-NUMBER attribute is used to known on which
* The CHANNEL-NUMBER attribute is used to known on which
* channel the TURN client want to send data.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class ChannelNumberAttribute extends Attribute
{

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -19,7 +19,6 @@ import org.ice4j.*;
* attributes on word boundaries.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class DataAttribute
extends Attribute

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -10,11 +10,10 @@ import org.ice4j.*;
/**
* The DONT-FRAGMENT attribute is used to inform TURN
* server (if it supports this attribute) that it should set DF bit to 1
* server (if it supports this attribute) that it should set DF bit to 1
* in IPv4 headers when relaying client data.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class DontFragmentAttribute extends Attribute
{

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -71,11 +71,7 @@ import org.ice4j.*;
* 600 (Global Failure:) The server is refusing to fulfill the request.
* The client should not retry.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organization: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
* @author Emil Ivov
* @version 0.1
*/
public class ErrorCodeAttribute extends Attribute
{
@ -366,8 +362,8 @@ public class ErrorCodeAttribute extends Attribute
* @param attributeValue a binary array containing this attribute's field
* values and NOT containing the attribute header.
* @param offset the position where attribute values begin (most often
* offset is equal to the index of the first byte after
* length)
* offset is equal to the index of the first byte after
* length)
* @param length the length of the binary array.
* @throws StunException if attrubteValue contains invalid data.
*/

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -17,7 +17,6 @@ import org.ice4j.*;
* R : ask to reserve a second port.<br/>
*
* @author Sebastien Vincent
* @version 0.1
*/
public class EvenPortAttribute extends Attribute
{
@ -63,7 +62,7 @@ public class EvenPortAttribute extends Attribute
if (att.getAttributeType() != getAttributeType()
|| att.getDataLength() != getDataLength()
/* compare data */
|| att.rFlag != rFlag
|| att.rFlag != rFlag
)
return false;

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -13,7 +13,6 @@ import org.ice4j.*;
* from packets of other protocols.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class FingerprintAttribute extends Attribute
{
@ -88,7 +87,7 @@ public class FingerprintAttribute extends Attribute
/**
* Copies the specified binary array into the the CRC value of the CRC
* Copies the specified binary array into the the CRC value of the CRC
* attribute.
* @param crc the binary array containing the CRC.
*/

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -13,7 +13,6 @@ import org.ice4j.*;
* of TURN allocations.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class LifetimeAttribute extends Attribute
{
@ -126,7 +125,7 @@ public class LifetimeAttribute extends Attribute
throw new StunException("length invalid");
}
lifetime = ((attributeValue[0] << 24) & 0xff000000) + ((attributeValue[1] << 16) & 0x00ff0000)
lifetime = ((attributeValue[0] << 24) & 0xff000000) + ((attributeValue[1] << 16) & 0x00ff0000)
+ ((attributeValue[2] << 8) & 0x0000ff00) + (attributeValue[3] & 0x000000ff);
}

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -25,11 +25,7 @@ package org.ice4j.attribute;
* aligning parameters on natural boundaries. The IPv4 address is 32
* bits.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class MappedAddressAttribute extends AddressAttribute

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -14,7 +14,6 @@ import org.ice4j.*;
* The NONCE attribute is used for authentification.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class NonceAttribute extends Attribute
{

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -17,11 +17,7 @@ import org.ice4j.*;
* dealing with attributes in received messages, and generating messages
* containing attributes not explicitly supported by the stack.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*
*/
public class OptionalAttribute

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -12,35 +12,36 @@ import org.ice4j.*;
* This class is used to represent the PRIORITY attribute used for ICE processing
* This attribute is not in the original specification of STUN
* It is added as an extension to STUN to be used for ICE implementations
*
*
* PRIORITY attribute contains a 32 bit priority value
* It is used in stun binding requests sent from ICE-Agents to their
* peers
*
*
* @author Namal Senarathne
*/
public class PriorityAttribute
extends Attribute
public class PriorityAttribute
extends Attribute
{
/**
* The length of the Data contained in the Priority Attribute
*/
private static final char DATA_LENGTH_PRIORITY = 4;
/**
* The priority value specified in the attribute
*/
private long priority = 0; // int is enough to store this value, but long is used, since
// candidate and candidate-pair classes use long to store priority values
public PriorityAttribute()
{
super(PRIORITY);
}
/**
* The length of the Data contained in the Priority Attribute
*/
private static final char DATA_LENGTH_PRIORITY = 4;
/**
/**
* The priority value specified in the attribute. An int should be enough
* to store this value, but long is used, since candidate and candidate-pair
* classes use long to store priority values
*/
private long priority = 0;
public PriorityAttribute()
{
super(PRIORITY);
}
/**
* Reconstructs the priority value from the given byte array
* and stores it in the 'long' variable
* and stores it in the 'long' variable
*
* @param attributeValue a binary array containing this attribute's
* field values and NOT containing the attribute header.
@ -49,123 +50,123 @@ public class PriorityAttribute
* @param length the length of the binary array.
* @throws StunException if attrubteValue contains invalid data.
*/
void decodeAttributeBody(byte[] attributeValue, char offset, char length)
throws StunException
{
// array used to hold the intermediate long values reconstructed from the
// attributeValue array
long[] values = new long[4];
// Reading in the network byte order (Big-Endian)
values[0] = (long)((attributeValue[offset++] & 0xff) << 24);
values[1] = (long)((attributeValue[offset++] & 0xff) << 16);
values[2] = (long)((attributeValue[offset++] & 0xff) << 8);
values[3] = (long)(attributeValue[offset++] & 0xff);
// reconstructing the priority value
this.priority = values[0] | values[1] | values[2] | values[3];
}
void decodeAttributeBody(byte[] attributeValue, char offset, char length)
throws StunException
{
/**
// array used to hold the intermediate long values reconstructed from the
// attributeValue array
long[] values = new long[4];
// Reading in the network byte order (Big-Endian)
values[0] = (long)((attributeValue[offset++] & 0xff) << 24);
values[1] = (long)((attributeValue[offset++] & 0xff) << 16);
values[2] = (long)((attributeValue[offset++] & 0xff) << 8);
values[3] = (long)(attributeValue[offset++] & 0xff);
// reconstructing the priority value
this.priority = values[0] | values[1] | values[2] | values[3];
}
/**
* Returns a binary representation of this attribute.
*
* @return a binary representation of this attribute.
*/
public byte[] encode()
{
char type = getAttributeType();
byte[] binValue = new byte[HEADER_LENGTH + getDataLength()];
//Type
public byte[] encode()
{
char type = getAttributeType();
byte[] binValue = new byte[HEADER_LENGTH + getDataLength()];
//Type
binValue[0] = (byte)(type>>8);
binValue[1] = (byte)(type&0x00FF);
//Length
binValue[2] = (byte)(getDataLength()>>8);
binValue[3] = (byte)(getDataLength()&0x00FF);
//Priority
//Priority
binValue[4] = (byte)((priority & 0xFF000000L) >> 24);
binValue[5] = (byte)((priority & 0x00FF0000L) >> 16);
binValue[6] = (byte)((priority & 0x0000FF00L) >> 8);
binValue[7] = (byte)(priority & 0x000000FFL);
return binValue;
}
/**
return binValue;
}
/**
* Compares two STUN Attributes. Two attributes are considered equal when they
* have the same type length and value.
*
* @param obj the object to compare this attribute with.
* @return true if the attributes are equal and false otherwise.
*/
public boolean equals(Object obj)
{
if (! (obj instanceof PriorityAttribute)
|| obj == null)
return false;
public boolean equals(Object obj)
{
if (! (obj instanceof PriorityAttribute)
|| obj == null)
return false;
if (obj == this)
return true;
PriorityAttribute att = (PriorityAttribute) obj;
if (obj == this)
return true;
PriorityAttribute att = (PriorityAttribute) obj;
if (att.getAttributeType() != getAttributeType()
|| att.getDataLength() != getDataLength()
|| (priority != att.priority))
return false;
return true;
}
/**
return true;
}
/**
* Returns the length of this attribute's body.
*
* @return the length of this attribute's value.
*/
public char getDataLength()
{
return DATA_LENGTH_PRIORITY;
}
public char getDataLength()
{
return DATA_LENGTH_PRIORITY;
}
/**
/**
* Returns the human readable name of this attribute.
*
* @return this attribute's name.
*/
public String getName()
{
return "PRIORITY";
}
/**
* Returns the priority specified in the PRIORITY Attribute
*
* @return long specifying the priority
*/
public long getPriority()
{
return priority;
}
/**
* Sets the priority of the PRIORITY Attribute with the specified value
*
* @param priority the long variable specifying the priority value
*
* @throws StunException throws StunException if indicated priority value is illegal
*/
public void setPriority(long priority)
throws StunException
{
/* Priority must be between 1 and (2^31 - 1) */
if(priority <= 0 || priority > 0x7FFFFFFFL)
throw new StunException(StunException.ILLEGAL_ARGUMENT, "Priority must be " +
"between 0 and (2**31 - 1)");
else
this.priority = priority;
}
public String getName()
{
return "PRIORITY";
}
/**
* Returns the priority specified in the PRIORITY Attribute
*
* @return long specifying the priority
*/
public long getPriority()
{
return priority;
}
/**
* Sets the priority of the PRIORITY Attribute with the specified value
*
* @param priority the long variable specifying the priority value
*
* @throws StunException throws StunException if indicated priority value is illegal
*/
public void setPriority(long priority)
throws StunException
{
/* Priority must be between 1 and (2^31 - 1) */
if(priority <= 0 || priority > 0x7FFFFFFFL)
throw new StunException(StunException.ILLEGAL_ARGUMENT, "Priority must be " +
"between 0 and (2**31 - 1)");
else
this.priority = priority;
}
}

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -11,11 +11,10 @@ import java.util.*;
import org.ice4j.*;
/**
* The REALM attribute contains a text whcih meets the grammar for
* The REALM attribute contains a text whcih meets the grammar for
* "realm value" as described in RFC3261 but without the double quotes.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class RealmAttribute extends Attribute
{

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -16,11 +16,7 @@ package org.ice4j.attribute;
*
* Its syntax is identical to the MAPPED-ADDRESS attribute.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class ReflectedFromAttribute extends AddressAttribute

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -16,7 +16,6 @@ import org.ice4j.*;
* Support of TCP is detailed in draft-ietf-behave-turn-tcp-05.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class RequestedTransportAttribute extends Attribute
{
@ -30,7 +29,7 @@ public class RequestedTransportAttribute extends Attribute
*/
public static final char DATA_LENGTH = 4;
/**
/**
* Transport protocol.
*
* 17 = UDP;

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -14,9 +14,7 @@ import org.ice4j.*;
* The RESERVATION-TOKEN attribute contains a token that identifie a reservation port
* on a TURN server. The value is on 64 bits (8 bytes).
*
* <p>Organization Network Research Team, Louis Pasteur University</p>
* @author Sebastien Vincent
* @version 0.1
*/
public class ReservationTokenAttribute
extends Attribute

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -11,11 +11,7 @@ package org.ice4j.attribute;
* Binding Request should be sent. Its syntax is identical to MAPPED-
* ADDRESS.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class ResponseAddressAttribute extends AddressAttribute

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -19,10 +19,8 @@ import org.ice4j.*;
* multiple of 4 (measured in bytes) in order to guarantee alignment of
* attributes on word boundaries.
*
* <p>Organization Network Research Team, Louis Pasteur University</p>
* @author Emil Ivov
* @author Sebastien Vincent
* @version 0.1
*/
public class SoftwareAttribute
extends Attribute

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -11,11 +11,7 @@ package org.ice4j.attribute;
* indicates the source IP address and port that the server is sending
* the response from. Its syntax is identical to that of MAPPED-ADDRESS.
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class SourceAddressAttribute extends AddressAttribute

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
/*
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -29,11 +29,7 @@ import org.ice4j.*;
* | Attribute 3 Type | Attribute 4 Type ...
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* <p>Copyright: Copyright (c) 2003</p>
* <p>Organisation: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class UnknownAttributesAttribute extends Attribute
{

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -15,7 +15,6 @@ import org.ice4j.*;
* The value of USERNAME is a variable length value.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class UsernameAttribute extends Attribute
{

View File

@ -44,10 +44,7 @@ import org.ice4j.message.*;
* equal to the IP address in MAPPED-ADDRESS, exclusive or'ed with the
* entire 128 bit transaction ID.
*
* <p>Copyright: Copyright (c) 2005.</p>
* <p>Organization: Network Research Team, Louis Pasteur University</p>
* @author Emil Ivov
* @version 1.0
*/
public class XorMappedAddressAttribute
extends AddressAttribute

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -19,9 +19,7 @@ import org.ice4j.*;
* This attribute has a length of zero, and therefore contains no other
* information past the common attribute header.
*
* <p>Organization: Net Research Team, Louis Pasteur University</p>
* @author Emil Ivov
* @version 0.1
*/
public class XorOnlyAttribute
extends Attribute

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -13,7 +13,6 @@ package org.ice4j.attribute;
* It has the same format as XOR-MAPPED-ADDRESS.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class XorPeerAddressAttribute extends XorMappedAddressAttribute
{

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@ -13,7 +13,6 @@ package org.ice4j.attribute;
* It has the same format as XOR-MAPPED-ADDRESS.
*
* @author Sebastien Vincent
* @version 0.1
*/
public class XorRelayedAddressAttribute extends XorMappedAddressAttribute
{

View File

@ -1,8 +1,8 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.message;
@ -25,10 +25,7 @@ import org.ice4j.*;
* | |
* +-------------------------------+
*
* <p>Organisation: <p> Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Sebastien Vincent
* @version 0.1
*/
public class ChannelData
{
@ -37,7 +34,7 @@ public class ChannelData
*/
private char channelNumber = 0;
/**
/**
* The data.
*/
private byte data[] = null;
@ -164,7 +161,7 @@ public class ChannelData
ChannelData channelData = null;
byte data[] = null;
if(arrayLen < 4)
if(arrayLen < 4)
{
throw new StunException(StunException.ILLEGAL_ARGUMENT, "Size too short");
}

View File

@ -1,23 +1,18 @@
/*
* Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.message;
import org.ice4j.*;
/**
* An indication descendant of the message class.
*
* For example, indication messages is used by TURN protocol
* to send and receive encapsulated data.
*
* <p>Organisation: <p> Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Sebastien Vincent
* @version 0.1
*/
public class Indication extends Message
{

View File

@ -1,22 +1,17 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.message;
import org.ice4j.*;
/**
* A request descendant of the message class. The primary purpose of the
* Request class is to allow better functional definition of the classes in the
* stack package.
*
* <p>Organisation: <p> Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class Request extends Message

View File

@ -1,18 +1,15 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.stack;
/**
* Generic Error Handler.
*
* <p>Organization: <p> Louis Pasteur University, Strasbourg, France.</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
* @author Emil Ivov
* @version 0.1
*/
interface ErrorHandler
{

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.stack;

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.stack;
@ -14,11 +14,7 @@ import java.util.logging.Logger;
* access is synchronized and message delivery ( remove() ) is blocking in the
* case of an empty queue.
*
* <p>Organization: Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p>
*
* @author Emil Ivov
* @version 0.1
*/
class MessageQueue
{

View File

@ -76,11 +76,9 @@ import org.ice4j.stack.*;
* local address and port for subsequent tests resolves this problem.
* An alternative is to wait sufficiently long to be confident that the
* old bindings have expired (half an hour should more than suffice).
* </p><p>
* <p>Organisation: <p> Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* </p>
*
* @author Emil Ivov
* @version 0.1
*/
public class NetworkConfigurationDiscoveryProcess

View File

@ -1,8 +1,8 @@
/*
* Stun4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
* Maintained by the SIP Communicator community (http://sip-communicator.org).
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.stunclient;
@ -13,11 +13,7 @@ import org.ice4j.*;
* contains information about the NAT Server (or firewall )this client is behind,
* and a mapped address value (if discovered)
*
*
* <p>Organisation: <p> Louis Pasteur University, Strasbourg, France</p>
* <p>Network Research Team (http://www-r2.u-strasbg.fr)</p></p>
* @author Emil Ivov
* @version 0.1
*/
public class StunDiscoveryReport
@ -25,12 +21,12 @@ public class StunDiscoveryReport
/**
* Indicates that NAT detection has failed or not yet initiated.
*/
public static final String UNKNOWN = "Unknown Network Configuration";
public static final String UNKNOWN = "Unknown Network Configuration";
/**
* Means, there's no NAT or firewall.
*/
public static final String OPEN_INTERNET = "Open Internet Configuration";
public static final String OPEN_INTERNET = "Open Internet Configuration";
/**
* Indicates that UDP communication is not possible.
@ -45,22 +41,23 @@ public class StunDiscoveryReport
/**
* NAT type is full cone.
*/
public static final String FULL_CONE_NAT = "Full Cone NAT";
public static final String FULL_CONE_NAT = "Full Cone NAT";
/**
* We are behind a symmetric nat.
*/
public static final String SYMMETRIC_NAT = "Symmetric NAT";
public static final String SYMMETRIC_NAT = "Symmetric NAT";
/**
* NAT type is Restricted Cone.
*/
public static final String RESTRICTED_CONE_NAT = "Restricted Cone NAT";
public static final String RESTRICTED_CONE_NAT = "Restricted Cone NAT";
/**
* NAT type is port restricted cone.
*/
public static final String PORT_RESTRICTED_CONE_NAT= "Port Restricted Cone NAT";
public static final String PORT_RESTRICTED_CONE_NAT
= "Port Restricted Cone NAT";
private String natType = UNKNOWN;