コード例 #1
0
ファイル: util.py プロジェクト: stephan1373/nsot
def make_mac(mac):
    """
    Return a MAC address in the default dialect.

    :param mac:
        MAC address (string, integer, or EUI object)
    """
    return netaddr.EUI(mac, dialect=macaddress.default_dialect())
コード例 #2
0
ファイル: util.py プロジェクト: vincentbernat/nsot
def make_mac(mac):
    """
    Return a MAC address in the default dialect.

    :param mac:
        MAC address (string, integer, or EUI object)
    """
    return netaddr.EUI(mac, dialect=macaddress.default_dialect())
コード例 #3
0
    r"^([A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9]|[A-Za-z0-9])$")

##############
# Interfaces #
##############

# The default format for displaying MAC addresses. This defaults to
# ":"-separated and expanded (e.g. '00:00:00:00:00:00')
MACADDRESS_DEFAULT_DIALECT = 'macaddress.mac_linux'

# The default speed in Mbps for newly device interfaces if not otherwise
# specified.
INTERFACE_DEFAULT_SPEED = 1000  # In Mbps (e.g. 1Gbps)

# Default MAC address ('00:00:00:00:00:00')
INTERFACE_DEFAULT_MAC = eui.EUI(0, dialect=macaddress.default_dialect())

# These are mappings to the formal integer types from SNMP IF-MIB::ifType. The
# types listed here are the most commonly found in the wild.
#
# *IF YOU ARE GOING TO MODIFY THIS*: This MUST be a list of 2-tuples of
# (iftype, name), where iftype is the unique ID for the IANA ifType SNMP MIB,
# and name is whatever name your little heart desires, but hopefully matches
# the legit description according to the MIB.
#
# Ref: https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib
INTERFACE_TYPE_CHOICES = (
    (6, 'ethernet'),  # for all ethernet-like interfaces
    (1, 'other'),  # none of the following
    (135, 'l2vlan'),  # Layer 2 Virtual LAN using 802.1Q
    (136, 'l3vlan'),  # Layer 3 Virtual LAN using IP
コード例 #4
0
ファイル: models.py プロジェクト: kmccormick/rmm
 def __str__(self):
     return format_mac(self.macaddr, default_dialect())
コード例 #5
0
ファイル: settings.py プロジェクト: vanilladuck/nsot
ATTRIBUTE_NAME = re.compile(r"^[a-z][a-z0-9_]*$")

##############
# Interfaces #
##############

# The default format for displaying MAC addresses. This defaults to
# ":"-separated and expanded (e.g. '00:00:00:00:00:00')
MACADDRESS_DEFAULT_DIALECT = 'macaddress.mac_linux'

# The default speed in Mbps for newly device interfaces if not otherwise
# specified.
INTERFACE_DEFAULT_SPEED = 1000  # In Mbps (e.g. 1Gbps)

# Default MAC address ('00:00:00:00:00:00')
INTERFACE_DEFAULT_MAC = eui.EUI(0, dialect=macaddress.default_dialect())

# These are mappings to the formal integer types from SNMP IF-MIB::ifType. The
# types listed here are the most commonly found in the wild.
#
# *IF YOU ARE GOING TO MODIFY THIS*: This MUST be a list of 2-tuples of
# (iftype, name), where iftype is the unique ID for the IANA ifType SNMP MIB,
# and name is whatever name your little heart desires, but hopefully matches
# the legit description according to the MIB.
#
# Ref: https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib
INTERFACE_TYPE_CHOICES = (
    (6, 'ethernet'),       # for all ethernet-like interfaces
    (1, 'other'),          # none of the following
    (135, 'l2vlan'),       # Layer 2 Virtual LAN using 802.1Q
    (136, 'l3vlan'),       # Layer 3 Virtual LAN using IP
コード例 #6
0
##############
# Interfaces #
##############

# The default format for displaying MAC addresses. This defaults to
# ":"-separated and expanded (e.g. '00:00:00:00:00:00')
MACADDRESS_DEFAULT_DIALECT = 'macaddress.mac_linux'

# The default speed in Mbps for newly device interfaces if not otherwise
# specified.
INTERFACE_DEFAULT_SPEED = 1000  # In Mbps (e.g. 1Gbps)

# Default MAC address ('00:00:00:00:00:00')
INTERFACE_DEFAULT_MAC = eui.EUI(0,
                                dialect=macaddress.default_dialect(),
                                version=48)

# These are mappings to the formal integer types from SNMP IF-MIB::ifType. The
# types listed here are the most commonly found in the wild.
#
# *IF YOU ARE GOING TO MODIFY THIS*: This MUST be a list of 2-tuples of
# (iftype, name), where iftype is the unique ID for the IANA ifType SNMP MIB,
# and name is whatever name your little heart desires, but hopefully matches
# the legit description according to the MIB.
#
# Ref: https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib
INTERFACE_TYPE_CHOICES = (
    (6, 'ethernet'),  # for all ethernet-like interfaces
    (1, 'other'),  # none of the following
    (135, 'l2vlan'),  # Layer 2 Virtual LAN using 802.1Q
コード例 #7
0
ファイル: settings.py プロジェクト: dropbox/nsot
##############
# Interfaces #
##############

# The default format for displaying MAC addresses. This defaults to
# ":"-separated and expanded (e.g. '00:00:00:00:00:00')
MACADDRESS_DEFAULT_DIALECT = 'macaddress.mac_linux'

# The default speed in Mbps for newly device interfaces if not otherwise
# specified.
INTERFACE_DEFAULT_SPEED = 1000  # In Mbps (e.g. 1Gbps)

# Default MAC address ('00:00:00:00:00:00')
INTERFACE_DEFAULT_MAC = eui.EUI(
    0, dialect=macaddress.default_dialect(), version=48
)

# These are mappings to the formal integer types from SNMP IF-MIB::ifType. The
# types listed here are the most commonly found in the wild.
#
# *IF YOU ARE GOING TO MODIFY THIS*: This MUST be a list of 2-tuples of
# (iftype, name), where iftype is the unique ID for the IANA ifType SNMP MIB,
# and name is whatever name your little heart desires, but hopefully matches
# the legit description according to the MIB.
#
# Ref: https://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib
INTERFACE_TYPE_CHOICES = (
    (6, 'ethernet'),       # for all ethernet-like interfaces
    (1, 'other'),          # none of the following
    (135, 'l2vlan'),       # Layer 2 Virtual LAN using 802.1Q