-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing strings #4439
Conversation
This comment has been minimized.
This comment has been minimized.
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-7913/ This is a comment from an automated CI system. CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base11 Static Analyzer issues remaining.See details at |
lib/zebra.h
Outdated
@@ -512,6 +512,26 @@ typedef uint32_t route_tag_t; | |||
#define ROUTE_TAG_MAX UINT32_MAX | |||
#define ROUTE_TAG_PRI PRIu32 | |||
|
|||
static inline const char *iana_afi2str(iana_afi_t afi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this function materially differ from aft2str, bgp_afi and iana_afi should be the same....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps have the new function map to the internal AFI value and call afi2str?
lib/zebra.h
Outdated
@@ -540,6 +560,30 @@ static inline iana_afi_t afi_int2iana(afi_t afi) | |||
} | |||
} | |||
|
|||
static inline const char *iana_safi2str(iana_safi_t safi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically the same question, why not use/merge with safi2str
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
The IPMR and IP6MR values have no actual legal representation and we do not sue them at all. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Modify the code such that we can auto turn the iana values of afi and safi to pleasant to read strings. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The iana_afi_t and iana_safi_t were being created in zebra.h and zebra.h is a bit of a dumping ground. When the iana_afi2str and iana_safi2str functions were created, it was correctly pointed out that we should just use the internal afi_t and safi_t 2str functions but to do that we would need to include prefix.h in zebra.h. Which really is not the right thing to do. This tells us that we need to break out this code into it's own header. Move to iana_afi.h the enums and specific functions and remove from zebra. Convert to using the afi2str and safi2str functions. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
IANA_SAFI_FLOWSPEC = 133 | ||
} iana_safi_t; | ||
|
||
static inline afi_t afi_iana2int(iana_afi_t afi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2int might confuse some (integer vs internal), but don't have a better suggestion
This comment has been minimized.
This comment has been minimized.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ready once ci passes
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-7919/ This is a comment from an automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings
CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base11 Static Analyzer issues remaining.See details at |
This comment has been minimized.
This comment has been minimized.
@louberger -> with the addition of a new header and moving definitions out of zebra.h do you need to update your private code in order for it to compile? |
no idea why seeing above compile issue, will rerun and see if still have issue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚧 Basic BGPD CI results: Partial FAILURE, 1 tests failedResults table
For details, please contact louberger |
ci failure indicates a timing change - suspect this is a test run artefact, rerunning to confirm. |
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Modify the code such that we can auto turn the iana values of afi
and safi to pleasant to read strings.
Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com