From 78f1393764b3088791e713211bb2055bf587f802 Mon Sep 17 00:00:00 2001
From: emcho Copyright: Copyright (c) 2003 Organization: Louis Pasteur University, Strasbourg, France Network Research Team (http://www-r2.u-strasbg.fr) Copyright: Copyright (c) 2008 Organisation: Louis Pasteur University, Strasbourg, France Network Research Team (http://www-r2.u-strasbg.fr)
Copyright: Copyright (c) 2003-2008
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @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. */ diff --git a/src/org/ice4j/attribute/AttributeDecoder.java b/src/org/ice4j/attribute/AttributeDecoder.java index 3f54bd0..7144ddf 100644 --- a/src/org/ice4j/attribute/AttributeDecoder.java +++ b/src/org/ice4j/attribute/AttributeDecoder.java @@ -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. * - *Copyright: Copyright (c) 2003-2008
- *Organization: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov * @author Sebastien Vincent - * @version 0.1 */ public class AttributeDecoder { diff --git a/src/org/ice4j/attribute/AttributeFactory.java b/src/org/ice4j/attribute/AttributeFactory.java index f08d1fe..fc91093 100644 --- a/src/org/ice4j/attribute/AttributeFactory.java +++ b/src/org/ice4j/attribute/AttributeFactory.java @@ -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. * - *Copyright: Copyright (c) 2003-2008
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov * @author Sebastien Vincent * @author Namal Senarathne - * @version 0.1 */ public class AttributeFactory { diff --git a/src/org/ice4j/attribute/ChangeRequestAttribute.java b/src/org/ice4j/attribute/ChangeRequestAttribute.java index 733e1d3..c82ade3 100644 --- a/src/org/ice4j/attribute/ChangeRequestAttribute.java +++ b/src/org/ice4j/attribute/ChangeRequestAttribute.java @@ -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. * - *Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @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. */ diff --git a/src/org/ice4j/attribute/ChangedAddressAttribute.java b/src/org/ice4j/attribute/ChangedAddressAttribute.java index 914892b..004c35e 100644 --- a/src/org/ice4j/attribute/ChangedAddressAttribute.java +++ b/src/org/ice4j/attribute/ChangedAddressAttribute.java @@ -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. * - *Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ public class ChangedAddressAttribute extends AddressAttribute diff --git a/src/org/ice4j/attribute/ChannelNumberAttribute.java b/src/org/ice4j/attribute/ChannelNumberAttribute.java index 675027a..3d9463b 100644 --- a/src/org/ice4j/attribute/ChannelNumberAttribute.java +++ b/src/org/ice4j/attribute/ChannelNumberAttribute.java @@ -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 { diff --git a/src/org/ice4j/attribute/DataAttribute.java b/src/org/ice4j/attribute/DataAttribute.java index 4c56fae..66fdda2 100644 --- a/src/org/ice4j/attribute/DataAttribute.java +++ b/src/org/ice4j/attribute/DataAttribute.java @@ -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 diff --git a/src/org/ice4j/attribute/DontFragmentAttribute.java b/src/org/ice4j/attribute/DontFragmentAttribute.java index 2a7964e..92106ea 100644 --- a/src/org/ice4j/attribute/DontFragmentAttribute.java +++ b/src/org/ice4j/attribute/DontFragmentAttribute.java @@ -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 { diff --git a/src/org/ice4j/attribute/ErrorCodeAttribute.java b/src/org/ice4j/attribute/ErrorCodeAttribute.java index 3bfc010..338f3f7 100644 --- a/src/org/ice4j/attribute/ErrorCodeAttribute.java +++ b/src/org/ice4j/attribute/ErrorCodeAttribute.java @@ -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. * - *Copyright: Copyright (c) 2003
- *Organization: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @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. */ diff --git a/src/org/ice4j/attribute/EvenPortAttribute.java b/src/org/ice4j/attribute/EvenPortAttribute.java index babdeeb..fb65fd0 100644 --- a/src/org/ice4j/attribute/EvenPortAttribute.java +++ b/src/org/ice4j/attribute/EvenPortAttribute.java @@ -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.Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ public class MappedAddressAttribute extends AddressAttribute diff --git a/src/org/ice4j/attribute/NonceAttribute.java b/src/org/ice4j/attribute/NonceAttribute.java index 75f6913..fd76eb7 100644 --- a/src/org/ice4j/attribute/NonceAttribute.java +++ b/src/org/ice4j/attribute/NonceAttribute.java @@ -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 { diff --git a/src/org/ice4j/attribute/OptionalAttribute.java b/src/org/ice4j/attribute/OptionalAttribute.java index 77adc69..7aba3a2 100644 --- a/src/org/ice4j/attribute/OptionalAttribute.java +++ b/src/org/ice4j/attribute/OptionalAttribute.java @@ -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. * - *Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 * */ public class OptionalAttribute diff --git a/src/org/ice4j/attribute/PriorityAttribute.java b/src/org/ice4j/attribute/PriorityAttribute.java index ce512a9..a68dbd8 100644 --- a/src/org/ice4j/attribute/PriorityAttribute.java +++ b/src/org/ice4j/attribute/PriorityAttribute.java @@ -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; + } } diff --git a/src/org/ice4j/attribute/RealmAttribute.java b/src/org/ice4j/attribute/RealmAttribute.java index 2b5e6bd..d9916c1 100644 --- a/src/org/ice4j/attribute/RealmAttribute.java +++ b/src/org/ice4j/attribute/RealmAttribute.java @@ -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 { diff --git a/src/org/ice4j/attribute/ReflectedFromAttribute.java b/src/org/ice4j/attribute/ReflectedFromAttribute.java index dd1ac83..acd6215 100644 --- a/src/org/ice4j/attribute/ReflectedFromAttribute.java +++ b/src/org/ice4j/attribute/ReflectedFromAttribute.java @@ -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. * - *Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ public class ReflectedFromAttribute extends AddressAttribute diff --git a/src/org/ice4j/attribute/RequestedTransportAttribute.java b/src/org/ice4j/attribute/RequestedTransportAttribute.java index 69deab6..442c30a 100644 --- a/src/org/ice4j/attribute/RequestedTransportAttribute.java +++ b/src/org/ice4j/attribute/RequestedTransportAttribute.java @@ -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; diff --git a/src/org/ice4j/attribute/ReservationTokenAttribute.java b/src/org/ice4j/attribute/ReservationTokenAttribute.java index 902ad1d..68aa32e 100644 --- a/src/org/ice4j/attribute/ReservationTokenAttribute.java +++ b/src/org/ice4j/attribute/ReservationTokenAttribute.java @@ -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). * - *Organization Network Research Team, Louis Pasteur University
* @author Sebastien Vincent - * @version 0.1 */ public class ReservationTokenAttribute extends Attribute diff --git a/src/org/ice4j/attribute/ResponseAddressAttribute.java b/src/org/ice4j/attribute/ResponseAddressAttribute.java index 6e89d29..557919c 100644 --- a/src/org/ice4j/attribute/ResponseAddressAttribute.java +++ b/src/org/ice4j/attribute/ResponseAddressAttribute.java @@ -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. * - *Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ public class ResponseAddressAttribute extends AddressAttribute diff --git a/src/org/ice4j/attribute/SoftwareAttribute.java b/src/org/ice4j/attribute/SoftwareAttribute.java index f704bad..4fe0906 100644 --- a/src/org/ice4j/attribute/SoftwareAttribute.java +++ b/src/org/ice4j/attribute/SoftwareAttribute.java @@ -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. * - *Organization Network Research Team, Louis Pasteur University
* @author Emil Ivov * @author Sebastien Vincent - * @version 0.1 */ public class SoftwareAttribute extends Attribute diff --git a/src/org/ice4j/attribute/SourceAddressAttribute.java b/src/org/ice4j/attribute/SourceAddressAttribute.java index 8742a40..4222e99 100644 --- a/src/org/ice4j/attribute/SourceAddressAttribute.java +++ b/src/org/ice4j/attribute/SourceAddressAttribute.java @@ -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. * - *Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ public class SourceAddressAttribute extends AddressAttribute diff --git a/src/org/ice4j/attribute/UnknownAttributesAttribute.java b/src/org/ice4j/attribute/UnknownAttributesAttribute.java index 9c3cd4d..f48d701 100644 --- a/src/org/ice4j/attribute/UnknownAttributesAttribute.java +++ b/src/org/ice4j/attribute/UnknownAttributesAttribute.java @@ -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 ... * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * - *Copyright: Copyright (c) 2003
- *Organisation: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ public class UnknownAttributesAttribute extends Attribute { diff --git a/src/org/ice4j/attribute/UsernameAttribute.java b/src/org/ice4j/attribute/UsernameAttribute.java index 60c7358..fd69e50 100644 --- a/src/org/ice4j/attribute/UsernameAttribute.java +++ b/src/org/ice4j/attribute/UsernameAttribute.java @@ -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 { diff --git a/src/org/ice4j/attribute/XorMappedAddressAttribute.java b/src/org/ice4j/attribute/XorMappedAddressAttribute.java index 0ec34c2..c8f1871 100644 --- a/src/org/ice4j/attribute/XorMappedAddressAttribute.java +++ b/src/org/ice4j/attribute/XorMappedAddressAttribute.java @@ -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. * - *Copyright: Copyright (c) 2005.
- *Organization: Network Research Team, Louis Pasteur University
* @author Emil Ivov - * @version 1.0 */ public class XorMappedAddressAttribute extends AddressAttribute diff --git a/src/org/ice4j/attribute/XorOnlyAttribute.java b/src/org/ice4j/attribute/XorOnlyAttribute.java index 3629d59..7e6ca5c 100644 --- a/src/org/ice4j/attribute/XorOnlyAttribute.java +++ b/src/org/ice4j/attribute/XorOnlyAttribute.java @@ -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. * - *Organization: Net Research Team, Louis Pasteur University
* @author Emil Ivov - * @version 0.1 */ public class XorOnlyAttribute extends Attribute diff --git a/src/org/ice4j/attribute/XorPeerAddressAttribute.java b/src/org/ice4j/attribute/XorPeerAddressAttribute.java index bbbb396..f8440bb 100644 --- a/src/org/ice4j/attribute/XorPeerAddressAttribute.java +++ b/src/org/ice4j/attribute/XorPeerAddressAttribute.java @@ -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 { diff --git a/src/org/ice4j/attribute/XorRelayedAddressAttribute.java b/src/org/ice4j/attribute/XorRelayedAddressAttribute.java index e5a6671..eb3dbbe 100644 --- a/src/org/ice4j/attribute/XorRelayedAddressAttribute.java +++ b/src/org/ice4j/attribute/XorRelayedAddressAttribute.java @@ -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 { diff --git a/src/org/ice4j/message/ChannelData.java b/src/org/ice4j/message/ChannelData.java index 18ca883..62625a4 100644 --- a/src/org/ice4j/message/ChannelData.java +++ b/src/org/ice4j/message/ChannelData.java @@ -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.*; * | | * +-------------------------------+ * - *Organisation:
Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @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"); } diff --git a/src/org/ice4j/message/Indication.java b/src/org/ice4j/message/Indication.java index da8f730..983c292 100644 --- a/src/org/ice4j/message/Indication.java +++ b/src/org/ice4j/message/Indication.java @@ -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. * - *Organisation:
Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Sebastien Vincent - * @version 0.1 */ public class Indication extends Message { diff --git a/src/org/ice4j/message/Request.java b/src/org/ice4j/message/Request.java index 80acb97..53d2b94 100644 --- a/src/org/ice4j/message/Request.java +++ b/src/org/ice4j/message/Request.java @@ -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. * - *Organisation:
Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ public class Request extends Message diff --git a/src/org/ice4j/stack/ErrorHandler.java b/src/org/ice4j/stack/ErrorHandler.java index 5dc7298..a19925e 100644 --- a/src/org/ice4j/stack/ErrorHandler.java +++ b/src/org/ice4j/stack/ErrorHandler.java @@ -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. * - *Organization:
Louis Pasteur University, Strasbourg, France.
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @author Emil Ivov - * @version 0.1 */ interface ErrorHandler { diff --git a/src/org/ice4j/stack/MessageEventHandler.java b/src/org/ice4j/stack/MessageEventHandler.java index 12e8b73..b33d7c7 100644 --- a/src/org/ice4j/stack/MessageEventHandler.java +++ b/src/org/ice4j/stack/MessageEventHandler.java @@ -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; diff --git a/src/org/ice4j/stack/MessageQueue.java b/src/org/ice4j/stack/MessageQueue.java index 3cb6124..ef9fba8 100644 --- a/src/org/ice4j/stack/MessageQueue.java +++ b/src/org/ice4j/stack/MessageQueue.java @@ -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. * - *Organization: Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
- * * @author Emil Ivov - * @version 0.1 */ class MessageQueue { diff --git a/src/org/ice4j/stunclient/NetworkConfigurationDiscoveryProcess.java b/src/org/ice4j/stunclient/NetworkConfigurationDiscoveryProcess.java index 67ce863..c88ab81 100644 --- a/src/org/ice4j/stunclient/NetworkConfigurationDiscoveryProcess.java +++ b/src/org/ice4j/stunclient/NetworkConfigurationDiscoveryProcess.java @@ -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). - *- *
Organisation:
Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
+ * + * * @author Emil Ivov - * @version 0.1 */ public class NetworkConfigurationDiscoveryProcess diff --git a/src/org/ice4j/stunclient/StunDiscoveryReport.java b/src/org/ice4j/stunclient/StunDiscoveryReport.java index e397e83..3aa66a2 100644 --- a/src/org/ice4j/stunclient/StunDiscoveryReport.java +++ b/src/org/ice4j/stunclient/StunDiscoveryReport.java @@ -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) * - * - *Organisation:
Louis Pasteur University, Strasbourg, France
- *Network Research Team (http://www-r2.u-strasbg.fr)
* @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;