-
Notifications
You must be signed in to change notification settings - Fork 35
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 standalone mptcpd plugin example. #56
base: main
Are you sure you want to change the base?
Conversation
Change the mptcpd default plugin directory pkg-config variable from "pkglibdir" to "plugindir" to reduce potential confusion for mptcpd plugin developers.
Add a standalone (out-of-tree) mptcpd no-op plugin example to be used as a reference for mptcpd plugin developers.
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.
To get this to build from a non-installed mptcpd, I had to make the Makefile.am change and export these variables:
MPTCPD_CFLAGS='-I/path/to/mptcpd/include/ -I/path/to/ell/'
MPTCPD_LIBS='-L/path/to/mptcpd/lib -lmptcpd'
MPTCPD_PLUGINDIR=/path/to/mptcpd/lib/
configure
only suggested setting MPTCPD_CFLAGS
and MPTCPD_LIBS
.
It would help to have some documentation for:
- Building without an installed mptcpd, including environment variable examples
- Some instructions for what to do. (Copy template to a separate repo? / How to get mptcpd to load the plugin / Be sure to search-and-replace all the foos :) )
examples/plugins/Makefile.am
Outdated
plugin_LTLIBRARIES = foo.la | ||
|
||
foo_la_SOURCES = foo.c | ||
foo_la_CFLAGS = $(MPTCPD_PLUGIN_CFLAGS) |
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.
Should be $(MPTCPD_CFLAGS)
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.
You're a step ahead of me on this fix!
@mjmartineau I personally don't think it's good to build against the source tree of a dependency, but here's one way to build the sample plugin against a source tree without modifying ELL_DIR=/path/to/ell \
MPTCPD_DIR=/path/to/mptcpd \
PKG_CONFIG_PATH=$ELL_DIR/ell:$MPTCPD_DIR/lib \
CPPFLAGS="-I$MPTCPD_DIR/include -I$ELL_DIR" \
LDFLAGS="-L$MPTCPD_DIR/lib -L$ELL_DIR/ell" \
./configure Regarding the environment variables, the sample plugin's
ELL related variables would normally be pulled in through the mptcpd variables obtained through |
Getting mptcpd to pick up new installed plugin currently requires a restart of mptcpd. I'll document that in the plugins wiki, too. |
Add a standalone (out-of-tree) mptcpd no-op plugin example to be used as a reference for mptcpd plugin developers.