| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "core-forward.h" |
| 5 |
|
| 6 |
/* These functions are declared in the header to make them accessible to unit tests. */ |
| 7 |
bool contains_instance_specifier_superset(const char *s); |
| 8 |
int unit_is_likely_recursive_template_dependency(Unit *u, const char *name, const char *format); |
| 9 |
|
| 10 |
/* Config-parsing helpers relevant only for sources under src/core/ */ |
| 11 |
int parse_crash_chvt(const char *value, int *data); |
| 12 |
int parse_confirm_spawn(const char *value, char **console); |
| 13 |
|
| 14 |
/* Read service data from .desktop file style configuration fragments */ |
| 15 |
|
| 16 |
int unit_load_fragment(Unit *u); |
| 17 |
|
| 18 |
void unit_dump_config_items(FILE *f); |
| 19 |
|
| 20 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_deps); |
| 21 |
CONFIG_PARSER_PROTOTYPE(config_parse_obsolete_unit_deps); |
| 22 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_string_printf); |
| 23 |
CONFIG_PARSER_PROTOTYPE(config_parse_reboot_parameter); |
| 24 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_strv_printf); |
| 25 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_path_printf); |
| 26 |
CONFIG_PARSER_PROTOTYPE(config_parse_colon_separated_paths); |
| 27 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_path_strv_printf); |
| 28 |
CONFIG_PARSER_PROTOTYPE(config_parse_documentation); |
| 29 |
CONFIG_PARSER_PROTOTYPE(config_parse_socket_listen); |
| 30 |
CONFIG_PARSER_PROTOTYPE(config_parse_socket_protocol); |
| 31 |
CONFIG_PARSER_PROTOTYPE(config_parse_socket_bind); |
| 32 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_nice); |
| 33 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_oom_score_adjust); |
| 34 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_coredump_filter); |
| 35 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec); |
| 36 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout); |
| 37 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout_abort); |
| 38 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout_failure_mode); |
| 39 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_type); |
| 40 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_exit_type); |
| 41 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_restart); |
| 42 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_restart_mode); |
| 43 |
CONFIG_PARSER_PROTOTYPE(config_parse_socket_bindtodevice); |
| 44 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_output); |
| 45 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_input); |
| 46 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_input_text); |
| 47 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_input_data); |
| 48 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_io_class); |
| 49 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_io_priority); |
| 50 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_sched_policy); |
| 51 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_sched_prio); |
| 52 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_affinity); |
| 53 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_mount_apivfs); |
| 54 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_secure_bits); |
| 55 |
CONFIG_PARSER_PROTOTYPE(config_parse_root_image_options); |
| 56 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_root_hash); |
| 57 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_root_hash_sig); |
| 58 |
CONFIG_PARSER_PROTOTYPE(config_parse_capability_set); |
| 59 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_mount_propagation_flag); |
| 60 |
CONFIG_PARSER_PROTOTYPE(config_parse_timer); |
| 61 |
CONFIG_PARSER_PROTOTYPE(config_parse_trigger_unit); |
| 62 |
CONFIG_PARSER_PROTOTYPE(config_parse_path_spec); |
| 63 |
CONFIG_PARSER_PROTOTYPE(config_parse_socket_service); |
| 64 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_sockets); |
| 65 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_env_file); |
| 66 |
CONFIG_PARSER_PROTOTYPE(config_parse_ip_tos); |
| 67 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_condition_path); |
| 68 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_condition_string); |
| 69 |
CONFIG_PARSER_PROTOTYPE(config_parse_kill_mode); |
| 70 |
CONFIG_PARSER_PROTOTYPE(config_parse_notify_access); |
| 71 |
CONFIG_PARSER_PROTOTYPE(config_parse_emergency_action); |
| 72 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_mounts_for); |
| 73 |
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_filter); |
| 74 |
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_archs); |
| 75 |
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_errno); |
| 76 |
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_log); |
| 77 |
CONFIG_PARSER_PROTOTYPE(config_parse_environ); |
| 78 |
CONFIG_PARSER_PROTOTYPE(config_parse_pass_environ); |
| 79 |
CONFIG_PARSER_PROTOTYPE(config_parse_unset_environ); |
| 80 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_slice); |
| 81 |
CONFIG_PARSER_PROTOTYPE(config_parse_cg_weight); |
| 82 |
CONFIG_PARSER_PROTOTYPE(config_parse_cg_cpu_weight); |
| 83 |
CONFIG_PARSER_PROTOTYPE(config_parse_memory_limit); |
| 84 |
CONFIG_PARSER_PROTOTYPE(config_parse_tasks_max); |
| 85 |
CONFIG_PARSER_PROTOTYPE(config_parse_delegate); |
| 86 |
CONFIG_PARSER_PROTOTYPE(config_parse_delegate_subgroup); |
| 87 |
CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_mode); |
| 88 |
CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_mem_pressure_limit); |
| 89 |
CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_mem_pressure_duration_sec); |
| 90 |
CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_preference); |
| 91 |
CONFIG_PARSER_PROTOTYPE(config_parse_device_policy); |
| 92 |
CONFIG_PARSER_PROTOTYPE(config_parse_device_allow); |
| 93 |
CONFIG_PARSER_PROTOTYPE(config_parse_io_device_latency); |
| 94 |
CONFIG_PARSER_PROTOTYPE(config_parse_io_device_weight); |
| 95 |
CONFIG_PARSER_PROTOTYPE(config_parse_io_limit); |
| 96 |
CONFIG_PARSER_PROTOTYPE(config_parse_job_mode); |
| 97 |
CONFIG_PARSER_PROTOTYPE(config_parse_job_mode_isolate); |
| 98 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_selinux_context); |
| 99 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_apparmor_profile); |
| 100 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_smack_process_label); |
| 101 |
CONFIG_PARSER_PROTOTYPE(config_parse_address_families); |
| 102 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_preserve_mode); |
| 103 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_directories); |
| 104 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_quota); |
| 105 |
CONFIG_PARSER_PROTOTYPE(config_parse_set_credential); |
| 106 |
CONFIG_PARSER_PROTOTYPE(config_parse_load_credential); |
| 107 |
CONFIG_PARSER_PROTOTYPE(config_parse_import_credential); |
| 108 |
CONFIG_PARSER_PROTOTYPE(config_parse_service_refresh_on_reload); |
| 109 |
CONFIG_PARSER_PROTOTYPE(config_parse_set_status); |
| 110 |
CONFIG_PARSER_PROTOTYPE(config_parse_namespace_path_strv); |
| 111 |
CONFIG_PARSER_PROTOTYPE(config_parse_temporary_filesystems); |
| 112 |
CONFIG_PARSER_PROTOTYPE(config_parse_private_tmp); |
| 113 |
CONFIG_PARSER_PROTOTYPE(config_parse_private_users); |
| 114 |
CONFIG_PARSER_PROTOTYPE(config_parse_private_pids); |
| 115 |
CONFIG_PARSER_PROTOTYPE(config_parse_protect_control_groups); |
| 116 |
CONFIG_PARSER_PROTOTYPE(config_parse_cpu_quota); |
| 117 |
CONFIG_PARSER_PROTOTYPE(config_parse_unit_cpu_set); |
| 118 |
CONFIG_PARSER_PROTOTYPE(config_parse_protect_home); |
| 119 |
CONFIG_PARSER_PROTOTYPE(config_parse_protect_hostname); |
| 120 |
CONFIG_PARSER_PROTOTYPE(config_parse_protect_system); |
| 121 |
CONFIG_PARSER_PROTOTYPE(config_parse_bus_name); |
| 122 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_utmp_mode); |
| 123 |
CONFIG_PARSER_PROTOTYPE(config_parse_working_directory); |
| 124 |
CONFIG_PARSER_PROTOTYPE(config_parse_fdname); |
| 125 |
CONFIG_PARSER_PROTOTYPE(config_parse_user_group_compat); |
| 126 |
CONFIG_PARSER_PROTOTYPE(config_parse_user_group_strv_compat); |
| 127 |
CONFIG_PARSER_PROTOTYPE(config_parse_namespace_flags); |
| 128 |
CONFIG_PARSER_PROTOTYPE(config_parse_restrict_filesystems); |
| 129 |
CONFIG_PARSER_PROTOTYPE(config_parse_bind_paths); |
| 130 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_keyring_mode); |
| 131 |
CONFIG_PARSER_PROTOTYPE(config_parse_protect_proc); |
| 132 |
CONFIG_PARSER_PROTOTYPE(config_parse_proc_subset); |
| 133 |
CONFIG_PARSER_PROTOTYPE(config_parse_private_bpf); |
| 134 |
CONFIG_PARSER_PROTOTYPE(config_parse_bpf_delegate_commands); |
| 135 |
CONFIG_PARSER_PROTOTYPE(config_parse_bpf_delegate_maps); |
| 136 |
CONFIG_PARSER_PROTOTYPE(config_parse_bpf_delegate_programs); |
| 137 |
CONFIG_PARSER_PROTOTYPE(config_parse_bpf_delegate_attachments); |
| 138 |
CONFIG_PARSER_PROTOTYPE(config_parse_job_timeout_sec); |
| 139 |
CONFIG_PARSER_PROTOTYPE(config_parse_job_running_timeout_sec); |
| 140 |
CONFIG_PARSER_PROTOTYPE(config_parse_log_extra_fields); |
| 141 |
CONFIG_PARSER_PROTOTYPE(config_parse_log_namespace); |
| 142 |
CONFIG_PARSER_PROTOTYPE(config_parse_collect_mode); |
| 143 |
CONFIG_PARSER_PROTOTYPE(config_parse_pid_file); |
| 144 |
CONFIG_PARSER_PROTOTYPE(config_parse_exit_status); |
| 145 |
CONFIG_PARSER_PROTOTYPE(config_parse_disable_controllers); |
| 146 |
CONFIG_PARSER_PROTOTYPE(config_parse_oom_policy); |
| 147 |
CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_rules); |
| 148 |
CONFIG_PARSER_PROTOTYPE(config_parse_numa_policy); |
| 149 |
CONFIG_PARSER_PROTOTYPE(config_parse_numa_mask); |
| 150 |
CONFIG_PARSER_PROTOTYPE(config_parse_ip_filter_bpf_progs); |
| 151 |
CONFIG_PARSER_PROTOTYPE(config_parse_show_status); |
| 152 |
CONFIG_PARSER_PROTOTYPE(config_parse_status_unit_format); |
| 153 |
CONFIG_PARSER_PROTOTYPE(config_parse_output_restricted); |
| 154 |
CONFIG_PARSER_PROTOTYPE(config_parse_crash_chvt); |
| 155 |
CONFIG_PARSER_PROTOTYPE(config_parse_timeout_abort); |
| 156 |
CONFIG_PARSER_PROTOTYPE(config_parse_swap_priority); |
| 157 |
CONFIG_PARSER_PROTOTYPE(config_parse_mount_images); |
| 158 |
CONFIG_PARSER_PROTOTYPE(config_parse_socket_timestamping); |
| 159 |
CONFIG_PARSER_PROTOTYPE(config_parse_socket_defer_trigger); |
| 160 |
CONFIG_PARSER_PROTOTYPE(config_parse_extension_images); |
| 161 |
CONFIG_PARSER_PROTOTYPE(config_parse_bpf_foreign_program); |
| 162 |
CONFIG_PARSER_PROTOTYPE(config_parse_cgroup_socket_bind); |
| 163 |
CONFIG_PARSER_PROTOTYPE(config_parse_restrict_network_interfaces); |
| 164 |
CONFIG_PARSER_PROTOTYPE(config_parse_watchdog_sec); |
| 165 |
CONFIG_PARSER_PROTOTYPE(config_parse_tty_size); |
| 166 |
CONFIG_PARSER_PROTOTYPE(config_parse_log_filter_patterns); |
| 167 |
CONFIG_PARSER_PROTOTYPE(config_parse_open_file); |
| 168 |
CONFIG_PARSER_PROTOTYPE(config_parse_pressure_watch); |
| 169 |
CONFIG_PARSER_PROTOTYPE(config_parse_cgroup_nft_set); |
| 170 |
CONFIG_PARSER_PROTOTYPE(config_parse_mount_node); |
| 171 |
CONFIG_PARSER_PROTOTYPE(config_parse_concurrency_max); |
| 172 |
CONFIG_PARSER_PROTOTYPE(config_parse_bind_network_interface); |
| 173 |
CONFIG_PARSER_PROTOTYPE(config_parse_exec_memory_thp); |
| 174 |
CONFIG_PARSER_PROTOTYPE(config_parse_cpuset_partition); |
| 175 |
|
| 176 |
/* gperf prototypes */ |
| 177 |
const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, GPERF_LEN_TYPE length); |
| 178 |
extern const char load_fragment_gperf_nulstr[]; |