]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
c2f1db8f | 2 | #pragma once |
3efd4195 | 3 | |
a2106925 | 4 | #include "conf-parser.h" |
87f0e418 | 5 | #include "unit.h" |
3efd4195 | 6 | |
88022148 DDM |
7 | /* These functions are declared in the header to make them accessible to unit tests. */ |
8 | bool contains_instance_specifier_superset(const char *s); | |
9 | int unit_is_likely_recursive_template_dependency(Unit *u, const char *name, const char *format); | |
10 | ||
a07a7324 FS |
11 | /* Config-parsing helpers relevant only for sources under src/core/ */ |
12 | int parse_crash_chvt(const char *value, int *data); | |
13 | int parse_confirm_spawn(const char *value, char **console); | |
14 | ||
bbfb25f4 DDM |
15 | int hashmap_put_credential(Hashmap **h, const char *id, const char *path, bool encrypted); |
16 | ||
3efd4195 LP |
17 | /* Read service data from .desktop file style configuration fragments */ |
18 | ||
e537352b LP |
19 | int unit_load_fragment(Unit *u); |
20 | ||
21 | void unit_dump_config_items(FILE *f); | |
3efd4195 | 22 | |
a2106925 LP |
23 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_deps); |
24 | CONFIG_PARSER_PROTOTYPE(config_parse_obsolete_unit_deps); | |
25 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_string_printf); | |
26 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_strv_printf); | |
27 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_path_printf); | |
8c35c10d | 28 | CONFIG_PARSER_PROTOTYPE(config_parse_colon_separated_paths); |
a2106925 LP |
29 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_path_strv_printf); |
30 | CONFIG_PARSER_PROTOTYPE(config_parse_documentation); | |
31 | CONFIG_PARSER_PROTOTYPE(config_parse_socket_listen); | |
32 | CONFIG_PARSER_PROTOTYPE(config_parse_socket_protocol); | |
33 | CONFIG_PARSER_PROTOTYPE(config_parse_socket_bind); | |
34 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_nice); | |
35 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_oom_score_adjust); | |
ad21e542 | 36 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_coredump_filter); |
a2106925 LP |
37 | CONFIG_PARSER_PROTOTYPE(config_parse_exec); |
38 | CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout); | |
dc653bf4 | 39 | CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout_abort); |
bf760801 | 40 | CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout_failure_mode); |
a2106925 | 41 | CONFIG_PARSER_PROTOTYPE(config_parse_service_type); |
596e4470 | 42 | CONFIG_PARSER_PROTOTYPE(config_parse_service_exit_type); |
a2106925 LP |
43 | CONFIG_PARSER_PROTOTYPE(config_parse_service_restart); |
44 | CONFIG_PARSER_PROTOTYPE(config_parse_socket_bindtodevice); | |
45 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_output); | |
46 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_input); | |
47 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_input_text); | |
48 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_input_data); | |
49 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_io_class); | |
50 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_io_priority); | |
51 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_sched_policy); | |
52 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_sched_prio); | |
53 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_affinity); | |
5e98086d | 54 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_mount_apivfs); |
a2106925 | 55 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_secure_bits); |
18d73705 | 56 | CONFIG_PARSER_PROTOTYPE(config_parse_root_image_options); |
0389f4fa | 57 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_root_hash); |
d4d55b0d | 58 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_root_hash_sig); |
a2106925 | 59 | CONFIG_PARSER_PROTOTYPE(config_parse_capability_set); |
874cdcbc | 60 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_mount_propagation_flag); |
a2106925 LP |
61 | CONFIG_PARSER_PROTOTYPE(config_parse_timer); |
62 | CONFIG_PARSER_PROTOTYPE(config_parse_trigger_unit); | |
63 | CONFIG_PARSER_PROTOTYPE(config_parse_path_spec); | |
64 | CONFIG_PARSER_PROTOTYPE(config_parse_socket_service); | |
65 | CONFIG_PARSER_PROTOTYPE(config_parse_service_sockets); | |
66 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_env_file); | |
67 | CONFIG_PARSER_PROTOTYPE(config_parse_ip_tos); | |
68 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_condition_path); | |
69 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_condition_string); | |
a2106925 LP |
70 | CONFIG_PARSER_PROTOTYPE(config_parse_kill_mode); |
71 | CONFIG_PARSER_PROTOTYPE(config_parse_notify_access); | |
72 | CONFIG_PARSER_PROTOTYPE(config_parse_emergency_action); | |
73 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_requires_mounts_for); | |
74 | CONFIG_PARSER_PROTOTYPE(config_parse_syscall_filter); | |
75 | CONFIG_PARSER_PROTOTYPE(config_parse_syscall_archs); | |
76 | CONFIG_PARSER_PROTOTYPE(config_parse_syscall_errno); | |
9df2cdd8 | 77 | CONFIG_PARSER_PROTOTYPE(config_parse_syscall_log); |
a2106925 LP |
78 | CONFIG_PARSER_PROTOTYPE(config_parse_environ); |
79 | CONFIG_PARSER_PROTOTYPE(config_parse_pass_environ); | |
80 | CONFIG_PARSER_PROTOTYPE(config_parse_unset_environ); | |
81 | CONFIG_PARSER_PROTOTYPE(config_parse_unit_slice); | |
984faf29 | 82 | CONFIG_PARSER_PROTOTYPE(config_parse_cg_weight); |
c8340822 | 83 | CONFIG_PARSER_PROTOTYPE(config_parse_cg_cpu_weight); |
a2106925 LP |
84 | CONFIG_PARSER_PROTOTYPE(config_parse_cpu_shares); |
85 | CONFIG_PARSER_PROTOTYPE(config_parse_memory_limit); | |
86 | CONFIG_PARSER_PROTOTYPE(config_parse_tasks_max); | |
87 | CONFIG_PARSER_PROTOTYPE(config_parse_delegate); | |
a8b993dc | 88 | CONFIG_PARSER_PROTOTYPE(config_parse_delegate_subgroup); |
4d824a4e AZ |
89 | CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_mode); |
90 | CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_mem_pressure_limit); | |
4e806bfa | 91 | CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_preference); |
a2106925 LP |
92 | CONFIG_PARSER_PROTOTYPE(config_parse_device_policy); |
93 | CONFIG_PARSER_PROTOTYPE(config_parse_device_allow); | |
6ae4283c | 94 | CONFIG_PARSER_PROTOTYPE(config_parse_io_device_latency); |
a2106925 LP |
95 | CONFIG_PARSER_PROTOTYPE(config_parse_io_device_weight); |
96 | CONFIG_PARSER_PROTOTYPE(config_parse_io_limit); | |
97 | CONFIG_PARSER_PROTOTYPE(config_parse_blockio_weight); | |
98 | CONFIG_PARSER_PROTOTYPE(config_parse_blockio_device_weight); | |
99 | CONFIG_PARSER_PROTOTYPE(config_parse_blockio_bandwidth); | |
a2106925 LP |
100 | CONFIG_PARSER_PROTOTYPE(config_parse_job_mode); |
101 | CONFIG_PARSER_PROTOTYPE(config_parse_job_mode_isolate); | |
102 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_selinux_context); | |
103 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_apparmor_profile); | |
104 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_smack_process_label); | |
105 | CONFIG_PARSER_PROTOTYPE(config_parse_address_families); | |
b9c1883a | 106 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_preserve_mode); |
a2106925 | 107 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_directories); |
bb0c0d6f LP |
108 | CONFIG_PARSER_PROTOTYPE(config_parse_set_credential); |
109 | CONFIG_PARSER_PROTOTYPE(config_parse_load_credential); | |
bbfb25f4 | 110 | CONFIG_PARSER_PROTOTYPE(config_parse_import_credential); |
a2106925 LP |
111 | CONFIG_PARSER_PROTOTYPE(config_parse_set_status); |
112 | CONFIG_PARSER_PROTOTYPE(config_parse_namespace_path_strv); | |
113 | CONFIG_PARSER_PROTOTYPE(config_parse_temporary_filesystems); | |
a2106925 | 114 | CONFIG_PARSER_PROTOTYPE(config_parse_cpu_quota); |
31d3a520 | 115 | CONFIG_PARSER_PROTOTYPE(config_parse_allowed_cpuset); |
a2106925 LP |
116 | CONFIG_PARSER_PROTOTYPE(config_parse_protect_home); |
117 | CONFIG_PARSER_PROTOTYPE(config_parse_protect_system); | |
118 | CONFIG_PARSER_PROTOTYPE(config_parse_bus_name); | |
119 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_utmp_mode); | |
120 | CONFIG_PARSER_PROTOTYPE(config_parse_working_directory); | |
121 | CONFIG_PARSER_PROTOTYPE(config_parse_fdname); | |
ae480f0b ZJS |
122 | CONFIG_PARSER_PROTOTYPE(config_parse_user_group_compat); |
123 | CONFIG_PARSER_PROTOTYPE(config_parse_user_group_strv_compat); | |
a2106925 | 124 | CONFIG_PARSER_PROTOTYPE(config_parse_restrict_namespaces); |
e59ccd03 | 125 | CONFIG_PARSER_PROTOTYPE(config_parse_restrict_filesystems); |
a2106925 LP |
126 | CONFIG_PARSER_PROTOTYPE(config_parse_bind_paths); |
127 | CONFIG_PARSER_PROTOTYPE(config_parse_exec_keyring_mode); | |
4e399953 LP |
128 | CONFIG_PARSER_PROTOTYPE(config_parse_protect_proc); |
129 | CONFIG_PARSER_PROTOTYPE(config_parse_proc_subset); | |
a2106925 LP |
130 | CONFIG_PARSER_PROTOTYPE(config_parse_job_timeout_sec); |
131 | CONFIG_PARSER_PROTOTYPE(config_parse_job_running_timeout_sec); | |
132 | CONFIG_PARSER_PROTOTYPE(config_parse_log_extra_fields); | |
91dd5f7c | 133 | CONFIG_PARSER_PROTOTYPE(config_parse_log_namespace); |
a2106925 | 134 | CONFIG_PARSER_PROTOTYPE(config_parse_collect_mode); |
a9353a5c | 135 | CONFIG_PARSER_PROTOTYPE(config_parse_pid_file); |
7af67e9a | 136 | CONFIG_PARSER_PROTOTYPE(config_parse_exit_status); |
c72703e2 | 137 | CONFIG_PARSER_PROTOTYPE(config_parse_disable_controllers); |
afcfaa69 | 138 | CONFIG_PARSER_PROTOTYPE(config_parse_oom_policy); |
b070c7c0 MS |
139 | CONFIG_PARSER_PROTOTYPE(config_parse_numa_policy); |
140 | CONFIG_PARSER_PROTOTYPE(config_parse_numa_mask); | |
fab34748 | 141 | CONFIG_PARSER_PROTOTYPE(config_parse_ip_filter_bpf_progs); |
a07a7324 FS |
142 | CONFIG_PARSER_PROTOTYPE(config_parse_cpu_affinity2); |
143 | CONFIG_PARSER_PROTOTYPE(config_parse_show_status); | |
6327aa9f | 144 | CONFIG_PARSER_PROTOTYPE(config_parse_status_unit_format); |
a07a7324 FS |
145 | CONFIG_PARSER_PROTOTYPE(config_parse_output_restricted); |
146 | CONFIG_PARSER_PROTOTYPE(config_parse_crash_chvt); | |
147 | CONFIG_PARSER_PROTOTYPE(config_parse_timeout_abort); | |
eb34a981 | 148 | CONFIG_PARSER_PROTOTYPE(config_parse_swap_priority); |
b3d13314 | 149 | CONFIG_PARSER_PROTOTYPE(config_parse_mount_images); |
9b191525 | 150 | CONFIG_PARSER_PROTOTYPE(config_parse_socket_timestamping); |
93f59701 | 151 | CONFIG_PARSER_PROTOTYPE(config_parse_extension_images); |
0879da98 | 152 | CONFIG_PARSER_PROTOTYPE(config_parse_bpf_foreign_program); |
8dd210ab | 153 | CONFIG_PARSER_PROTOTYPE(config_parse_cgroup_socket_bind); |
4f0c25c7 | 154 | CONFIG_PARSER_PROTOTYPE(config_parse_restrict_network_interfaces); |
8a85c5b6 | 155 | CONFIG_PARSER_PROTOTYPE(config_parse_watchdog_sec); |
51462135 | 156 | CONFIG_PARSER_PROTOTYPE(config_parse_tty_size); |
523ea123 | 157 | CONFIG_PARSER_PROTOTYPE(config_parse_log_filter_patterns); |
cd48e23f | 158 | CONFIG_PARSER_PROTOTYPE(config_parse_open_file); |
054749e4 | 159 | CONFIG_PARSER_PROTOTYPE(config_parse_memory_pressure_watch); |
f975e971 LP |
160 | |
161 | /* gperf prototypes */ | |
c9f7b4d3 | 162 | const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, GPERF_LEN_TYPE length); |
f975e971 | 163 | extern const char load_fragment_gperf_nulstr[]; |