|
Class: IPv6SocketAddress
Object
|
+--Collection
|
+--SequenceableCollection
|
+--ArrayedCollection
|
+--UninterpretedBytes
|
+--SocketAddress
|
+--IPSocketAddress
|
+--IPv6SocketAddress
- Package:
- stx:libbasic2
- Category:
- OS-Sockets
- Version:
- rev:
1.27
date: 2019/05/27 12:10:30
- user: cg
- file: IPv6SocketAddress.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
- Author:
- Claus Gittinger (cg@exept)
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:]
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 addresses bytes addressing the local host
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'
|
queries
-
domain
-
-
hostAddressLen
-
answer the number of bytes of the host address
-
obsoleteDomainSymbol
-
-
vwDomainSymbol
-
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
-
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
-
-
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
usage example(s):
-
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
|