ip6: fail activation if addrconf fails to start
[NetworkManager.git] / src / ip6-manager / nm-ip6-manager.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* nm-ip6-manager.c - Handle IPv6 address configuration for NetworkManager
3  *
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, or (at your option)
7  * any later version.
8  *
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.
13  *
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.
17  *
18  * Copyright (C) 2009 - 2010 Red Hat, Inc.
19  */
20
21 #ifndef NM_IP6_MANAGER_H
22 #define NM_IP6_MANAGER_H
23
24 #include <glib.h>
25 #include <glib-object.h>
26
27 #include <nm-setting-ip6-config.h>
28
29 #include "nm-ip6-config.h"
30
31 #define NM_TYPE_IP6_MANAGER            (nm_ip6_manager_get_type ())
32 #define NM_IP6_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IP6_MANAGER, NMIP6Manager))
33 #define NM_IP6_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_IP6_MANAGER, NMIP6ManagerClass))
34 #define NM_IS_IP6_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_IP6_MANAGER))
35 #define NM_IS_IP6_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), NM_TYPE_IP6_MANAGER))
36 #define NM_IP6_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_IP6_MANAGER, NMIP6ManagerClass))
37
38 enum {
39         IP6_DHCP_OPT_NONE = 0,
40         IP6_DHCP_OPT_OTHERCONF,
41         IP6_DHCP_OPT_MANAGED
42 };
43
44 typedef struct {
45         GObject parent;
46 } NMIP6Manager;
47
48 typedef struct {
49         GObjectClass parent;
50
51         /* Signals */
52
53         /* addrconf_complete is emitted only during initial configuration to indicate
54          * that the initial configuration is complete.
55          */
56         void (*addrconf_complete) (NMIP6Manager *manager,
57                                    guint32 ifindex,
58                                    guint dhcp_opts,
59                                    gboolean success);
60
61         /* config_changed gets emitted only *after* initial configuration is
62          * complete; it's like DHCP renew and indicates that the existing config
63          * of the interface has changed.
64          */
65         void (*config_changed)    (NMIP6Manager *manager,
66                                    guint32 ifindex,
67                                    guint dhcp_opts,
68                                    gboolean success);
69 } NMIP6ManagerClass;
70
71 GType nm_ip6_manager_get_type (void);
72
73 NMIP6Manager *nm_ip6_manager_get               (void);
74 gboolean      nm_ip6_manager_prepare_interface (NMIP6Manager *manager,
75                                                 int ifindex,
76                                                 NMSettingIP6Config *s_ip6,
77                                                 const char *accept_ra_path);
78 void          nm_ip6_manager_begin_addrconf    (NMIP6Manager *manager,
79                                                 int ifindex);
80 void          nm_ip6_manager_cancel_addrconf   (NMIP6Manager *manager,
81                                                 int ifindex);
82
83 NMIP6Config * nm_ip6_manager_get_ip6_config    (NMIP6Manager *manager,
84                                                 int ifindex);
85
86 #endif /* NM_IP6_MANAGER_H */