mptcpd icon indicating copy to clipboard operation
mptcpd copied to clipboard

Add config file access for plugins

Open mjmartineau opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. I'm working on the ndiffports plugin, and need a way to configure the 'n' (number of ports)

Describe the solution you'd like It would be ideal to have an API exposed to plugins where they could query for config values that are stored in mptcpd.conf, without being able to modify the in-memory copy of the mptcpd core settings. Some wrappers around l_settings_*() calls is probably sufficient.

It's not critical to deny plugins access to any settings (they are in the same memory space as the core, after all), but it does make sense to make it easy to retrieve plugin settings and hard to accidentally corrupt core settings.

Describe alternatives you've considered Creating a whole separate config parsing infrastructure using l_settings. This would duplicate a lot of core configuration handling code, and different plugins could diverge in how they handled config files.

mjmartineau avatar Jun 16 '22 18:06 mjmartineau

Does #210 solve this issue?

It does not allow plugins to store config values in mptcpd.conf, but it allows plugins to have their own configuration file.

joaomeira26 avatar Jun 21 '22 09:06 joaomeira26