Commit 34c087c9 authored by Beniamino Galvani's avatar Beniamino Galvani

editor: add wireguard support

parent 959dfdc7
......@@ -361,6 +361,8 @@ connection_editor_hc_real = \
src/connection-editor/page-vlan.c \
src/connection-editor/page-dcb.c \
src/connection-editor/page-dcb.h \
src/connection-editor/page-wireguard.h \
src/connection-editor/page-wireguard.c \
src/connection-editor/vpn-helpers.h \
src/connection-editor/vpn-helpers.c \
src/connection-editor/ip4-routes-dialog.h \
......@@ -445,6 +447,7 @@ EXTRA_DIST += \
src/connection-editor/ce-page-vlan.ui \
src/connection-editor/ce-page-wifi-security.ui \
src/connection-editor/ce-page-wifi.ui \
src/connection-editor/ce-page-wireguard.ui \
src/connection-editor/ce-ppp-auth-methods.ui \
src/connection-editor/gtk/menus.ui \
src/connection-editor/nm-connection-editor.ui \
......
This diff is collapsed.
......@@ -27,6 +27,7 @@
<file preprocess="xml-stripblanks">ce-page-vlan.ui</file>
<file preprocess="xml-stripblanks">ce-page-wifi-security.ui</file>
<file preprocess="xml-stripblanks">ce-page-wifi.ui</file>
<file preprocess="xml-stripblanks">ce-page-wireguard.ui</file>
<file preprocess="xml-stripblanks">ce-ppp-auth-methods.ui</file>
<file preprocess="xml-stripblanks">gtk/menus.ui</file>
</gresource>
......
......@@ -23,6 +23,7 @@
#include "page-bridge.h"
#include "page-vlan.h"
#include "page-vpn.h"
#include "page-wireguard.h"
#include "vpn-helpers.h"
#include "nm-utils/nm-vpn-editor-plugin-call.h"
......@@ -106,6 +107,7 @@ get_connection_type_list (void)
add_type_data_virtual (array, _("VLAN"), vlan_connection_new, NM_TYPE_SETTING_VLAN);
add_type_data_virtual (array, _("IP tunnel"), ip_tunnel_connection_new, NM_TYPE_SETTING_IP_TUNNEL);
add_type_data_virtual (array, _("MACsec"), macsec_connection_new, NM_TYPE_SETTING_MACSEC);
add_type_data_virtual (array, _("WireGuard"), wireguard_connection_new, NM_TYPE_SETTING_WIREGUARD);
add_type_data_virtual (array, _("VPN"), vpn_connection_new, NM_TYPE_SETTING_VPN);
......
......@@ -33,6 +33,7 @@ sources = files(
'page-vpn.c',
'page-wifi.c',
'page-wifi-security.c',
'page-wireguard.c',
'ppp-auth-methods-dialog.c',
'vpn-helpers.c'
)
......@@ -62,6 +63,7 @@ resource_data = files(
'ce-page-vlan.ui',
'ce-page-wifi-security.ui',
'ce-page-wifi.ui',
'ce-page-wireguard.ui',
'ce-ppp-auth-methods.ui',
'gtk/menus.ui',
'nm-connection-editor.ui',
......
......@@ -48,6 +48,7 @@
#include "page-vlan.h"
#include "page-dcb.h"
#include "page-macsec.h"
#include "page-wireguard.h"
#include "ce-polkit-button.h"
#include "vpn-helpers.h"
#include "eap-method.h"
......@@ -1037,6 +1038,9 @@ nm_connection_editor_set_connection (NMConnectionEditor *editor,
goto out;
if (!add_page (editor, ce_page_8021x_security_new, editor->connection, error))
goto out;
} else if (!strcmp (connection_type, NM_SETTING_WIREGUARD_SETTING_NAME)) {
if (!add_page (editor, ce_page_wireguard_new, editor->connection, error))
goto out;
} else {
g_warning ("Unhandled setting type '%s'", connection_type);
}
......
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0+
/* NetworkManager Connection editor -- Connection editor for NetworkManager
*
* Copyright 2020 Red Hat, Inc.
*/
#ifndef __PAGE_WIREGUARD_H__
#define __PAGE_WIREGUARD_H__
#include <glib.h>
#include <glib-object.h>
#include "ce-page.h"
#define CE_TYPE_PAGE_WIREGUARD (ce_page_wireguard_get_type ())
#define CE_PAGE_WIREGUARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CE_TYPE_PAGE_WIREGUARD, CEPageWireGuard))
#define CE_PAGE_WIREGUARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CE_TYPE_PAGE_WIREGUARD, CEPageWireGuardClass))
#define CE_IS_PAGE_WIREGUARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CE_TYPE_PAGE_WIREGUARD))
#define CE_IS_PAGE_WIREGUARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CE_TYPE_PAGE_WIREGUARD))
#define CE_PAGE_WIREGUARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CE_TYPE_PAGE_WIREGUARD, CEPageWireGuardClass))
typedef struct {
CEPage parent;
} CEPageWireGuard;
typedef struct {
CEPageClass parent;
} CEPageWireGuardClass;
GType ce_page_wireguard_get_type (void);
CEPage *ce_page_wireguard_new (NMConnectionEditor *editor,
NMConnection *connection,
GtkWindow *parent,
NMClient *client,
const char **out_secrets_setting_name,
GError **error);
void wireguard_connection_new (FUNC_TAG_PAGE_NEW_CONNECTION_IMPL,
GtkWindow *parent,
const char *detail,
gpointer detail_data,
NMConnection *connection,
NMClient *client,
PageNewConnectionResultFunc callback,
gpointer user_data);
#endif /* __PAGE_WIREGUARD_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment