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 standalone mptcpd plugin example. #56

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ossama-othman
Copy link
Member

Add a standalone (out-of-tree) mptcpd no-op plugin example to be used as a reference for mptcpd plugin developers.

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.
@ossama-othman ossama-othman added the enhancement New feature or request label Nov 19, 2019
@ossama-othman ossama-othman added this to the Beta Release milestone Nov 19, 2019
@ossama-othman ossama-othman self-assigned this Nov 19, 2019
Copy link
Member

@mjmartineau mjmartineau left a 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 :) )

plugin_LTLIBRARIES = foo.la

foo_la_SOURCES = foo.c
foo_la_CFLAGS = $(MPTCPD_PLUGIN_CFLAGS)
Copy link
Member

Choose a reason for hiding this comment

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

Should be $(MPTCPD_CFLAGS)

Copy link
Member

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!

@ossama-othman
Copy link
Member Author

@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 Makefiles:

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 configure script help output mentions several besides the usual preprocessor, compiler and linker flags that could be used for building against an mptcpd source tree:

  PKG_CONFIG  path to pkg-config utility
  PKG_CONFIG_PATH
              directories to add to pkg-config's search path
  PKG_CONFIG_LIBDIR
              path overriding pkg-config's built-in search path
  MPTCPD_CFLAGS
              C compiler flags for MPTCPD, overriding pkg-config
  MPTCPD_LIBS linker flags for MPTCPD, overriding pkg-config
  MPTCPD_PLUGINDIR
              value of plugindir for mptcpd, overriding pkg-config

ELL related variables would normally be pulled in through the mptcpd variables obtained through pkg-config, which is why they aren't listed in the sample plugin's configure script help output.

@ossama-othman
Copy link
Member Author

Getting mptcpd to pick up new installed plugin currently requires a restart of mptcpd. I'll document that in the plugins wiki, too.

@ossama-othman ossama-othman modified the milestones: Beta Release, 1.0 release Feb 11, 2020
@ossama-othman ossama-othman removed this from the 1.0 release milestone Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants