IPv6SocketAddress.st
changeset 1231 ad3aaa474d50
parent 1228 b766b9873ba6
child 1259 0a557e59ea4a
--- a/IPv6SocketAddress.st	Wed May 21 20:29:06 2003 +0200
+++ b/IPv6SocketAddress.st	Wed May 21 23:21:33 2003 +0200
@@ -73,8 +73,35 @@
     ^ #inet6
 ! !
 
+!IPv6SocketAddress methodsFor:'accessing'!
+
+hostAddress
+"/    struct sockaddr_in6 {
+"/            unsigned short int      sin6_family;    /* AF_INET6 */
+"/            __u16                   sin6_port;      /* Transport layer port # */
+"/            __u32                   sin6_flowinfo;  /* IPv6 flow information */
+"/            struct in6_addr         sin6_addr;      /* IPv6 address */
+"/            __u32                   sin6_scope_id;  /* scope id (new in RFC2553) */
+"/    };
+    ^ (ByteArray new:16) replaceFrom:1 with:self startingAt:9
+!
+
+hostAddress:aByteArray
+    ^ self replaceFrom:9 to:9+16-1 with:aByteArray startingAt:1
+! !
+
+!IPv6SocketAddress methodsFor:'private'!
+
+adrBytesStart
+    ^ 9
+!
+
+numAdrBytes
+    ^ 16
+! !
+
 !IPv6SocketAddress class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/IPv6SocketAddress.st,v 1.7 2003-05-21 18:03:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/IPv6SocketAddress.st,v 1.8 2003-05-21 21:21:33 cg Exp $'
 ! !