IPSOCKET

A pair of IP-address and port.

LITERAL NOTATION:

IPv4 socket Expressed as an IPv4 address followed by a colon ‘:’ and a port number:

232.5.16.44:443

Conversion

1
2
3
4
IPSOCKET("192.168.0.1:22")                          // => 192.168.0.1:22
IPSOCKET("[2a00:1450:4010:c05::69]:443")            // => [2a00:1450:4010:c05::69]:443
IPSOCKET(192.168.0.1, 80)                           // => 192.168.0.1:80
IPSOCKET(IPADDR("2a00:1450:4010:c05::69"), 8388)    // => [2a00:1450:4010:c05::69]:8388
  1. converts string type IPv4 address and port to IPSOCKET
  2. converts string type IPv6 address and port (as specified in https://tools.ietf.org/html/rfc5952#section-6) to IPSOCKET
  3. converts literal notation IPv4 address and port to IPSOCKET
  4. converts IPv6 IPADDR and port to IPSOCKET

Functions

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ipsocket1=213.44.17.8:22
ipsocket2=213.44.17.8:443

ipsocket1 < ipsocket2       // => TRUE
ipsocket1 = ipsocket2       // => FALSE
ipsocket1 > ipsocket2       // => FALSE
ASN(ipsocket1)              // => 5410
ASNAME(ipsocket1)           // => "AS5410 Bouygues Telecom SA"
CC(ipsocket1)               // => "FR"
IPLOC(ipsocket1)            // => {cc="FR" city="--" geo=48.8582,2.3387}
IS_IPV4(ipsocket1)          // => TRUE
IS_IPV6(ipsocket1)          // => FALSE
PORT(ipsocket1)             // => 22