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

lib, zebra: Keep zebra on-rib-process script in frr.conf (backport #17160) #17261

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/frrscript.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ DEFINE_MTYPE_STATIC(LIB, SCRIPT, "Scripting");

struct frrscript_names_head frrscript_names_hash;

<<<<<<< HEAD
=======
void _lua_decode_noop(lua_State *L, ...) {}

void frrscript_names_config_write(struct vty *vty)
{
struct frrscript_names_entry *lua_script_entry;

frr_each (frrscript_names, &frrscript_names_hash, lua_script_entry)
if (lua_script_entry->script_name[0] != '\0')
vty_out(vty, "zebra on-rib-process script %s\n",
lua_script_entry->script_name);
}

>>>>>>> 1fe1f8d87c (lib, zebra: Keep `zebra on-rib-process script` in frr.conf)
/*
* Wrapper for frrscript_names_add
* Use this to register hook calls when a daemon starts up
Expand Down
2 changes: 2 additions & 0 deletions lib/frrscript.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ struct frrscript_names_entry {

extern struct frrscript_names_head frrscript_names_hash;

extern void frrscript_names_config_write(struct vty *vty);

int frrscript_names_hash_cmp(const struct frrscript_names_entry *snhe1,
const struct frrscript_names_entry *snhe2);
uint32_t frrscript_names_hash_key(const struct frrscript_names_entry *snhe);
Expand Down
4 changes: 4 additions & 0 deletions zebra/zebra_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -4017,6 +4017,10 @@ static int config_write_protocol(struct vty *vty)
if (!zebra_nhg_recursive_use_backups())
vty_out(vty, "no zebra nexthop resolve-via-backup\n");

#ifdef HAVE_SCRIPTING
frrscript_names_config_write(vty);
#endif

if (rnh_get_hide_backups())
vty_out(vty, "ip nht hide-backup-events\n");

Expand Down
Loading