#include <stdbool.h>
#include <sys/socket.h>
+#include "compiler.h"
#include "netns_ifaddrs.h"
struct netns_ifaddrs {
#define __ifa_broadaddr ifa_ifu.ifu_broadaddr
#define __ifa_dstaddr ifa_ifu.ifu_dstaddr
-extern void netns_freeifaddrs(struct netns_ifaddrs *);
-extern int netns_getifaddrs(struct netns_ifaddrs **ifap, __s32 netns_id,
- bool *netnsid_aware);
+__hidden extern void netns_freeifaddrs(struct netns_ifaddrs *);
+__hidden extern int netns_getifaddrs(struct netns_ifaddrs **ifap, __s32 netns_id,
+ bool *netnsid_aware);
#ifdef __cplusplus
}
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
lxc_monitord_SOURCES = cmd/lxc_monitord.c \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
endif
lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
- ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
log.c log.h \
lxclock.c lxclock.h \
lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \
af_unix.c af_unix.h \
caps.c caps.h \
+ cgroups/cgfsng.c \
cgroups/cgroup.c cgroups/cgroup.h \
cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \
cgroups/cgroup_utils.c cgroups/cgroup_utils.h \
confile_utils.c confile_utils.h \
error.c error.h \
file_utils.c file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
initutils.c initutils.h \
list.h \
log.c log.h \
#include <sys/syscall.h>
#include <sys/un.h>
+#include "af_unix.h"
#include "config.h"
#include "log.h"
#include "macro.h"
return move_fd(fd);
}
-int lxc_unix_connect(struct sockaddr_un *addr, int type)
+int lxc_unix_connect(struct sockaddr_un *addr)
{
return lxc_unix_connect_type(addr, SOCK_STREAM);
}
/* Given a handler's cgroup data, return the struct hierarchy for the controller
* @c, or NULL if there is none.
*/
-struct hierarchy *get_hierarchy(struct cgroup_ops *ops, const char *controller)
+static struct hierarchy *get_hierarchy(struct cgroup_ops *ops, const char *controller)
{
if (!ops->hierarchies)
return log_trace_errno(NULL, errno, "There are no useable cgroup controllers");
TRACE("named subsystem %d: %s", k, *it);
}
-static int cgroup_tree_remove(struct hierarchy **hierarchies,
- const char *container_cgroup)
+static int cgroup_tree_remove(struct hierarchy **hierarchies, const char *container_cgroup)
{
if (!container_cgroup || !hierarchies)
return 0;
return true;
}
-__cgfsng_ops static inline bool cgfsng_monitor_create(struct cgroup_ops *ops,
- struct lxc_handler *handler)
+__cgfsng_ops static bool cgfsng_monitor_create(struct cgroup_ops *ops, struct lxc_handler *handler)
{
__do_free char *monitor_cgroup = NULL, *__cgroup_tree = NULL;
const char *cgroup_tree;
* Try to create the same cgroup in all hierarchies. Start with cgroup_pattern;
* next cgroup_pattern-1, -2, ..., -999.
*/
-__cgfsng_ops static inline bool cgfsng_payload_create(struct cgroup_ops *ops,
- struct lxc_handler *handler)
+__cgfsng_ops static bool cgfsng_payload_create(struct cgroup_ops *ops, struct lxc_handler *handler)
{
__do_free char *container_cgroup = NULL,
*__cgroup_tree = NULL,
return true;
}
-__cgfsng_ops void cgfsng_payload_finalize(struct cgroup_ops *ops)
+__cgfsng_ops static void cgfsng_payload_finalize(struct cgroup_ops *ops)
{
if (!ops)
return;
return log_info(true, "Limits for the unified cgroup hierarchy have been setup");
}
-__cgfsng_ops bool cgfsng_devices_activate(struct cgroup_ops *ops,
- struct lxc_handler *handler)
+__cgfsng_ops static bool cgfsng_devices_activate(struct cgroup_ops *ops, struct lxc_handler *handler)
{
#ifdef HAVE_STRUCT_BPF_CGROUP_DEV_CTX
__do_bpf_program_free struct bpf_program *devices = NULL;
return true;
}
-bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cgroup)
+static bool __cgfsng_delegate_controllers(struct cgroup_ops *ops, const char *cgroup)
{
__do_free char *add_controllers = NULL, *base_path = NULL;
__do_free_string_list char **parts = NULL;
return true;
}
-__cgfsng_ops bool cgfsng_monitor_delegate_controllers(struct cgroup_ops *ops)
+__cgfsng_ops static bool cgfsng_monitor_delegate_controllers(struct cgroup_ops *ops)
{
if (!ops)
return ret_set_errno(false, ENOENT);
return __cgfsng_delegate_controllers(ops, ops->monitor_cgroup);
}
-__cgfsng_ops bool cgfsng_payload_delegate_controllers(struct cgroup_ops *ops)
+__cgfsng_ops static bool cgfsng_payload_delegate_controllers(struct cgroup_ops *ops)
{
if (!ops)
return ret_set_errno(false, ENOENT);
#include "cgroup.h"
#include "cgroup2_devices.h"
+#include "compiler.h"
#include "conf.h"
#include "config.h"
#include "initutils.h"
lxc_log_define(cgroup, lxc);
-extern struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf);
+__hidden extern struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf);
struct cgroup_ops *cgroup_init(struct lxc_conf *conf)
{
#include <sys/wait.h>
#include <unistd.h>
+#include "compiler.h"
#include "conf.h"
#include "config.h"
#include "list.h"
#include "syscall_wrappers.h"
#include "utils.h"
-extern int lxc_log_fd;
+__hidden extern int lxc_log_fd;
static void usage(const char *name)
{
define_cleanup_function(struct lxc_tty_info *, lxc_delete_tty);
-int lxc_allocate_ttys(struct lxc_conf *conf)
+static int lxc_allocate_ttys(struct lxc_conf *conf)
{
struct lxc_terminal_info *tty_new = NULL;
int ret;
return 0;
}
-int lxc_chroot(const struct lxc_rootfs *rootfs)
+static int lxc_chroot(const struct lxc_rootfs *rootfs)
{
__do_free char *nroot = NULL;
int i, ret;
return 1;
}
-int lxc_map_ids_exec_wrapper(void *args)
+static int lxc_map_ids_exec_wrapper(void *args)
{
execl("/bin/sh", "sh", "-c", (char *)args, (char *)NULL);
return -1;
}
/* NOTE: Must not be called from inside the container namespace! */
-int lxc_create_tmp_proc_mount(struct lxc_conf *conf)
+static int lxc_create_tmp_proc_mount(struct lxc_conf *conf)
{
int mounted;
NUM_LXC_HOOKS
};
-extern char *lxchook_names[NUM_LXC_HOOKS];
+__hidden extern char *lxchook_names[NUM_LXC_HOOKS];
struct lxc_state_client {
int clientfd;
int lxc_log_fd = -EBADF;
static bool wants_syslog = false;
-int lxc_quiet_specified;
+static int lxc_quiet_specified;
int lxc_log_use_global_fd;
static int lxc_loglevel_specified;
#define F_DUPFD_CLOEXEC 1030
#endif
-#define LXC_LOG_PREFIX_SIZE 32
-#define LXC_LOG_BUFFER_SIZE 4096
+#define LXC_LOG_PREFIX_SIZE 32
+#define LXC_LOG_BUFFER_SIZE 4096
/* predefined lxc log priorities. */
enum lxc_loglevel {
/*
* Helper macro to define and use static categories.
*/
-#define lxc_log_category_define(name, parent) \
- extern struct lxc_log_category lxc_log_category_##parent; \
- struct lxc_log_category lxc_log_category_##name = { \
- #name, \
- LXC_LOG_LEVEL_NOTSET, \
- NULL, \
- &lxc_log_category_##parent \
+#define lxc_log_category_define(name, parent) \
+ __hidden extern struct lxc_log_category lxc_log_category_##parent; \
+ __hidden struct lxc_log_category lxc_log_category_##name = { \
+ #name, \
+ LXC_LOG_LEVEL_NOTSET, \
+ NULL, \
+ &lxc_log_category_##parent \
};
#define lxc_log_define(name, parent) \
#include <sys/param.h>
#include <unistd.h>
+#include "compiler.h"
#include "conf.h"
#include "config.h"
#include "log.h"
static struct lsm_drv *drv = NULL;
-extern struct lsm_drv *lsm_apparmor_drv_init(void);
-extern struct lsm_drv *lsm_selinux_drv_init(void);
-extern struct lsm_drv *lsm_nop_drv_init(void);
+__hidden extern struct lsm_drv *lsm_apparmor_drv_init(void);
+__hidden extern struct lsm_drv *lsm_selinux_drv_init(void);
+__hidden extern struct lsm_drv *lsm_nop_drv_init(void);
__attribute__((constructor))
void lsm_init(void)
#include <sys/select.h>
#include <sys/types.h>
+#include "compiler.h"
#include "state.h"
struct lxc_msg;
* @daemonize : whether or not the container is daemonized
* Returns 0 on success, < 0 otherwise
*/
-extern int lxc_start(char *const argv[], struct lxc_handler *handler,
- const char *lxcpath, bool daemonize, int *error_num);
+__hidden extern int lxc_start(char *const argv[], struct lxc_handler *handler, const char *lxcpath,
+ bool daemonize, int *error_num);
/*
* Start the specified command inside an application container
* @daemonize : whether or not the container is daemonized
* Returns 0 on success, < 0 otherwise
*/
-extern int lxc_execute(const char *name, char *const argv[], int quiet,
- struct lxc_handler *handler, const char *lxcpath,
- bool daemonize, int *error_num);
+__hidden extern int lxc_execute(const char *name, char *const argv[], int quiet,
+ struct lxc_handler *handler, const char *lxcpath, bool daemonize,
+ int *error_num);
/*
* Close the fd associated with the monitoring
* @fd : the file descriptor provided by lxc_monitor_open
* Returns 0 on success, < 0 otherwise
*/
-extern int lxc_monitor_close(int fd);
+__hidden extern int lxc_monitor_close(int fd);
/*
* Freeze all the tasks running inside the container <name>
* @name : the container name
* Returns 0 on success, < 0 otherwise
*/
-extern int lxc_freeze(struct lxc_conf *conf, const char *name,
- const char *lxcpath);
+__hidden extern int lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath);
/*
* Unfreeze all previously frozen tasks.
* @name : the name of the container
* Return 0 on success, < 0 otherwise
*/
-extern int lxc_unfreeze(struct lxc_conf *conf, const char *name,
- const char *lxcpath);
+__hidden extern int lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath);
/*
* Retrieve the container state
* @name : the name of the container
* Returns the state of the container on success, < 0 otherwise
*/
-extern lxc_state_t lxc_state(const char *name, const char *lxcpath);
+__hidden extern lxc_state_t lxc_state(const char *name, const char *lxcpath);
/*
* Create and return a new lxccontainer struct.
/*
* Add a dependency to a container
*/
-extern int add_rdepend(struct lxc_conf *lxc_conf, char *rdepend);
+__hidden extern int add_rdepend(struct lxc_conf *lxc_conf, char *rdepend);
/*
* Set a key/value configuration option. Requires that to take a lock on the
* in-memory config of the container.
*/
-extern int lxc_set_config_item_locked(struct lxc_conf *conf, const char *key,
- const char *v);
+__hidden extern int lxc_set_config_item_locked(struct lxc_conf *conf, const char *key, const char *v);
#ifdef __cplusplus
}
#endif
-#endif
+#endif /* __LXC_LXC_H */
* then default to those even if not requested.
* Currently we only do this for btrfs.
*/
-bool should_default_to_snapshot(struct lxc_container *c0,
+static bool should_default_to_snapshot(struct lxc_container *c0,
struct lxc_container *c1)
{
__do_free char *p0 = NULL, *p1 = NULL;
return netlink_transaction(nlh_ptr, nlmsg, answer);
}
-int netdev_get_flag(const char *name, int *flag)
+static int netdev_get_flag(const char *name, int *flag)
{
call_cleaner(nlmsg_free) struct nlmsg *answer = NULL, *nlmsg = NULL;
struct nl_handler nlh;
return 0;
}
-bool lxc_delete_network_unpriv(struct lxc_handler *handler)
+static bool lxc_delete_network_unpriv(struct lxc_handler *handler)
{
int ret;
struct lxc_list *iterator;
return 0;
}
-bool lxc_delete_network_priv(struct lxc_handler *handler)
+static bool lxc_delete_network_priv(struct lxc_handler *handler)
{
int ret;
struct lxc_list *iterator;
*
* Returns 0 on success, < 0 otherwise
*/
-__hidden int nla_put_string(struct nlmsg *nlmsg, int attr, const char *string);
+__hidden extern int nla_put_string(struct nlmsg *nlmsg, int attr, const char *string);
/*
* nla_put_buffer: copy a buffer with a specified size to a netlink
*
* Returns 0 on success, < 0 otherwise
*/
-int nla_put_buffer(struct nlmsg *nlmsg, int attr,
- const void *data, size_t size);
+__hidden extern int nla_put_buffer(struct nlmsg *nlmsg, int attr, const void *data, size_t size);
/*
* nla_put_u32: copy an integer to a netlink message attribute
*
* Returns 0 on success, < 0 otherwise
*/
-int nla_put_u32(struct nlmsg *nlmsg, int attr, int value);
+__hidden extern int nla_put_u32(struct nlmsg *nlmsg, int attr, int value);
/*
* nla_put_u16: copy an integer to a netlink message attribute
*
* Returns 0 on success, < 0 otherwise
*/
-int nla_put_u16(struct nlmsg *nlmsg, int attr, unsigned short value);
+__hidden extern int nla_put_u16(struct nlmsg *nlmsg, int attr, unsigned short value);
/*
* nla_put_attr: add an attribute name to a netlink
*
* Returns 0 on success, < 0 otherwise
*/
-int nla_put_attr(struct nlmsg *nlmsg, int attr);
+__hidden extern int nla_put_attr(struct nlmsg *nlmsg, int attr);
/*
* nla_begin_nested: begin the nesting attribute
#include "macro.h"
#include "memory_utils.h"
#include "process_utils.h"
+#include "rexec.h"
#include "string_utils.h"
#include "syscall_wrappers.h"
lxc_seccomp_arch_unknown = 999,
};
-int get_hostarch(void)
+static int get_hostarch(void)
{
struct utsname uts;
if (uname(&uts) < 0) {
return lxc_seccomp_arch_unknown;
}
-scmp_filter_ctx get_new_ctx(enum lxc_hostarch_t n_arch,
- uint32_t default_policy_action, bool *needs_merge)
+static scmp_filter_ctx get_new_ctx(enum lxc_hostarch_t n_arch, uint32_t default_policy_action,
+ bool *needs_merge)
{
int ret;
uint32_t arch;
return ctx;
}
-bool do_resolve_add_rule(uint32_t arch, char *line, scmp_filter_ctx ctx,
- struct seccomp_v2_rule *rule)
+static bool do_resolve_add_rule(uint32_t arch, char *line, scmp_filter_ctx ctx,
+ struct seccomp_v2_rule *rule)
{
int i, nr, ret;
struct scmp_arg_cmp arg_cmp[6];
#include "cgroup.h"
#include "commands.h"
#include "commands_utils.h"
+#include "compiler.h"
#include "conf.h"
#include "config.h"
#include "confile_utils.h"
const char *size;
};
-int rbd_create_wrapper(void *data)
+static int rbd_create_wrapper(void *data)
{
struct rbd_args *args = data;
return -1;
}
-int rbd_map_wrapper(void *data)
+static int rbd_map_wrapper(void *data)
{
struct rbd_args *args = data;
return -1;
}
-int rbd_unmap_wrapper(void *data)
+static int rbd_unmap_wrapper(void *data)
{
struct rbd_args *args = data;
return -1;
}
-int rbd_delete_wrapper(void *data)
+static int rbd_delete_wrapper(void *data)
{
struct rbd_args *args = data;
};
/* nbd */
-const struct lxc_storage_ops nbd_ops = {
+static const struct lxc_storage_ops nbd_ops = {
.detect = &nbd_detect,
.mount = &nbd_mount,
.umount = &nbd_umount,
return &bdevs[i];
}
-struct lxc_storage *storage_get(const char *type)
+static struct lxc_storage *storage_get(const char *type)
{
size_t i;
struct lxc_storage *bdev;
void *argv;
};
-int zfs_detect_exec_wrapper(void *data)
+static int zfs_detect_exec_wrapper(void *data)
{
struct zfs_args *args = data;
return -1;
}
-int zfs_create_exec_wrapper(void *args)
+static int zfs_create_exec_wrapper(void *args)
{
struct zfs_args *zfs_args = args;
return -1;
}
-int zfs_delete_exec_wrapper(void *args)
+static int zfs_delete_exec_wrapper(void *args)
{
struct zfs_args *zfs_args = args;
return -1;
}
-int zfs_snapshot_exec_wrapper(void *args)
+static int zfs_snapshot_exec_wrapper(void *args)
{
struct zfs_args *zfs_args = args;
return -1;
}
-int zfs_clone_exec_wrapper(void *args)
+static int zfs_clone_exec_wrapper(void *args)
{
struct zfs_args *zfs_args = args;
return -1;
}
-int zfs_get_parent_snapshot_exec_wrapper(void *args)
+static int zfs_get_parent_snapshot_exec_wrapper(void *args)
{
struct zfs_args *zfs_args = args;
return umounts;
}
-int run_command_internal(char *buf, size_t buf_size, int (*child_fn)(void *), void *args, bool wait_status)
+static int run_command_internal(char *buf, size_t buf_size, int (*child_fn)(void *), void *args, bool wait_status)
{
pid_t child;
int ret, fret, pipefd[2];
lxc_test_api_reboot_SOURCES = api_reboot.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxc_test_apparmor_SOURCES = aa.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxc_test_attach_SOURCES = attach.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxc_test_cgpath_SOURCES = cgpath.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxctest.h \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxc_test_locktests_SOURCES = locktests.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxctest.h \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxctest.h \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxctest.h \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \
lxctest.h \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/caps.c ../lxc/caps.h \
+ ../lxc/cgroups/cgfsng.c \
../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \
../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \
../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \
../lxc/confile_utils.c ../lxc/confile_utils.h \
../lxc/error.c ../lxc/error.h \
../lxc/file_utils.c ../lxc/file_utils.h \
+ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
../lxc/initutils.c ../lxc/initutils.h \
../lxc/log.c ../lxc/log.h \
../lxc/lxclock.c ../lxc/lxclock.h \