|
Class: IPv6SocketAddress
Object
|
+--Collection
|
+--SequenceableCollection
|
+--ArrayedCollection
|
+--UninterpretedBytes
|
+--SocketAddress
|
+--IPSocketAddress
|
+--IPv6SocketAddress
- Package:
- stx:libbasic2
- Category:
- OS-Sockets
- Version:
- rev:
1.35
date: 2024/04/22 17:42:54
- user: stefan
- file: IPv6SocketAddress.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
Instances of IPv6SocketAddress represent v6 IP socket addresses.
These consist of a 16byte hostId and a port number.
Contains
2 byte domain AF_INET6
2 byte port
4 byte flowInfo
16 byte address
4 byte scope
[instance variables:]
[class variables:]
copyrightCOPYRIGHT (c) 1999 by eXept Software AG
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
addressing
-
anyAddress
-
return the anonymous addresses bytes
-
broadcastAddress
-
return the addresses bytes of a broadcast address
(this is the all-nodes link-local address ff02::1.
Broadcast is not normally used in IPv6
-
local
-
return the ipv6 addresses bytes addressing the local host
via the loopback interface.
conversion
-
hostAddressFromString: aString
-
convert an address given in a dot notation like 1:2:3:4:5:6:7:8 or ::1 or even ::
Usage example(s):
IPv6SocketAddress hostAddressFromString:'::'
IPv6SocketAddress hostAddressFromString:'::1'
IPv6SocketAddress hostAddressFromString:':1:2'
IPv6SocketAddress hostAddressFromString:'1::2'
IPv6SocketAddress hostAddressFromString:'1:2:3:4:5:6:7:8'
IPv6SocketAddress hostAddressFromString:'1234:5678:9abc:def1:2345:6789:abcd:ef12'
IPv6SocketAddress hostAddressFromString:'a:b:c:d:e:f:7:8'
IPv6SocketAddress hostAddressFromString:'1::2:3:4'
IPv6SocketAddress hostAddressFromString:'1:2:3::4'
IPv6SocketAddress hostAddressFromString:'[1:2:3::4]'
IPv6SocketAddress hostAddressFromString:'::1.2.3.4'
Bad:
IPv6SocketAddress hostAddressFromString:'11:1234:5678:9abc:def1:2345:6789:abcd:ef12'
|
queries
-
domain
-
ST/X (and a few other dialects) use the define-name in the C include file
as domain symbol. VisualWorks uses other names (see vwDomainSymbol)
-
hostAddressLen
-
answer the number of bytes of the host address
-
obsoleteDomainSymbol
-
old ST/X domain symbol - should no longer be used; see domain
-
vwDomainSymbol
-
ST/X (and a few other dialects) use the define-name in the C include file
as domain symbol. VisualWorks uses another name
accessing
-
flowInfo
-
struct sockaddr_in6 {
-
hostAddress
-
struct sockaddr_in6 {
-
hostAddress: aByteArray
-
-
scopeId
-
struct sockaddr_in6 {
comparing
-
sameHostAddress: aSocketAddress
-
answer true, if myself and aSocketAddress have the same host address
(but possibly different ports).
converting
-
asIPv4SocketAddress
-
convert a IPv4 addresse mapped to IPv6 into real IPv4 IPSocketAddress
Usage example(s):
(self addressString:'0:0:0:0:0:ffff::') asIPv4SocketAddress
(IPSocketAddress localHost port:80) asIPv6SocketAddress asIPv4SocketAddress
|
-
asIPv4SocketAddressIfPossible
-
try to convert to an IPv4 socket address (works when a IPv6 adreess is a mapped IPv4 address).
Answer myself, if the conversion is not possible.
Usage example(s):
(self addressString:'0:0:0:0:0:ffff::') asIPv4SocketAddressIfPossible
(IPSocketAddress localHost port:80) asIPv6SocketAddress asIPv4SocketAddressIfPossible
|
-
asIPv6SocketAddress
-
(comment from inherited method)
convert a IPv4 address to a mapped IPv6SocketAddress
printing & storing
-
printAddressOn: aStream
-
no more $: may be omitted
Usage example(s):
String streamContents:[:s | self localHost printAddressOn:s]
String streamContents:[:s |(self hostAddress:#[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]) printAddressOn:s]
String streamContents:[:s |(self hostAddress:#[1 2 3 4 5 6 7 8 0 0 0 0 0 0 0 0]) printAddressOn:s]
String streamContents:[:s |(self hostAddress:#[0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8]) printAddressOn:s]
String streamContents:[:s |(self hostAddress:#[0 0 0 0 1 2 3 4 5 6 7 8 0 0 0 0]) printAddressOn:s]
String streamContents:[:s |(self hostAddress:#[16r1a 16r1b 0 0 0 0 0 0 0 0 0 0 0 0 0 0]) printAddressOn:s]
|
private
-
adrBytesStart
-
-
numAdrBytes
-
queries
-
networkAddress
-
(comment from inherited method)
THINK TWICE before using this!
This is deprecated, it doesn't make sense any longer since CIDR, subnetting and netmasks
have been introduced.
Extract and return the network part from the host address.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
networkClass
-
IPV6 doesn't know about network classes
** This is an obsolete interface - do not use it (it may vanish in future versions) **
testing
-
isBroadcast
-
answer true, if this is a broadcast address:
all node-local nodes: ff01::1
all link-local nodes: ff02::1
Usage example(s):
(self addressString:'ff01::1') isBroadcast
(self addressString:'ff02::1') isBroadcast
(self addressString:'ff01::55') isBroadcast
|
-
isGlobalUnicast
-
answer true, if this address is a global unicast address
in the range 2000::/3
-
isIPv6SocketAddress
-
-
isLinkLocalUnicast
-
answer true, if this address is a link local unicast address fe80::/10
-
isLocal
-
answer true, if this address addresses a peer on the same host: ::1/128
or is an IPv4 local peer with address 127.x.y.z mapped to an IPv6 address.
Usage example(s):
self localHost isLocal
IPSocketAddress localHost asIPv6SocketAddress isLocal
|
-
isMappedIPv4
-
answer true, if this is a mapped IPv4 address
Usage example(s):
(self addressString:'0:0:0:0:0:ffff::') isMappedIPv4
|
-
isMulticast
-
answer true, if this address is a multicast address ff::/8
-
isUniqueLocalUnicast
-
answer true, if this address is a unique local unicast (e.g. private) address
in the range fc::/8 or fd::/8
|