Files
NetworkManager/shared/nm-utils/nm-vpn-plugin-utils.h
Thomas Haller 5d55492bac shared: add "nm-utils/nm-vpn-plugin-utils.h"
This file is only used by plugins and copied between them.

It's purpose is to contain general utility functions that are
only relevant for implementing NetworkManager's VPN plugins.

In principle the utility functions could be part of libnm, however,
there are a few problems with that:
  - if they are part of libnm, adding and using a new utility function
    requires the plugin to bump the required libnm version. Since you
    usally can work around/reimplement utility functions, this results
    in not using the API from libnm, not adding the API to libnm,
    and reimplementing it over and over in the plugin.
  - plugins compile both against libnm and libnm-glib. Thus, either
    the utility function would also be needed in libnm-glib, or again,
    it is not usable by the plugin.

We must avoid that the utility functions diverge and no local
modifications to these files should be made in the plugin.
Instead, one special location of the utility functions shall be
extended and re-imported (copied) to the plugin as needed.

Add the files to NetworkManager's repository. Although they are not
needed for NetworkManager itself, they are a different API provided
by NetworkManager. An API that is reused and shared by copying the files
around.
2016-06-16 10:45:54 +02:00

43 lines
1.9 KiB
C

/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* Copyright 2016 Red Hat, Inc.
*/
#ifndef __NM_VPN_PLUGIN_UTILS_H__
#define __NM_VPN_PLUGIN_UTILS_H__
#include <NetworkManager.h>
typedef NMVpnEditor *(NMVpnPluginUtilsEditorFactory) (gpointer factory,
NMVpnEditorPlugin *editor_plugin,
NMConnection *connection,
gpointer user_data,
GError **error);
NMVpnEditor *nm_vpn_plugin_utils_load_editor (const char *module_name,
const char *factory_name,
NMVpnPluginUtilsEditorFactory editor_factory,
NMVpnEditorPlugin *editor_plugin,
NMConnection *connection,
gpointer user_data,
GError **error);
#endif /* __NM_VPN_PLUGIN_UTILS_H__ */