]>
Commit | Line | Data |
---|---|---|
c2cc9f0a | 1 | /* |
2 | * lxc: linux Container library | |
3 | * | |
4 | * (C) Copyright IBM Corp. 2007, 2008 | |
5 | * | |
6 | * Authors: | |
9afe19d6 | 7 | * Daniel Lezcano <daniel.lezcano at free.fr> |
70c1e708 CB |
8 | * Serge Hallyn <serge@hallyn.com> |
9 | * Christian Brauner <christian.brauner@ubuntu.com> | |
c2cc9f0a | 10 | * |
11 | * This library is free software; you can redistribute it and/or | |
12 | * modify it under the terms of the GNU Lesser General Public | |
13 | * License as published by the Free Software Foundation; either | |
14 | * version 2.1 of the License, or (at your option) any later version. | |
15 | * | |
16 | * This library is distributed in the hope that it will be useful, | |
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 | * Lesser General Public License for more details. | |
20 | * | |
21 | * You should have received a copy of the GNU Lesser General Public | |
22 | * License along with this library; if not, write to the Free Software | |
250b1eec | 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
c2cc9f0a | 24 | */ |
8173e600 | 25 | |
f1a4a029 ÇO |
26 | #ifndef __LXC_CONFILE_H |
27 | #define __LXC_CONFILE_H | |
28 | ||
8173e600 | 29 | #include <stdio.h> |
f2363e38 | 30 | #include <lxc/attach_options.h> |
6b0d5538 | 31 | #include <stdbool.h> |
c2cc9f0a | 32 | |
00b3c2e2 | 33 | struct lxc_conf; |
62e46035 | 34 | struct lxc_list; |
00b3c2e2 | 35 | |
c7e27aaf CB |
36 | typedef int (*config_set_cb)(const char *, const char *, struct lxc_conf *, |
37 | void *data); | |
cccd2219 CB |
38 | typedef int (*config_get_cb)(const char *, char *, int, struct lxc_conf *, |
39 | void *); | |
26471403 | 40 | typedef int (*config_clr_cb)(const char *, struct lxc_conf *c, void *data); |
72d0e1cb SG |
41 | struct lxc_config_t { |
42 | char *name; | |
821a76f1 CB |
43 | config_set_cb set; |
44 | config_get_cb get; | |
6afd673f | 45 | config_clr_cb clr; |
72d0e1cb SG |
46 | }; |
47 | ||
48 | extern struct lxc_config_t *lxc_getconfig(const char *key); | |
12a50cc6 | 49 | extern int lxc_list_nicconfigs(struct lxc_conf *c, const char *key, char *retv, int inlen); |
72d0e1cb | 50 | extern int lxc_listconfigs(char *retv, int inlen); |
6b0d5538 SH |
51 | extern int lxc_config_read(const char *file, struct lxc_conf *conf, bool from_include); |
52 | extern int append_unexp_config_line(const char *line, struct lxc_conf *conf); | |
c2cc9f0a | 53 | |
62e46035 | 54 | extern int lxc_config_define_add(struct lxc_list *defines, char* arg); |
226a18d6 DL |
55 | extern int lxc_config_define_load(struct lxc_list *defines, |
56 | struct lxc_conf *conf); | |
e16dad10 | 57 | |
525f0002 CS |
58 | /* needed for lxc-attach */ |
59 | extern signed long lxc_config_parse_arch(const char *arch); | |
4d69b293 | 60 | extern int lxc_fill_elevated_privileges(char *flaglist, int *flags); |
525f0002 | 61 | |
12a50cc6 | 62 | extern int lxc_clear_config_item(struct lxc_conf *c, const char *key); |
72d0e1cb | 63 | extern void write_config(FILE *fout, struct lxc_conf *c); |
6b0d5538 SH |
64 | |
65 | extern bool do_append_unexp_config_line(struct lxc_conf *conf, const char *key, const char *v); | |
66 | ||
67 | /* These are used when cloning a container */ | |
68 | extern void clear_unexp_config_line(struct lxc_conf *conf, const char *key, bool rm_subkeys); | |
67702c21 SH |
69 | extern bool clone_update_unexp_hooks(struct lxc_conf *conf, const char *oldpath, |
70 | const char *newpath, const char *oldname, const char *newmame); | |
329b3625 CB |
71 | bool clone_update_unexp_ovl_paths(struct lxc_conf *conf, const char *oldpath, |
72 | const char *newpath, const char *oldname, | |
73 | const char *newname, const char *ovldir); | |
67702c21 | 74 | extern bool network_new_hwaddrs(struct lxc_conf *conf); |
e16dad10 | 75 | #endif |