Conversation
|
Forgot to exclude the .clang-format file in my commits, please ignore the file. |
alistairking
left a comment
There was a problem hiding this comment.
overall the structure looks great.
i've left a few comments about some problems that are repeated elsewhere, but you should be able to generalize and fix other occurrences.
lib/openbmp/parsebgp_openbmp.c
Outdated
There was a problem hiding this comment.
i don't think you just want a printf here.
this code was originally supposed to allow the caller to handle either openbmp-formatted data or raw BMP.
i'm not sure how to support that use case in the libparsebgp model. we could just try parsing the BMP content at this stage, but then we'd need a flag in the openbmp message structure that indicates that only the bmp field is valid. i guess that could work.
lib/openbmp/parsebgp_openbmp.c
Outdated
There was a problem hiding this comment.
let's not support the v1 openbmp headers.
lib/openbmp/parsebgp_openbmp.c
Outdated
There was a problem hiding this comment.
please don't use printf's. there are a bunch of utility macros for handling these kinds of parsing failures. in this case you probably just want to return PARSEBGP_PARTIAL_MSG without any kind of logging since this will be a normal failure in the case that the caller hasn't buffered a full message.
lib/openbmp/parsebgp_openbmp.c
Outdated
There was a problem hiding this comment.
return codes should be one of the parsebgp_error_t values
lib/openbmp/parsebgp_openbmp.c
Outdated
There was a problem hiding this comment.
i think you should be returning an error here, no?
this is probably an instance where you want to use one of the INVALID message macros
also removed printf statements.
|
@alistairking I have made the corresponding changes for all comments above. Please review again :) |
Hello,
I added OpenBMP parsing feature to libparsebgp, and it parses messages from raw_bmp topic.
The parsing procedures are copied from libbgpstream.