BGP ASNs¶
netutils.asn
¶
Functions for working with BGP ASNs.
asn_to_int(asplain)
¶
Convert AS Number to standardized asplain notation as an integer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asplain |
str
|
An |
required |
Returns:
Type | Description |
---|---|
int
|
Integer value within of the given asplain value provided. |
Examples:
>>> from netutils.asn import asn_to_int
>>> asn_to_int("65000")
65000
>>> asn_to_int("65000.111")
4259840111
>>>
Source code in netutils/asn.py
int_to_asdot(asn_int)
¶
Convert integer to standardized asdot notation for BGP ASN.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asn_int |
int
|
Integer value of the BGP ASN. |
required |
Returns:
Type | Description |
---|---|
str
|
|
Examples:
>>> from netutils.asn import int_to_asdot
>>> int_to_asdot(65000)
'65000'
>>> int_to_asdot(4259840111)
'65000.111'
>>>