-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
------------------ * [fix] Intf.all_names() > mgmt0 * [new] intf_name_map.py long_to_shorts
- Loading branch information
vprusakovs
committed
Jan 24, 2023
1 parent
3c1c672
commit b64e864
Showing
14 changed files
with
323 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,13 +34,13 @@ or install the package from github.com release | |
|
||
.. code:: bash | ||
pip install https://github.com/vladimirs-git/netports/archive/refs/tags/0.7.2.tar.gz | ||
pip install https://github.com/vladimirs-git/netports/archive/refs/tags/0.7.3.tar.gz | ||
or install the package from github.com repository | ||
|
||
.. code:: bash | ||
pip install git+https://github.com/vladimirs-git/[email protected].2 | ||
pip install git+https://github.com/vladimirs-git/[email protected].3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ | |
from netports.range import Range | ||
from netports.tcp import stcp, itcp | ||
from netports.vlan import ivlan, svlan | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
"""Interface name mapping""" | ||
from netports.types_ import DStr | ||
from netports.types_ import DStr, DLStr | ||
|
||
long_to_short: DStr = { | ||
# sorted ethernet | ||
"FastEthernet": "Fa", | ||
"FortyGigabitEthernet": "Fo", | ||
"GigabitEthernet": "Gi", | ||
"HundredGigabitEthernet": "Hu", | ||
"TenGigabitEthernet": "Te", | ||
"TwoGigabitEthernet": "Two", | ||
"Wlan-GigabitEthernet": "Wl-Gi", | ||
"Ethernet": "Eth", | ||
# sorted tunnel | ||
"Tunnel-ip": "Tu", | ||
"Tunnel": "Tu", | ||
# frequently used | ||
"Port-channel": "Po", | ||
"Loopback": "Lo", | ||
"Vlan": "Vl", | ||
# other | ||
"ATM": "At", | ||
"EOBC": "EO", | ||
"Fddi": "FD", | ||
"MFR": "MFR", | ||
"Management": "Ma", | ||
"Multilink": "Mu", | ||
"POS": "PO", | ||
"Serial": "Se", | ||
"TwentyFiveGigE": "Twe", | ||
"Virtual-Access": "Vi", | ||
"Virtual-Template": "Vt", | ||
long_to_shorts: DLStr = { | ||
# ethernets | ||
"FastEthernet": ["Fa"], # Cisco IOS | ||
"FortyGigabitEthernet": ["Fo"], | ||
"GigabitEthernet": ["Gi"], # Cisco IOS | ||
"HundredGigabitEthernet": ["Hu"], | ||
"TenGigabitEthernet": ["Te"], # Cisco IOS | ||
"TwoGigabitEthernet": ["Two"], | ||
"Wlan-GigabitEthernet": ["Wl-Gi"], | ||
"Ethernet": ["Eth"], # Cisco NX-OS | ||
# other frequently used | ||
"Tunnel-ip": ["Tu"], # Cisco ASR9000 | ||
"Tunnel": ["Tu"], # Cisco IOS | ||
"Port-channel": ["Po"], # Cisco IOS | ||
"Loopback": ["Lo"], # Cisco IOS | ||
"Vlan": ["Vl", "V"], # Cisco IOS | ||
# other rear | ||
"ATM": ["At"], | ||
"EOBC": ["EO"], | ||
"Fddi": ["FD"], | ||
"MFR": ["MFR"], | ||
"Management": ["Ma"], | ||
"Multilink": ["Mu"], | ||
# "POS": ["PO"], # conflict with Port-channel | ||
"Serial": ["Se"], | ||
"TwentyFiveGigE": ["Twe"], | ||
"Virtual-Access": ["Vi"], | ||
"Virtual-Template": ["Vt"], | ||
} | ||
long_to_short = {k: ls[0] for k, ls in long_to_shorts.items()} | ||
long_to_short_lower: DStr = {k.lower(): v for k, v in long_to_short.items()} | ||
short_to_long: DStr = {v: k for k, v in long_to_short.items()} | ||
short_to_long_lower: DStr = {k.lower(): v for k, v in short_to_long.items()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "netports" | ||
version = "0.7.2" | ||
version = "0.7.3" | ||
authors = [{ name="Vladimir Prusakov", email="[email protected]" }] | ||
description = "Python tools for managing ranges of VLANs, TCP/UDP ports, IP protocols, Interfaces" | ||
readme = "README.rst" | ||
|
@@ -21,7 +21,7 @@ classifiers = [ | |
"Homepage" = "https://github.com/vladimirs-git/netports" | ||
"Repository" = "https://github.com/vladimirs-git/netports" | ||
"Bug Tracker" = "https://github.com/vladimirs-git/netports/issues" | ||
"Download URL" = "https://github.com/vladimirs-git/netports/archive/refs/tags/0.7.2.tar.gz" | ||
"Download URL" = "https://github.com/vladimirs-git/netports/archive/refs/tags/0.7.3.tar.gz" | ||
[tool.setuptools.packages.find] | ||
include = ["netports"] | ||
[tool.setuptools.package-data] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.