directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r556080 - in /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared: io/decoder/HostAddressDecoder.java messages/value/HostAddress.java messages/value/HostAddressType.java
Date Fri, 13 Jul 2007 17:57:37 GMT
Author: erodriguez
Date: Fri Jul 13 10:57:32 2007
New Revision: 556080

URL: http://svn.apache.org/viewvc?view=rev&rev=556080
Log:
Corrected the host address types to match the address types listed in RFC 4120 (Kerberos v5).

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/HostAddressDecoder.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddress.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressType.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/HostAddressDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/HostAddressDecoder.java?view=diff&rev=556080&r1=556079&r2=556080
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/HostAddressDecoder.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/HostAddressDecoder.java
Fri Jul 13 10:57:32 2007
@@ -46,7 +46,7 @@
      */
     protected static HostAddress decode( DERSequence sequence )
     {
-        HostAddressType type = HostAddressType.NULL;
+        HostAddressType type = HostAddressType.ADDRTYPE_IPV4;
         byte[] value = null;
 
         for ( Enumeration e = sequence.getObjects(); e.hasMoreElements(); )

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddress.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddress.java?view=diff&rev=556080&r1=556079&r2=556080
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddress.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddress.java
Fri Jul 13 10:57:32 2007
@@ -56,7 +56,7 @@
      */
     public HostAddress( InetAddress internetAddress )
     {
-        addressType = HostAddressType.ADDRTYPE_INET;
+        addressType = HostAddressType.ADDRTYPE_IPV4;
         byte[] newAddress = internetAddress.getAddress();
         address = new byte[newAddress.length];
         System.arraycopy( newAddress, 0, address, 0, newAddress.length );

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressType.java?view=diff&rev=556080&r1=556079&r2=556080
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressType.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressType.java
Fri Jul 13 10:57:32 2007
@@ -26,144 +26,69 @@
 
 
 /**
+ * Type-safe enumerator for RFC 4120 section 7.5.3 "Address Types."
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 public final class HostAddressType implements Comparable
 {
     /**
-     * Constant for the "null" host address type.
+     * Constant for the "IPv4" host address type.
      */
-    public static final HostAddressType NULL = new HostAddressType( 0, "null" );
+    public static final HostAddressType ADDRTYPE_IPV4 = new HostAddressType( 2, "IPv4" );
 
     /**
-     * Constant for the "Unix" host address type.
+     * Constant for the "Directional" host address type.
      */
-    public static final HostAddressType ADDRTYPE_UNIX = new HostAddressType( 1, "Unix" );
+    public static final HostAddressType ADDRTYPE_DIRECTIONAL = new HostAddressType( 3, "Directional"
);
 
     /**
-     * Constant for the "Internet" host address type.
+     * Constant for the "ChaosNet" host address type.
      */
-    public static final HostAddressType ADDRTYPE_INET = new HostAddressType( 2, "Internet"
);
+    public static final HostAddressType ADDRTYPE_CHAOSNET = new HostAddressType( 5, "ChaosNet"
);
 
     /**
-     * Constant for the "Arpanet" host address type.
+     * Constant for the "XEROX Network Services (XNS)" host address type.
      */
-    public static final HostAddressType ADDRTYPE_IMPLINK = new HostAddressType( 3, "Arpanet"
);
+    public static final HostAddressType ADDRTYPE_XNS = new HostAddressType( 6, "XEROX Network
Services (XNS)" );
 
     /**
-     * Constant for the "PUP" host address type.
+     * Constant for the "ISO" host address type.
      */
-    public static final HostAddressType ADDRTYPE_PUP = new HostAddressType( 4, "PUP" );
+    public static final HostAddressType ADDRTYPE_ISO = new HostAddressType( 7, "ISO" );
 
     /**
-     * Constant for the "CHAOS" host address type.
+     * Constant for the "DECNET Phase IV" host address type.
      */
-    public static final HostAddressType ADDRTYPE_CHAOS = new HostAddressType( 5, "CHAOS"
);
+    public static final HostAddressType ADDRTYPE_DECNET = new HostAddressType( 12, "DECNET
Phase IV" );
 
     /**
-     * Constant for the "XEROX Network Services" host address type.
+     * Constant for the "AppleTalk DDP" host address type.
      */
-    public static final HostAddressType ADDRTYPE_XNS = new HostAddressType( 6, "XEROX Network
Services" );
-
-    /**
-     * Constant for the "IPX" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_IPX = new HostAddressType( 6, "IPX" );
-
-    /**
-     * Constant for the "OSI" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_OSI = new HostAddressType( 7, "OSI" );
-
-    /**
-     * Constant for the "European Computer Manufacturers" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_ECMA = new HostAddressType( 8, "European
Computer Manufacturers" );
-
-    /**
-     * Constant for the "Datakit" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_DATAKIT = new HostAddressType( 9, "Datakit"
);
-
-    /**
-     * Constant for the "CCITT" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_CCITT = new HostAddressType( 10, "CCITT"
);
-
-    /**
-     * Constant for the "SNA" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_SNA = new HostAddressType( 11, "SNA" );
-
-    /**
-     * Constant for the "DECnet" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_DECNET = new HostAddressType( 12, "DECnet"
);
-
-    /**
-     * Constant for the "Direct Data Link Interface" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_DLI = new HostAddressType( 13, "Direct Data
Link Interface" );
-
-    /**
-     * Constant for the "LAT" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_LAT = new HostAddressType( 14, "LAT" );
-
-    /**
-     * Constant for the "NSC Hyperchannel" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_HYLINK = new HostAddressType( 15, "NSC Hyperchannel"
);
-
-    /**
-     * Constant for the "AppleTalk" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType( 16, "AppleTalk"
);
+    public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType( 16, "AppleTalk
DDP" );
 
     /**
      * Constant for the "NetBios" host address type.
      */
-    public static final HostAddressType ADDRTYPE_NETBIOS = new HostAddressType( 17, "NetBios"
);
-
-    /**
-     * Constant for the "VoiceView" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_VOICEVIEW = new HostAddressType( 18, "VoiceView"
);
-
-    /**
-     * Constant for the "Firefox" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_FIREFOX = new HostAddressType( 19, "Firefox"
);
-
-    /**
-     * Constant for the "Banyan" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_BAN = new HostAddressType( 21, "Banyan"
);
-
-    /**
-     * Constant for the "ATM" host address type.
-     */
-    public static final HostAddressType ADDRTYPE_ATM = new HostAddressType( 22, "ATM" );
+    public static final HostAddressType ADDRTYPE_NETBIOS = new HostAddressType( 20, "NetBios"
);
 
     /**
-     * Constant for the "Internet Protocol V6" host address type.
+     * Constant for the "IPv6" host address type.
      */
-    public static final HostAddressType ADDRTYPE_INET6 = new HostAddressType( 23, "Internet
Protocol V6" );
+    public static final HostAddressType ADDRTYPE_IPV6 = new HostAddressType( 24, "IPv6" );
 
     /**
      * Array for building a List of VALUES.
      */
     private static final HostAddressType[] values =
-        { NULL, ADDRTYPE_UNIX, ADDRTYPE_INET, ADDRTYPE_IMPLINK, ADDRTYPE_PUP, ADDRTYPE_CHAOS,
ADDRTYPE_XNS,
-            ADDRTYPE_IPX, ADDRTYPE_OSI, ADDRTYPE_ECMA, ADDRTYPE_DATAKIT, ADDRTYPE_CCITT,
ADDRTYPE_SNA, ADDRTYPE_DECNET,
-            ADDRTYPE_DLI, ADDRTYPE_LAT, ADDRTYPE_HYLINK, ADDRTYPE_APPLETALK, ADDRTYPE_NETBIOS,
ADDRTYPE_VOICEVIEW,
-            ADDRTYPE_FIREFOX, ADDRTYPE_BAN, ADDRTYPE_ATM, ADDRTYPE_INET6 };
+        { ADDRTYPE_IPV4, ADDRTYPE_DIRECTIONAL, ADDRTYPE_CHAOSNET, ADDRTYPE_XNS, ADDRTYPE_ISO,
ADDRTYPE_DECNET,
+            ADDRTYPE_APPLETALK, ADDRTYPE_NETBIOS, ADDRTYPE_IPV6 };
 
     /**
      * A List of all the host address type constants.
      */
-    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values
) );
+    public static final List<HostAddressType> VALUES = Collections.unmodifiableList(
Arrays.asList( values ) );
 
     /**
      * The name of the host address type.
@@ -202,7 +127,7 @@
             }
         }
 
-        return NULL;
+        return ADDRTYPE_IPV4;
     }
 
 



Mime
View raw message