1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* NetworkManager -- Network link manager
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Copyright (C) 2011 Thomas Bechtold <thomasbechtold@jpberlin.de>
21 #ifndef __NETWORKMANAGER_CONNECTIVITY_H__
22 #define __NETWORKMANAGER_CONNECTIVITY_H__
25 #include "nm-default.h"
26 #include "nm-dbus-interface.h"
28 #define NM_TYPE_CONNECTIVITY (nm_connectivity_get_type ())
29 #define NM_CONNECTIVITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTIVITY, NMConnectivity))
30 #define NM_CONNECTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CONNECTIVITY, NMConnectivityClass))
31 #define NM_IS_CONNECTIVITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTIVITY))
32 #define NM_IS_CONNECTIVITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_CONNECTIVITY))
33 #define NM_CONNECTIVITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONNECTIVITY, NMConnectivityClass))
36 #define NM_CONNECTIVITY_URI "uri"
37 #define NM_CONNECTIVITY_INTERVAL "interval"
38 #define NM_CONNECTIVITY_RESPONSE "response"
39 #define NM_CONNECTIVITY_STATE "state"
41 struct _NMConnectivity {
47 } NMConnectivityClass;
49 GType nm_connectivity_get_type (void);
51 const char *nm_connectivity_state_to_string (NMConnectivityState state);
53 NMConnectivity *nm_connectivity_new (const char *uri,
55 const char *response);
57 void nm_connectivity_set_online (NMConnectivity *self,
60 NMConnectivityState nm_connectivity_get_state (NMConnectivity *self);
62 void nm_connectivity_check_async (NMConnectivity *self,
63 GAsyncReadyCallback callback,
65 NMConnectivityState nm_connectivity_check_finish (NMConnectivity *self,
69 #endif /* __NETWORKMANAGER_CONNECTIVITY_H__ */