source: node_modules/ip-address/src/v6/constants.ts@ 81bc7da

finki-main main
Last change on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
1export const BITS = 128;
2export const GROUPS = 8;
3
4/**
5 * Represents IPv6 address scopes
6 * @memberof Address6
7 * @static
8 */
9export const SCOPES: { [key: number]: string | undefined } = {
10 0: 'Reserved',
11 1: 'Interface local',
12 2: 'Link local',
13 4: 'Admin local',
14 5: 'Site local',
15 8: 'Organization local',
16 14: 'Global',
17 15: 'Reserved',
18} as const;
19
20/**
21 * Represents IPv6 address types
22 * @memberof Address6
23 * @static
24 */
25export const TYPES: { [key: string]: string | undefined } = {
26 'ff01::1/128': 'Multicast (All nodes on this interface)',
27 'ff01::2/128': 'Multicast (All routers on this interface)',
28 'ff02::1/128': 'Multicast (All nodes on this link)',
29 'ff02::2/128': 'Multicast (All routers on this link)',
30 'ff05::2/128': 'Multicast (All routers in this site)',
31 'ff02::5/128': 'Multicast (OSPFv3 AllSPF routers)',
32 'ff02::6/128': 'Multicast (OSPFv3 AllDR routers)',
33 'ff02::9/128': 'Multicast (RIP routers)',
34 'ff02::a/128': 'Multicast (EIGRP routers)',
35 'ff02::d/128': 'Multicast (PIM routers)',
36 'ff02::16/128': 'Multicast (MLDv2 reports)',
37 'ff01::fb/128': 'Multicast (mDNSv6)',
38 'ff02::fb/128': 'Multicast (mDNSv6)',
39 'ff05::fb/128': 'Multicast (mDNSv6)',
40 'ff02::1:2/128': 'Multicast (All DHCP servers and relay agents on this link)',
41 'ff05::1:2/128': 'Multicast (All DHCP servers and relay agents in this site)',
42 'ff02::1:3/128': 'Multicast (All DHCP servers on this link)',
43 'ff05::1:3/128': 'Multicast (All DHCP servers in this site)',
44 '::/128': 'Unspecified',
45 '::1/128': 'Loopback',
46 'ff00::/8': 'Multicast',
47 'fe80::/10': 'Link-local unicast',
48} as const;
49
50/**
51 * A regular expression that matches bad characters in an IPv6 address
52 * @memberof Address6
53 * @static
54 */
55export const RE_BAD_CHARACTERS = /([^0-9a-f:/%])/gi;
56
57/**
58 * A regular expression that matches an incorrect IPv6 address
59 * @memberof Address6
60 * @static
61 */
62export const RE_BAD_ADDRESS = /([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;
63
64/**
65 * A regular expression that matches an IPv6 subnet
66 * @memberof Address6
67 * @static
68 */
69export const RE_SUBNET_STRING = /\/\d{1,3}(?=%|$)/;
70
71/**
72 * A regular expression that matches an IPv6 zone
73 * @memberof Address6
74 * @static
75 */
76export const RE_ZONE_STRING = /%.*$/;
77
78export const RE_URL = /^\[{0,1}([0-9a-f:]+)\]{0,1}/;
79export const RE_URL_WITH_PORT = /\[([0-9a-f:]+)\]:([0-9]{1,5})/;
Note: See TracBrowser for help on using the repository browser.