We've been making changes to how we organize and display our docs. Our work isn't done but we'd love your feedback.

client.as.number

Autonomous system (AS) number.

The INTEGER type in VCL is wide enough to support the full range of 32-bit AS numbers.

Formatting these numbers to base 10 (e.g., by implicit conversion to a STRING type) will give an asplain representation of the number, which is just its base 10 representation.

RFC 5396 introduces the asdot+ format, which represents a 32-bit AS number as two 16-bit parts. The following VCL illustrates constructing an asdot+ formatted number:

1
2
3
4
5
6
7
declare local var.hi INTEGER;
declare local var.lo INTEGER;
set var.hi = client.as.number;
set var.hi >>= 16;
set var.lo = client.as.number;
set var.lo &= 0xFFFF;
log client.as.number ": " var.hi "." var.lo;

Examples

The 32-bit AS number 65550 (reserved by RFC 5398 for documentation use) is rendered as 1.14.

Several ranges of AS numbers are reserved for various purposes. The following VCL fragment illustrates categorizing AS numbers into these ranges:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
declare local var.as_category STRING;
if (client.as.number < 0 || client.as.number > 0xFFFFFFFF) {
  set var.as_category = "invalid";
} else if (client.as.number == 0) {
  set var.as_category = "reserved"; # RFC 1930
} else if (client.as.number <= 23455) {
  set var.as_category = "public";
} else if (client.as.number == 23456) {
  set var.as_category = "transition"; # RFC 6793
} else if (client.as.number <= 64534) {
  set var.as_category = "public";
} else if (client.as.number <= 64495) {
  set var.as_category = "reserved";
} else if (client.as.number <= 64511) {
  set var.as_category = "documentation"; # RFC 5398
} else if (client.as.number <= 65534) {
  set var.as_category = "private";
} else if (client.as.number == 65535) {
  set var.as_category = "reserved";
} else if (client.as.number <= 65551) {
  set var.as_category = "documentation"; # RFC 4893, RFC 5398
} else if (client.as.number <= 131071) {
  set var.as_category = "reserved";
} else if (client.as.number <= 4199999999) {
  set var.as_category = "public";
} else if (client.as.number <= 4294967294) {
  set var.as_category = "private"; # RFC 6996
} else if (client.as.number == 4294967295) {
  set var.as_category = "reserved";
} else {
  set var.as_category = "unknown";
}

Type

INTEGER

Accessibility

Read Only

Readable From

All subroutines