iSulad/src/config/isulad_config.h

112 lines
3.2 KiB
C
Raw Normal View History

2019-09-30 10:53:41 -04:00
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2018-2019. All rights reserved.
* iSulad licensed under the Mulan PSL v1.
* You can use this software according to the terms and conditions of the Mulan PSL v1.
* You may obtain a copy of Mulan PSL v1 at:
* http://license.coscl.org.cn/MulanPSL
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v1 for more details.
* Author: lifeng
* Create: 2018-11-08
* Description: provide container configure definition
******************************************************************************/
#ifndef __ISULAD_CONF_H
#define __ISULAD_CONF_H
2019-09-30 10:53:41 -04:00
#include <stdint.h>
#include "isulad/arguments.h"
2019-09-30 10:53:41 -04:00
#include "oci_runtime_spec.h"
#include "isulad_daemon_configs.h"
#ifdef __cplusplus
extern "C" {
#endif
#define DEFAULT_IM_SERVER_SOCK_ADDR "unix:///var/run/isulad/isula_image.sock"
2019-12-25 15:50:34 +08:00
struct isulad_conf {
pthread_rwlock_t isulad_conf_rwlock;
2019-09-30 10:53:41 -04:00
struct service_arguments *server_conf;
};
char *conf_get_isulad_pidfile();
2019-09-30 10:53:41 -04:00
char *conf_get_engine_rootpath();
char *conf_get_routine_rootdir(const char *runtime);
char *conf_get_routine_statedir(const char *runtime);
char *conf_get_isulad_rootdir();
char *conf_get_isulad_statedir();
char *conf_get_isulad_mount_rootfs();
char *conf_get_isulad_engine();
char *conf_get_isulad_loglevel();
char *conf_get_isulad_logdriver();
2019-09-30 10:53:41 -04:00
int conf_get_daemon_log_config(char **loglevel, char **logdriver, char **engine_log_path);
char *conf_get_isulad_log_gather_fifo_path();
2019-09-30 10:53:41 -04:00
char *conf_get_isulad_log_file();
2019-09-30 10:53:41 -04:00
char *conf_get_engine_log_file();
char *conf_get_enable_plugins();
int save_args_to_conf(struct service_arguments *args);
int set_unix_socket_group(const char *socket, const char *group);
int isulad_server_conf_wrlock();
2019-09-30 10:53:41 -04:00
int isulad_server_conf_rdlock();
2019-09-30 10:53:41 -04:00
int isulad_server_conf_unlock();
2019-09-30 10:53:41 -04:00
struct service_arguments *conf_get_server_conf();
int get_system_cpu_usage(uint64_t *val);
int conf_get_isulad_hooks(oci_runtime_spec_hooks **phooks);
2019-09-30 10:53:41 -04:00
int conf_get_isulad_default_ulimit(host_config_ulimits_element ***ulimit);
2019-09-30 10:53:41 -04:00
unsigned int conf_get_start_timeout();
int init_cgroups_path(const char *path, int recursive_depth);
char *conf_get_graph_rootpath();
char *conf_get_graph_run_path();
char *conf_get_isulad_storage_driver();
2019-09-30 10:53:41 -04:00
char *conf_get_isulad_storage_driver_backing_fs();
2019-09-30 10:53:41 -04:00
char **conf_get_storage_opts();
char **conf_get_insecure_registry_list();
char **conf_get_registry_list();
char *conf_get_isulad_native_umask();
2019-09-30 10:53:41 -04:00
char *conf_get_isulad_cgroup_parent();
2019-09-30 10:53:41 -04:00
unsigned int conf_get_im_opt_timeout();
2019-12-25 15:50:34 +08:00
char *conf_get_im_server_sock_addr();
bool conf_update_im_server_sock_addr(const char *new_sock_addr);
2019-09-30 10:53:41 -04:00
char *conf_get_graph_check_flag_file();
bool conf_get_image_layer_check_flag();
int merge_json_confs_into_global(struct service_arguments *args);
bool conf_get_use_decrypted_key_flag();
bool conf_get_skip_insecure_verify_flag();
int parse_log_opts(struct service_arguments *args, const char *key, const char *value);
#ifdef __cplusplus
}
#endif
#endif /* __ISULAD_CONF_H */
2019-12-25 15:50:34 +08:00