Skip to content

Fix for ASN functions#339

Merged
itdependsnetworks merged 4 commits intonetworktocode:developfrom
mzbroch:develop-asdot
Aug 29, 2023
Merged

Fix for ASN functions#339
itdependsnetworks merged 4 commits intonetworktocode:developfrom
mzbroch:develop-asdot

Conversation

@mzbroch
Copy link
Contributor

@mzbroch mzbroch commented Aug 10, 2023

Use proper names with regards to RFC :


   asplain
      refers to a syntax scheme of representing all AS numbers using
      decimal integer notation.  Using asplain notation, an AS number of
      value 65526 would be represented as the string "65526" and an AS
      number of value 65546 would be represented as the string "65546".

   asdot+
      refers to a syntax scheme of representing all AS numbers using a
      notation of two integer values joined by a period character: <high
      order 16-bit value in decimal>.<low order 16-bit value in
      decimal>.  Using asdot+ notation, an AS number of value 65526
      would be represented as the string "0.65526" and an AS number of
      value 65546 would be represented as the string "1.10".

   asdot
      refers to a syntax scheme of representing AS number values less
      than 65536 using asplain notation and representing AS number
      values equal to or greater than 65536 using asdot+ notation.
      Using asdot notation, an AS number of value 65526 would be
      represented as the string "65526" and an AS number of value 65546
      would be represented as the string "1.10".

@itdependsnetworks
Copy link
Contributor

We would have to deprecate, and wait until 2.0 to release.

@mzbroch
Copy link
Contributor Author

mzbroch commented Aug 10, 2023

We would have to deprecate, and wait until 2.0 to release.

Still, there is an existing issue with the doc or with the overall intention:

def int_to_asn(asn_int: int) -> str:
     """Convert integer to standardized asplain notation for BGP ASN.
     Args:
         asn_int: Integer value of the BGP ASN.
     Returns:
         `asplain` notated BGP ASN as a string.

the function transforms to asdot, not to the asplain.

@itdependsnetworks
Copy link
Contributor

wait, nvm, this hasn't been released yet.

@jeffkala
Copy link
Collaborator

Validated only asn_to_int was the only function released so far. So we should be good.

@jeffkala
Copy link
Collaborator

Also get pytest passing.

@qduk
Copy link
Collaborator

qduk commented Aug 14, 2023

@mzbroch Can you revert the table formatting? While it does objectively look better, we believe that's causing the failed test.

@itdependsnetworks itdependsnetworks merged commit 1bed7bc into networktocode:develop Aug 29, 2023
michalis1 pushed a commit to michalis1/netutils that referenced this pull request Feb 2, 2026
* Fixing int to asdot notation

* Fixing int to asdot notation

* Documentation updates for int_to_asdot

* Rever table formatting in include_jinja_list.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants