ifcfg-rh: allow handling complex routing rules via dispatcher (rh #1160013)
[NetworkManager.git] / src / settings / plugins / ifcfg-rh / utils.h
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* NetworkManager system settings service
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 of the License, or
7  * (at your option) 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  * (C) Copyright 2008 - 2012 Red Hat, Inc.
19  */
20
21 #ifndef _UTILS_H_
22 #define _UTILS_H_
23
24 #include <glib.h>
25 #include <nm-connection.h>
26 #include "shvar.h"
27 #include "common.h"
28
29 char *utils_single_quote_string (const char *str);
30
31 char *utils_single_unquote_string (const char *str);
32
33 char *utils_cert_path (const char *parent, const char *suffix);
34
35 const char *utils_get_ifcfg_name (const char *file, gboolean only_ifcfg);
36
37 gboolean utils_should_ignore_file (const char *filename, gboolean only_ifcfg);
38
39 char *utils_get_ifcfg_path (const char *parent);
40 char *utils_get_keys_path (const char *parent);
41 char *utils_get_route_path (const char *parent);
42 char *utils_get_route6_path (const char *parent);
43
44 shvarFile *utils_get_extra_ifcfg (const char *parent, const char *tag, gboolean should_create);
45 shvarFile *utils_get_keys_ifcfg (const char *parent, gboolean should_create);
46 shvarFile *utils_get_route_ifcfg (const char *parent, gboolean should_create);
47 shvarFile *utils_get_route6_ifcfg (const char *parent, gboolean should_create);
48
49 gboolean utils_has_route_file_new_syntax (const char *filename);
50 gboolean utils_has_complex_routes (const char *filename);
51
52 gboolean utils_ignore_ip_config (NMConnection *connection);
53
54 gboolean utils_is_ifcfg_alias_file (const char *alias, const char *ifcfg);
55 char *utils_get_ifcfg_from_alias (const char *alias);
56
57 #endif  /* _UTILS_H_ */
58