-
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
*: move common NHT update decoding bits into lib/ #14834
Changes from all commits
b951e59
20007eb
ac18d56
94fc9c0
088250f
53a82c1
f115dc5
409a693
03c4375
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,6 +293,8 @@ struct zapi_cap { | |
typedef int (zclient_handler)(ZAPI_CALLBACK_ARGS); | ||
/* clang-format on */ | ||
|
||
struct zapi_route; | ||
|
||
/* Structure for the zebra client. */ | ||
struct zclient { | ||
/* The thread master we schedule ourselves on */ | ||
|
@@ -348,6 +350,19 @@ struct zclient { | |
void (*zebra_connected)(struct zclient *); | ||
void (*zebra_capabilities)(struct zclient_capabilities *cap); | ||
|
||
/* | ||
* match -> is the prefix that the calling daemon asked to be matched | ||
* against. | ||
* nhr->prefix -> is the actual prefix that was matched against in the | ||
* rib itself. | ||
* | ||
* This distinction is made because a LPM can be made if there is a | ||
* covering route. This way the upper level protocol can make a | ||
* decision point about whether or not it wants to use the match or not. | ||
*/ | ||
void (*nexthop_update)(struct vrf *vrf, struct prefix *match, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'nexthop_update' seems a bit ambiguous - now that we have nexthop-groups etc. could it be 'nht_update' or 'rnh_update' ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to rename it, I just "inherited" the name from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I don't think |
||
struct zapi_route *nhr); | ||
|
||
int (*handle_error)(enum zebra_error_types error); | ||
|
||
/* | ||
|
@@ -1123,18 +1138,6 @@ int zapi_nexthop_from_nexthop(struct zapi_nexthop *znh, | |
const struct nexthop *nh); | ||
int zapi_backup_nexthop_from_nexthop(struct zapi_nexthop *znh, | ||
const struct nexthop *nh); | ||
/* | ||
* match -> is the prefix that the calling daemon asked to be matched | ||
* against. | ||
* nhr->prefix -> is the actual prefix that was matched against in the | ||
* rib itself. | ||
* | ||
* This distinction is made because a LPM can be made if there is a | ||
* covering route. This way the upper level protocol can make a decision | ||
* point about whether or not it wants to use the match or not. | ||
*/ | ||
extern bool zapi_nexthop_update_decode(struct stream *s, struct prefix *match, | ||
struct zapi_route *nhr); | ||
const char *zapi_nexthop2str(const struct zapi_nexthop *znh, char *buf, | ||
int bufsize); | ||
|
||
|
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.
can 'match' and 'nhr' be 'const'?
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.
I tried that and it had a trail of fallout (from other functions taking non-const args) behind it, such that I didn't want to shove into this PR to keep it clean-ish 😞