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

Add extensions for vtysh #1

Open
wants to merge 1 commit into
base: hh-master
Choose a base branch
from
Open

Conversation

Fredi-raspall
Copy link
Collaborator

Add very simple support for vtysh extensions. The approach is similar to FRR's modules, but much simpler. FRR's modules cannot be used straight away since vtysh does not follow the same pattern as protocol daemons. E.g. it does not call frr_init(). Extensions are loaded with --extension|-X in the cmd line and can be displayed with show vtysh extensions. Extensions are just like modules (some dynamically-loadable library) with entry point vtysh_extension. The code expects that the extension return 0 on success and !=0 otherwise, but vtysh will start regardless.

Add very simple support for vtysh extensions. The approach is
similar to FRR's modules, but much simpler. FRR's modules cannot
be used straight away since vtysh does not follow the same
pattern as protocol daemons. E.g. it does not call frr_init().
Extensions are loaded with --extension|-X in the cmd line and
can be displayed with "show vtysh extensions". Extensions are just
like modules (some dynamically-loadable library) with entry point
"vtysh_extension". The code expects that the extension return 0
on success and !=0 otherwise, but vtysh will start regardless.

Signed-off-by: Fredi Raspall <[email protected]>
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

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

This PR will make us use - and maintain - our own, modified fork of FRR. What are the alternatives, would there be a way to use these extensions without having to modify FRR itself? Or have you considered submitting these changes upstream?

@Fredi-raspall
Copy link
Collaborator Author

This PR will make us use - and maintain - our own, modified fork of FRR. What are the alternatives, would there be a way to use these extensions without having to modify FRR itself? Or have you considered submitting these changes upstream?

I don't think there's a way to load our extensions without modifying FRR. We'll probably need to keep our own fork anyway. That being said, this patch is intentionally generic (and short) so that either option works. I thought of submitting the changes upstream, but I am not sure whether the community would be interested in something like this. I was going to defer that decision for a while....

@qmonnet
Copy link
Member

qmonnet commented Jan 23, 2025

I thought of submitting the changes upstream, but I am not sure whether the community would be interested in something like this.

Why not? There's probably someone else with a similar use case somewhere out there. Or maybe the maintainers have suggestions on how to make this work without patching FRR. I know it takes time to contribute upstream, but in return we get a smaller burden on our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants