1
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* NetworkManager Applet -- allow user control over networking
4
* Dan Williams <dcbw@redhat.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program; if not, write to the Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
* Copyright 2007 - 2014 Red Hat, Inc.
23
#ifndef WIRELESS_SECURITY_H
24
#define WIRELESS_SECURITY_H
28
#define WIRELESS_TYPE_SECURITY (wireless_security_get_type ())
30
typedef struct _WirelessSecurity WirelessSecurity;
32
typedef void (*WSChangedFunc) (WirelessSecurity *sec, gpointer user_data);
34
typedef void (*WSAddToSizeGroupFunc) (WirelessSecurity *sec, GtkSizeGroup *group);
35
typedef void (*WSFillConnectionFunc) (WirelessSecurity *sec, NMConnection *connection);
36
typedef void (*WSUpdateSecretsFunc) (WirelessSecurity *sec, NMConnection *connection);
37
typedef void (*WSDestroyFunc) (WirelessSecurity *sec);
38
typedef gboolean (*WSValidateFunc) (WirelessSecurity *sec, GError **error);
39
typedef GtkWidget * (*WSNagUserFunc) (WirelessSecurity *sec);
41
struct _WirelessSecurity {
46
WSChangedFunc changed_notify;
47
gpointer changed_notify_data;
48
const char *default_field;
49
gboolean adhoc_compatible;
50
gboolean hotspot_compatible;
52
char *username, *password;
53
gboolean always_ask, show_password;
55
WSAddToSizeGroupFunc add_to_size_group;
56
WSFillConnectionFunc fill_connection;
57
WSUpdateSecretsFunc update_secrets;
58
WSValidateFunc validate;
59
WSDestroyFunc destroy;
62
#define WIRELESS_SECURITY(x) ((WirelessSecurity *) x)
65
GtkWidget *wireless_security_get_widget (WirelessSecurity *sec);
67
void wireless_security_set_changed_notify (WirelessSecurity *sec,
71
gboolean wireless_security_validate (WirelessSecurity *sec, GError **error);
73
void wireless_security_add_to_size_group (WirelessSecurity *sec,
76
void wireless_security_fill_connection (WirelessSecurity *sec,
77
NMConnection *connection);
79
void wireless_security_update_secrets (WirelessSecurity *sec,
80
NMConnection *connection);
82
gboolean wireless_security_adhoc_compatible (WirelessSecurity *sec);
84
gboolean wireless_security_hotspot_compatible (WirelessSecurity *sec);
86
void wireless_security_set_userpass (WirelessSecurity *sec,
90
gboolean show_password);
91
void wireless_security_set_userpass_802_1x (WirelessSecurity *sec,
92
NMConnection *connection);
94
WirelessSecurity *wireless_security_ref (WirelessSecurity *sec);
96
void wireless_security_unref (WirelessSecurity *sec);
98
GType wireless_security_get_type (void);
100
/* Below for internal use only */
102
#include "ws-wep-key.h"
103
#include "ws-wpa-psk.h"
105
#include "ws-wpa-eap.h"
106
#include "ws-dynamic-wep.h"
108
WirelessSecurity *wireless_security_init (gsize obj_size,
109
WSValidateFunc validate,
110
WSAddToSizeGroupFunc add_to_size_group,
111
WSFillConnectionFunc fill_connection,
112
WSUpdateSecretsFunc update_secrets,
113
WSDestroyFunc destroy,
114
const char *ui_resource,
115
const char *ui_widget_name,
116
const char *default_field);
118
void wireless_security_changed_cb (GtkWidget *entry, gpointer user_data);
120
void wireless_security_clear_ciphers (NMConnection *connection);
122
#define AUTH_NAME_COLUMN 0
123
#define AUTH_METHOD_COLUMN 1
125
GtkWidget *ws_802_1x_auth_combo_init (WirelessSecurity *sec,
126
const char *combo_name,
127
const char *combo_label,
128
GCallback auth_combo_changed_cb,
129
NMConnection *connection,
131
gboolean secrets_only);
133
void ws_802_1x_auth_combo_changed (GtkWidget *combo,
134
WirelessSecurity *sec,
135
const char *vbox_name,
136
GtkSizeGroup *size_group);
138
gboolean ws_802_1x_validate (WirelessSecurity *sec, const char *combo_name, GError **error);
140
void ws_802_1x_add_to_size_group (WirelessSecurity *sec,
141
GtkSizeGroup *size_group,
142
const char *label_name,
143
const char *combo_name);
145
void ws_802_1x_fill_connection (WirelessSecurity *sec,
146
const char *combo_name,
147
NMConnection *connection);
149
void ws_802_1x_update_secrets (WirelessSecurity *sec,
150
const char *combo_name,
151
NMConnection *connection);
153
#endif /* WIRELESS_SECURITY_H */