From c6473d654d9995a45ebc4bf612a610d123a24a54 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 24 Jan 2020 15:03:38 -0500 Subject: [PATCH] Add explanatory text for constants --- netbox/dcim/constants.py | 4 +++- netbox/ipam/constants.py | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/constants.py b/netbox/dcim/constants.py index 0301da7d8..0e05867e4 100644 --- a/netbox/dcim/constants.py +++ b/netbox/dcim/constants.py @@ -26,7 +26,7 @@ REARPORT_POSITIONS_MAX = 64 # INTERFACE_MTU_MIN = 1 -INTERFACE_MTU_MAX = 32767 +INTERFACE_MTU_MAX = 32767 # Max value of a signed 16-bit integer VIRTUAL_IFACE_TYPES = [ InterfaceTypeChoices.TYPE_VIRTUAL, @@ -49,7 +49,9 @@ NONCONNECTABLE_IFACE_TYPES = VIRTUAL_IFACE_TYPES + WIRELESS_IFACE_TYPES # POWERFEED_VOLTAGE_DEFAULT = 120 + POWERFEED_AMPERAGE_DEFAULT = 20 + POWERFEED_MAX_UTILIZATION_DEFAULT = 80 # Percentage diff --git a/netbox/ipam/constants.py b/netbox/ipam/constants.py index 22a977371..41075e54a 100644 --- a/netbox/ipam/constants.py +++ b/netbox/ipam/constants.py @@ -9,6 +9,11 @@ BGP_ASN_MAX = 2**32 - 1 # VRFs # +# Per RFC 4364 section 4.2, a route distinguisher may be encoded as one of the following: +# * Type 0 (16-bit AS number : 32-bit integer) +# * Type 1 (32-bit IPv4 address : 16-bit integer) +# * Type 2 (32-bit AS number : 16-bit integer) +# 21 characters are sufficient to convey the longest possible string value (255.255.255.255:65535) VRF_RD_MAX_LENGTH = 21 @@ -42,6 +47,7 @@ IPADDRESS_ROLES_NONUNIQUE = ( # VLANs # +# 12-bit VLAN ID (values 0 and 4095 are reserved) VLAN_VID_MIN = 1 VLAN_VID_MAX = 4094 @@ -50,5 +56,6 @@ VLAN_VID_MAX = 4094 # Services # +# 16-bit port number SERVICE_PORT_MIN = 1 SERVICE_PORT_MAX = 65535