Skip to content
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

Merged
merged 3 commits into from
Jun 13, 2019

Conversation

donaldsharp
Copy link
Member

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

@LabN-CI

This comment has been minimized.

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, 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.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 4439, comparing to Git base SHA 32e4ce5

No Changes in Static Analysis warnings compared to base

11 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-7913/artifact/shared/static_analysis/index.html

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)
Copy link
Member

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....

Copy link
Member

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)
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

@LabN-CI
Copy link
Collaborator

LabN-CI commented Jun 2, 2019

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/4439 e02772a
Date 06/02/2019
Start 14:10:55
Finish 14:33:33
Run-Time 22:38
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-06-02-14:10:55.txt
Log autoscript-2019-06-02-14:11:55.log.bz2
Memory 424 434 360

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)
Copy link
Member

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

@LabN-CI

This comment has been minimized.

@louberger
Copy link
Member

          iana_afi_t *pkt_afi,
          ^
bgpd/bgpd.h:1726:10: error: unknown type name 'iana_afi_t'
          iana_afi_t *pkt_afi,
          ^
./bgpd/bgpd.h:1727:10: error: unknown type name 'iana_safi_t'
          iana_safi_t *pkt_safi);
          ^
./bgpd/bgpd.h:1727:10: error: unknown type name 'iana_safi_t'
          iana_safi_t *pkt_safi);
          ^
./bgpd/bgpd.h:1727:10: error: unknown type name 'iana_safi_t'
          iana_safi_t *pkt_safi);
          ^
./bgpd/bgpd.h:1727:10: error: unknown type name 'iana_safi_t'
          iana_safi_t *pkt_safi);
          ^
bgpd/bgpd.h:1727:10: error: unknown type name 'iana_safi_t'
          iana_safi_t *pkt_safi);
          ^
make[1]: *** [bgpd/bgp_filter.o] Error 1
make[1]: *** [bgpd/bgp_keepalives.o] Error 1
make[1]: *** [bgpd/bgp_flowspec_util.o] Error 1
make[1]: *** [bgpd/bgp_ecommunity.o] Error 1
make[1]: *** [bgpd/bgp_mac.o] Error 1
make[1]: *** [bgpd/bgp_label.o] Error 1
make[1]: *** [bgpd/bgp_fsm.o] Error 1
make[1]: *** [bgpd/bgp_evpn.o] Error 1

Copy link
Member

@louberger louberger left a 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

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, 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.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for iana_afi.h | 8 issues
===============================================
WARNING: do not add new typedefs
#33: FILE: /tmp/f1-30467/iana_afi.h:33:
+typedef enum {

WARNING: do not add new typedefs
#40: FILE: /tmp/f1-30467/iana_afi.h:40:
+typedef enum {

CLANG Static Analyzer Summary

  • Github Pull Request 4439, comparing to Git base SHA 32e4ce5

No Changes in Static Analysis warnings compared to base

11 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-7919/artifact/shared/static_analysis/index.html

@LabN-CI

This comment has been minimized.

@donaldsharp
Copy link
Member Author

@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?

@louberger
Copy link
Member

no idea why seeing above compile issue, will rerun and see if still have issue

@LabN-CI

This comment has been minimized.

@LabN-CI

This comment has been minimized.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Jun 12, 2019

🚧 Basic BGPD CI results: Partial FAILURE, 1 tests failed

Results table
_ _
Result SUCCESS git merge/4439 17136bf
Date 06/12/2019
Start 13:42:00
Finish 14:04:23
Run-Time 22:23
Total 1813
Pass 1812
Fail 1
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-06-12-13:42:00.txt
Log autoscript-2019-06-12-13:43:03.log.bz2
Memory 423 431 360

For details, please contact louberger

@louberger
Copy link
Member

ci failure indicates a timing change - suspect this is a test run artefact, rerunning to confirm.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Jun 13, 2019

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/4439 17136bf
Date 06/13/2019
Start 15:05:48
Finish 15:28:04
Run-Time 22:16
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-06-13-15:05:48.txt
Log autoscript-2019-06-13-15:06:55.log.bz2
Memory 413 404 360

For details, please contact louberger

@eqvinox eqvinox merged commit 0688fd8 into FRRouting:master Jun 13, 2019
@donaldsharp donaldsharp deleted the bgp_debugs branch December 9, 2019 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants