return 0;
}
-int cg_mask_from_string(const char *value, CGroupMask *ret) {
+int cg_mask_from_string(const char *s, CGroupMask *ret) {
CGroupMask m = 0;
assert(ret);
- assert(value);
+ assert(s);
for (;;) {
_cleanup_free_ char *n = NULL;
CGroupController v;
int r;
- r = extract_first_word(&value, &n, NULL, 0);
+ r = extract_first_word(&s, &n, NULL, 0);
if (r < 0)
return r;
if (r == 0)
0; \
})
-#define _DEFINE_TRIVIAL_REF_FUNC(type, name, scope) \
- scope type *name##_ref(type *p) { \
- if (!p) \
- return NULL; \
- \
- /* For type check. */ \
- unsigned *q = &p->n_ref; \
- assert(*q > 0); \
- assert_se(*q < UINT_MAX); \
- \
- (*q)++; \
- return p; \
+#define _DEFINE_TRIVIAL_REF_FUNC(type, name, scope) \
+ /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
+ scope type *name##_ref(type *p) { \
+ if (!p) \
+ return NULL; \
+ \
+ /* For type check. */ \
+ unsigned *q = &p->n_ref; \
+ assert(*q > 0); \
+ assert_se(*q < UINT_MAX); \
+ \
+ (*q)++; \
+ return p; \
}
-#define _DEFINE_TRIVIAL_UNREF_FUNC(type, name, free_func, scope) \
- scope type *name##_unref(type *p) { \
- if (!p) \
- return NULL; \
- \
- assert(p->n_ref > 0); \
- p->n_ref--; \
- if (p->n_ref > 0) \
- return NULL; \
- \
- return free_func(p); \
+#define _DEFINE_TRIVIAL_UNREF_FUNC(type, name, free_func, scope) \
+ /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
+ scope type *name##_unref(type *p) { \
+ if (!p) \
+ return NULL; \
+ \
+ assert(p->n_ref > 0); \
+ p->n_ref--; \
+ if (p->n_ref > 0) \
+ return NULL; \
+ \
+ return free_func(p); \
}
#define DEFINE_TRIVIAL_REF_FUNC(type, name) \
#endif
}
-int decompress_stream_lz4(int in, int out, uint64_t max_bytes) {
+int decompress_stream_lz4(int fdf, int fdt, uint64_t max_bytes) {
#if HAVE_LZ4
size_t c;
_cleanup_(LZ4F_freeDecompressionContextp) LZ4F_decompressionContext_t ctx = NULL;
if (sym_LZ4F_isError(c))
return -ENOMEM;
- if (fstat(in, &st) < 0)
+ if (fstat(fdf, &st) < 0)
return log_debug_errno(errno, "fstat() failed: %m");
if (file_offset_beyond_memory_size(st.st_size))
if (!buf)
return -ENOMEM;
- src = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, in, 0);
+ src = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fdf, 0);
if (src == MAP_FAILED)
return -errno;
goto cleanup;
}
- r = loop_write(out, buf, produced);
+ r = loop_write(fdt, buf, produced);
if (r < 0)
goto cleanup;
}
} Compression;
const char* compression_to_string(Compression compression) _const_;
-Compression compression_from_string(const char *compression) _pure_;
+Compression compression_from_string(const char *s) _pure_;
const char* compression_lowercase_to_string(Compression compression) _const_;
-Compression compression_lowercase_from_string(const char *compression) _pure_;
+Compression compression_lowercase_from_string(const char *s) _pure_;
bool compression_supported(Compression c);
int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_uncompressed_size);
int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_uncompressed_size);
-int decompress_stream_xz(int fdf, int fdt, uint64_t max_size);
-int decompress_stream_lz4(int fdf, int fdt, uint64_t max_size);
-int decompress_stream_zstd(int fdf, int fdt, uint64_t max_size);
+int decompress_stream_xz(int fdf, int fdt, uint64_t max_bytes);
+int decompress_stream_lz4(int fdf, int fdt, uint64_t max_bytes);
+int decompress_stream_zstd(int fdf, int fdt, uint64_t max_bytes);
int dlopen_lz4(void);
int dlopen_zstd(void);
int efi_get_variable_string(const char *variable, char **ret);
int efi_get_variable_path(const char *variable, char **ret);
int efi_set_variable(const char *variable, const void *value, size_t size) _nonnull_if_nonzero_(2, 3);
-int efi_set_variable_string(const char *variable, const char *p);
+int efi_set_variable_string(const char *variable, const char *value);
bool is_efi_boot(void);
bool is_efi_secure_boot(void);
return 0;
}
-char** strv_env_clean_with_callback(char **e, void (*invalid_callback)(const char *p, void *userdata), void *userdata) {
+char** strv_env_clean_with_callback(char **l, void (*invalid_callback)(const char *p, void *userdata), void *userdata) {
int k = 0;
- STRV_FOREACH(p, e) {
+ STRV_FOREACH(p, l) {
size_t n;
bool duplicate = false;
continue;
}
- e[k++] = *p;
+ l[k++] = *p;
}
- if (e)
- e[k] = NULL;
+ if (l)
+ l[k] = NULL;
- return e;
+ return l;
}
static int strv_extend_with_length(char ***l, const char *s, size_t n) {
int fclose_nointr(FILE *f);
FILE* safe_fclose(FILE *f);
-DIR* safe_closedir(DIR *f);
+DIR* safe_closedir(DIR *d);
static inline void closep(int *fd) {
safe_close(*fd);
return 0;
}
-int mkfifoat_atomic(int atfd, const char *path, mode_t mode) {
+int mkfifoat_atomic(int dir_fd, const char *path, mode_t mode) {
_cleanup_free_ char *t = NULL;
int r;
if (r < 0)
return r;
- if (mkfifoat(atfd, t, mode) < 0)
+ if (mkfifoat(dir_fd, t, mode) < 0)
return -errno;
- r = RET_NERRNO(renameat(atfd, t, atfd, path));
+ r = RET_NERRNO(renameat(dir_fd, t, dir_fd, path));
if (r < 0) {
- (void) unlinkat(atfd, t, 0);
+ (void) unlinkat(dir_fd, t, 0);
return r;
}
char, string_hash_func, string_compare_func, free,
char*, strv_free);
-void path_hash_func(const char *q, struct siphash *state) {
+void path_hash_func(const char *p, struct siphash *state) {
bool add_slash = false;
- assert(q);
+ assert(p);
assert(state);
/* Calculates a hash for a path in a way this duplicate inner slashes don't make a differences, and also
* which begin in a slash or not) will hash differently though. */
/* if path is absolute, add one "/" to the hash. */
- if (path_is_absolute(q))
+ if (path_is_absolute(p))
siphash24_compress_byte('/', state);
for (;;) {
const char *e;
int r;
- r = path_find_first_component(&q, true, &e);
+ r = path_find_first_component(&p, true, &e);
if (r == 0)
return;
if (r < 0) {
/* if a component is invalid, then add remaining part as a string. */
- string_hash_func(q, state);
+ string_hash_func(p, state);
return;
}
return entry_value(h, e);
}
-void* hashmap_get2(Hashmap *h, const void *key, void **key2) {
+void* hashmap_get2(Hashmap *h, const void *key, void **ret) {
struct plain_hashmap_entry *e;
unsigned hash, idx;
return NULL;
e = plain_bucket_at(h, idx);
- if (key2)
- *key2 = (void*) e->b.key;
+ if (ret)
+ *ret = (void*) e->b.key;
return e->value;
}
return data;
}
-void* hashmap_remove2(Hashmap *h, const void *key, void **rkey) {
+void* hashmap_remove2(Hashmap *h, const void *key, void **ret) {
struct plain_hashmap_entry *e;
unsigned hash, idx;
void *data;
if (!h) {
- if (rkey)
- *rkey = NULL;
+ if (ret)
+ *ret = NULL;
return NULL;
}
hash = bucket_hash(h, key);
idx = bucket_scan(h, hash, key);
if (idx == IDX_NIL) {
- if (rkey)
- *rkey = NULL;
+ if (ret)
+ *ret = NULL;
return NULL;
}
e = plain_bucket_at(h, idx);
data = e->value;
- if (rkey)
- *rkey = (void*) e->b.key;
+ if (ret)
+ *ret = (void*) e->b.key;
remove_entry(h, idx);
return _hashmap_get(HASHMAP_BASE(h), key);
}
-void* hashmap_get2(Hashmap *h, const void *key, void **rkey);
-static inline void *ordered_hashmap_get2(OrderedHashmap *h, const void *key, void **rkey) {
- return hashmap_get2(PLAIN_HASHMAP(h), key, rkey);
+void* hashmap_get2(Hashmap *h, const void *key, void **ret);
+static inline void *ordered_hashmap_get2(OrderedHashmap *h, const void *key, void **ret) {
+ return hashmap_get2(PLAIN_HASHMAP(h), key, ret);
}
bool _hashmap_contains(HashmapBase *h, const void *key);
return _hashmap_remove(HASHMAP_BASE(h), key);
}
-void* hashmap_remove2(Hashmap *h, const void *key, void **rkey);
-static inline void *ordered_hashmap_remove2(OrderedHashmap *h, const void *key, void **rkey) {
- return hashmap_remove2(PLAIN_HASHMAP(h), key, rkey);
+void* hashmap_remove2(Hashmap *h, const void *key, void **ret);
+static inline void *ordered_hashmap_remove2(OrderedHashmap *h, const void *key, void **ret) {
+ return hashmap_remove2(PLAIN_HASHMAP(h), key, ret);
}
void* _hashmap_remove_value(HashmapBase *h, const void *key, void *value);
size_t l,
bool secure,
void **ret_data,
- size_t *ret_len) {
+ size_t *ret_size) {
_cleanup_free_ uint8_t *buf = NULL;
size_t buf_size;
*z = 0;
- if (ret_len)
- *ret_len = (size_t) (z - buf);
+ if (ret_size)
+ *ret_size = (size_t) (z - buf);
if (ret_data)
*ret_data = TAKE_PTR(buf);
size_t plen,
const void *p,
size_t l,
- size_t margin,
+ size_t indent,
size_t width);
int unbase64mem_full(const char *p, size_t l, bool secure, void **ret_data, size_t *ret_size) _nonnull_if_nonzero_(1, 2);
static inline int unbase64mem(const char *p, void **ret_data, size_t *ret_size) {
_VARIABLE_LC_INVALID = -EINVAL,
} LocaleVariable;
-int get_locales(char ***l);
+int get_locales(char ***ret);
bool locale_is_valid(const char *name);
int locale_is_installed(const char *name);
return 0;
}
-int strv_make_nulstr(char * const *l, char **p, size_t *n);
+int strv_make_nulstr(char * const *l, char **ret, size_t *ret_size);
int set_make_nulstr(Set *s, char **ret, size_t *ret_size);
return 0;
}
-int parse_nice(const char *p, int *ret) {
+int parse_nice(const char *s, int *ret) {
int n, r;
- r = safe_atoi(p, &n);
+ r = safe_atoi(s, &n);
if (r < 0)
return r;
int parse_fd(const char *t);
int parse_user_shell(const char *s, char **ret_sh, bool *ret_copy);
-int parse_capability_set(const char *s, uint64_t initial, uint64_t *capability_set);
+int parse_capability_set(const char *s, uint64_t initial, uint64_t *current);
#define SAFE_ATO_REFUSE_PLUS_MINUS (1U << 30)
#define SAFE_ATO_REFUSE_LEADING_ZERO (1U << 29)
int safe_atou_bounded(const char *s, unsigned min, unsigned max, unsigned *ret);
int safe_atoi(const char *s, int *ret_i);
-int safe_atolli(const char *s, long long *ret_i);
+int safe_atolli(const char *s, long long *ret_lli);
int safe_atou8_full(const char *s, unsigned base, uint8_t *ret);
int safe_atod(const char *s, double *ret_d);
-int parse_fractional_part_u(const char **s, size_t digits, unsigned *res);
+int parse_fractional_part_u(const char **p, size_t digits, unsigned *res);
-int parse_nice(const char *p, int *ret);
+int parse_nice(const char *s, int *ret);
int parse_ip_port(const char *s, uint16_t *ret);
int parse_ip_port_range(const char *s, uint16_t *low, uint16_t *high, bool allow_zero);
int pidref_kill_and_sigcont(const PidRef *pidref, int sig);
int pidref_sigqueue(const PidRef *pidref, int sig, int value);
-int pidref_wait(PidRef *pidref, siginfo_t *siginfo, int options);
+int pidref_wait(PidRef *pidref, siginfo_t *ret, int options);
int pidref_wait_for_terminate(PidRef *pidref, siginfo_t *ret);
static inline void pidref_done_sigkill_wait(PidRef *pidref) {
int proc_cmdline_parse(proc_cmdline_parse_t parse, void *userdata, ProcCmdlineFlags flags);
-int proc_cmdline_get_key(const char *parameter, ProcCmdlineFlags flags, char **ret_value);
+int proc_cmdline_get_key(const char *key, ProcCmdlineFlags flags, char **ret_value);
int proc_cmdline_get_bool(const char *key, ProcCmdlineFlags flags, bool *ret);
int proc_cmdline_get_key_many_internal(ProcCmdlineFlags flags, ...);
int pid_is_kernel_thread(pid_t pid);
int pidref_is_kernel_thread(const PidRef *pid);
-int getenv_for_pid(pid_t pid, const char *field, char **_value);
+int getenv_for_pid(pid_t pid, const char *field, char **ret);
int pid_is_alive(pid_t pid);
int pidref_is_alive(const PidRef *pidref);
const char* sigchld_code_to_string(int i) _const_;
int sigchld_code_from_string(const char *s) _pure_;
-int sched_policy_to_string_alloc(int i, char **s);
+int sched_policy_to_string_alloc(int i, char **ret);
int sched_policy_from_string(const char *s);
static inline pid_t PTR_TO_PID(const void *p) {
return procfs_memory_get(NULL, ret);
}
-int convert_meminfo_value_to_uint64_bytes(const char *word, uint64_t *ret);
+int convert_meminfo_value_to_uint64_bytes(const char *s, uint64_t *ret);
int sha256_fd(int fd, uint64_t max_size, uint8_t ret[static SHA256_DIGEST_SIZE]);
-int parse_sha256(const char *s, uint8_t res[static SHA256_DIGEST_SIZE]);
+int parse_sha256(const char *s, uint8_t ret[static SHA256_DIGEST_SIZE]);
bool sha256_is_valid(const char *s) _pure_;
return r;
}
-int sigprocmask_many_internal(int how, sigset_t *old, ...) {
+int sigprocmask_many_internal(int how, sigset_t *ret_old_mask, ...) {
va_list ap;
sigset_t ss;
int r;
if (sigemptyset(&ss) < 0)
return -errno;
- va_start(ap, old);
+ va_start(ap, ret_old_mask);
r = sigset_add_many_ap(&ss, ap);
va_end(ap);
if (r < 0)
return r;
- return RET_NERRNO(sigprocmask(how, &ss, old));
+ return RET_NERRNO(sigprocmask(how, &ss, ret_old_mask));
}
static const char *const static_signal_table[] = {
int sigprocmask_many_internal(int how, sigset_t *ret_old_mask, ...);
#define sigprocmask_many(...) sigprocmask_many_internal(__VA_ARGS__, -1)
-const char* signal_to_string(int i) _const_;
+const char* signal_to_string(int signo) _const_;
int signal_from_string(const char *s) _pure_;
void nop_signal_handler(int sig);
bool socket_address_can_accept(const SocketAddress *a) _pure_;
int socket_address_verify(const SocketAddress *a, bool strict) _pure_;
-int socket_address_print(const SocketAddress *a, char **p);
+int socket_address_print(const SocketAddress *a, char **ret);
bool socket_address_matches_fd(const SocketAddress *a, int fd);
bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_;
int socknameinfo_pretty(const struct sockaddr *sa, socklen_t salen, char **_ret);
-int netlink_family_to_string_alloc(int b, char **s);
+int netlink_family_to_string_alloc(int i, char **ret);
int netlink_family_from_string(const char *s) _pure_;
bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b);
return fd_set_rcvbuf(fd, n, true);
}
-int ip_tos_to_string_alloc(int i, char **s);
+int ip_tos_to_string_alloc(int i, char **ret);
int ip_tos_from_string(const char *s);
typedef enum {
ssize_t string_table_lookup_from_string_fallback(const char * const *table, size_t len, const char *s, size_t max);
/* For basic lookup tables with strictly enumerated entries */
-#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type, scope) \
- scope const char* name##_to_string(type i) { \
- return string_table_lookup_to_string(name##_table, ELEMENTSOF(name##_table), i); \
+#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type, scope) \
+ /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
+ scope const char* name##_to_string(type i) { \
+ return string_table_lookup_to_string(name##_table, ELEMENTSOF(name##_table), i); \
}
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name, type, scope) \
return (type) string_table_lookup_from_string_with_boolean(name##_table, ELEMENTSOF(name##_table), s, yes); \
}
-#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max, scope) \
- scope int name##_to_string_alloc(type i, char **ret) { \
+#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max, scope) \
+ /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
+ scope int name##_to_string_alloc(type i, char **ret) { \
return string_table_lookup_to_string_fallback(name##_table, ELEMENTSOF(name##_table), i, max, ret); \
}
return x;
}
-char* ascii_strlower(char *t) {
- assert(t);
+char* ascii_strlower(char *s) {
+ assert(s);
- for (char *p = t; *p; p++)
+ for (char *p = s; *p; p++)
*p = ascii_tolower(*p);
- return t;
+ return s;
}
-char* ascii_strupper(char *t) {
- assert(t);
+char* ascii_strupper(char *s) {
+ assert(s);
- for (char *p = t; *p; p++)
+ for (char *p = s; *p; p++)
*p = ascii_toupper(*p);
- return t;
+ return s;
}
-char* ascii_strlower_n(char *t, size_t n) {
+char* ascii_strlower_n(char *s, size_t n) {
if (n <= 0)
- return t;
+ return s;
for (size_t i = 0; i < n; i++)
- t[i] = ascii_tolower(t[i]);
+ s[i] = ascii_tolower(s[i]);
- return t;
+ return s;
}
int ascii_strcasecmp_n(const char *a, const char *b, size_t n) {
free(strvs);
}
-char** strv_copy_n(char * const *l, size_t m) {
+char** strv_copy_n(char * const *l, size_t n) {
_cleanup_strv_free_ char **result = NULL;
char **k;
- result = new(char*, MIN(strv_length(l), m) + 1);
+ result = new(char*, MIN(strv_length(l), n) + 1);
if (!result)
return NULL;
k = result;
STRV_FOREACH(i, l) {
- if (m == 0)
+ if (n == 0)
break;
*k = strdup(*i);
return NULL;
k++;
- if (m != SIZE_MAX)
- m--;
+ if (n != SIZE_MAX)
+ n--;
}
*k = NULL;
#include "stdio-util.h"
char* sysctl_normalize(char *s);
-int sysctl_read(const char *property, char **value);
+int sysctl_read(const char *property, char **ret);
int sysctl_write_full(const char *property, const char *value, Hashmap **shadow);
int sysctl_writef(const char *property, const char *format, ...) _printf_(2, 3);
static inline int sysctl_write(const char *property, const char *value) {
#include "basic-forward.h"
-int log_facility_unshifted_to_string_alloc(int i, char **s);
+int log_facility_unshifted_to_string_alloc(int i, char **ret);
int log_facility_unshifted_from_string(const char *s);
bool log_facility_unshifted_is_valid(int faciliy);
-int log_level_to_string_alloc(int i, char **s);
+int log_level_to_string_alloc(int i, char **ret);
int log_level_from_string(const char *s);
bool log_level_is_valid(int level);
int chvt(int vt);
int read_one_char(FILE *f, char *ret, usec_t timeout, bool echo, bool *need_nl);
-int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4);
+int ask_char(char *ret, const char *replies, const char *fmt, ...) _printf_(3, 4);
typedef int (*GetCompletionsCallback)(const char *key, char ***ret_list, void *userdata);
-int ask_string_full(char **ret, GetCompletionsCallback cb, void *userdata, const char *text, ...) _printf_(4, 5);
+int ask_string_full(char **ret, GetCompletionsCallback get_completions, void *userdata, const char *text, ...) _printf_(4, 5);
#define ask_string(ret, text, ...) ask_string_full(ret, NULL, NULL, text, ##__VA_ARGS__)
bool any_key_to_proceed(void);
int show_menu(char **x, size_t n_columns, size_t column_width, unsigned ellipsize_percentage, const char *grey_prefix, bool with_numbers);
-int vt_disallocate(const char *name);
+int vt_disallocate(const char *tty_path);
int resolve_dev_console(char **ret);
int get_kernel_consoles(char ***ret);
const char* freezer_state_to_string(FreezerState i) _const_;
FreezerState freezer_state_from_string(const char *s) _pure_;
-FreezerState freezer_state_finish(FreezerState i) _const_;
+FreezerState freezer_state_finish(FreezerState state) _const_;
FreezerState freezer_state_objective(FreezerState state) _const_;
const char* unit_marker_to_string(UnitMarker m) _const_;
}
int slice_build_parent_slice(const char *slice, char **ret);
-int slice_build_subslice(const char *slice, const char *name, char **subslice);
+int slice_build_subslice(const char *slice, const char *name, char **ret);
bool slice_name_is_valid(const char *name);
bool unit_name_prefix_equal(const char *a, const char *b);
int in_gid(gid_t gid);
int in_group(const char *name);
-int merge_gid_lists(const gid_t *list1, size_t size1, const gid_t *list2, size_t size2, gid_t **result);
+int merge_gid_lists(const gid_t *list1, size_t size1, const gid_t *list2, size_t size2, gid_t **ret);
int getgroups_alloc(gid_t **ret);
int get_home_dir(char **ret);
/* offset= */ 0,
/* size= */ 0,
&content,
- /* content_size= */ NULL);
+ /* ret_size= */ NULL);
if (err != EFI_SUCCESS)
continue;
return off == 0 ? NULL : (const char *) ((const uint8_t *) base + off);
}
-EFI_STATUS chid_match(const void *chids_buffer, size_t chids_length, uint32_t match_type, const Device **ret_device);
+EFI_STATUS chid_match(
+ const void *hwid_buffer,
+ size_t hwid_length,
+ uint32_t match_type,
+ const Device **ret_device);
#include "efi-string.h"
#include "macro-fundamental.h"
-#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
- scope const char* name##_to_string(type i) { \
- assert(i >= 0 && i < (type) ELEMENTSOF(name##_table)); \
- return name##_table[i]; \
+#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \
+ /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
+ scope const char* name##_to_string(type i) { \
+ assert(i >= 0 && i < (type) ELEMENTSOF(name##_table)); \
+ return name##_table[i]; \
}
#define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name, type, scope) \
/* New stuff is logged as EV_EVENT_TAG */
EFI_STATUS tpm_log_tagged_event(uint32_t pcrindex, EFI_PHYSICAL_ADDRESS buffer, size_t buffer_size, uint32_t event_id, const char16_t *description, bool *ret_measured);
-EFI_STATUS tpm_log_load_options(const char16_t *cmdline, bool *ret_measured);
+EFI_STATUS tpm_log_load_options(const char16_t *load_options, bool *ret_measured);
#else
return EFI_SUCCESS;
}
-static inline EFI_STATUS tpm_log_load_options(const char16_t *cmdline, bool *ret_measured) {
+static inline EFI_STATUS tpm_log_load_options(const char16_t *load_options, bool *ret_measured) {
if (ret_measured)
*ret_measured = false;
return EFI_SUCCESS;
return true;
}
-char16_t **strv_free(char16_t **v) {
- if (!v)
+char16_t **strv_free(char16_t **l) {
+ if (!l)
return NULL;
- for (char16_t **i = v; *i; i++)
+ for (char16_t **i = l; *i; i++)
free(*i);
- return mfree(v);
+ return mfree(l);
}
EFI_STATUS open_directory(
}
void convert_efi_path(char16_t *path);
-char16_t *xstr8_to_path(const char *stra);
+char16_t *xstr8_to_path(const char *str8);
char16_t *mangle_stub_cmdline(char16_t *cmdline);
EFI_STATUS chunked_read(EFI_FILE *file, size_t *size, void *buf);
-EFI_STATUS file_read(EFI_FILE *dir, const char16_t *name, uint64_t offset, size_t size, char **content, size_t *content_size);
+EFI_STATUS file_read(EFI_FILE *dir, const char16_t *name, uint64_t offset, size_t size, char **ret, size_t *ret_size);
EFI_STATUS file_handle_read(EFI_FILE *handle, uint64_t offset, size_t size, char **ret, size_t *ret_size);
static inline void file_closep(EFI_FILE **handle) {
} CrashAction;
const char* crash_action_to_string(CrashAction action);
-CrashAction crash_action_from_string(const char *action);
+CrashAction crash_action_from_string(const char *s);
_noreturn_ void freeze_or_exit_or_reboot(void);
void install_crash_handler(void);
Unit *u,
const char *name,
sd_bus_message *message,
- UnitWriteFlags mode,
+ UnitWriteFlags flags,
sd_bus_error *reterr_error) {
Path *p = PATH(u);
assert(message);
if (u->transient && u->load_state == UNIT_STUB)
- return bus_path_set_transient_property(p, name, message, mode, reterr_error);
+ return bus_path_set_transient_property(p, name, message, flags, reterr_error);
return 0;
}
Unit *u,
const char *name,
sd_bus_message *message,
- UnitWriteFlags mode,
+ UnitWriteFlags flags,
sd_bus_error *reterr_error) {
Timer *t = TIMER(u);
assert(message);
if (u->transient && u->load_state == UNIT_STUB)
- return bus_timer_set_transient_property(t, name, message, mode, reterr_error);
+ return bus_timer_set_transient_property(t, name, message, flags, reterr_error);
return 0;
}
ExecLoadCredential* exec_load_credential_free(ExecLoadCredential *lc);
DEFINE_TRIVIAL_CLEANUP_FUNC(ExecLoadCredential*, exec_load_credential_free);
-ExecImportCredential* exec_import_credential_free(ExecImportCredential *lc);
+ExecImportCredential* exec_import_credential_free(ExecImportCredential *ic);
DEFINE_TRIVIAL_CLEANUP_FUNC(ExecImportCredential*, exec_import_credential_free);
int exec_context_put_load_credential(ExecContext *c, const char *id, const char *path, bool encrypted);
const char *unit,
char **ret);
-int exec_context_destroy_credentials(const ExecContext *c, const char *runtime_root, const char *unit);
+int exec_context_destroy_credentials(const ExecContext *c, const char *runtime_prefix, const char *unit);
int exec_setup_credentials(
const ExecContext *context,
LOG_UNIT_INVOCATION_ID(unit));
}
-static int exec_context_load_environment(const Unit *unit, const ExecContext *c, char ***l);
+static int exec_context_load_environment(const Unit *unit, const ExecContext *c, char ***ret);
int exec_spawn(
Unit *unit,
void exec_context_done(ExecContext *c);
void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix);
-int exec_context_destroy_runtime_directory(const ExecContext *c, const char *runtime_root);
+int exec_context_destroy_runtime_directory(const ExecContext *c, const char *runtime_prefix);
int exec_context_destroy_mount_ns_dir(Unit *u);
const char* exec_context_fdname(const ExecContext *c, int fd_index) _pure_;
void exec_status_dump(const ExecStatus *s, FILE *f, const char *prefix);
void exec_status_reset(ExecStatus *s);
-int exec_shared_runtime_acquire(Manager *m, const ExecContext *c, const char *name, bool create, ExecSharedRuntime **ret);
+int exec_shared_runtime_acquire(Manager *m, const ExecContext *c, const char *id, bool create, ExecSharedRuntime **ret);
ExecSharedRuntime *exec_shared_runtime_destroy(ExecSharedRuntime *r);
ExecSharedRuntime *exec_shared_runtime_unref(ExecSharedRuntime *r);
DEFINE_TRIVIAL_CLEANUP_FUNC(ExecSharedRuntime*, exec_shared_runtime_unref);
#include "unit-serialize.h"
#include "version.h"
-void manager_dump_jobs(Manager *s, FILE *f, char **patterns, const char *prefix) {
+void manager_dump_jobs(Manager *m, FILE *f, char **patterns, const char *prefix) {
Job *j;
- assert(s);
+ assert(m);
assert(f);
- HASHMAP_FOREACH(j, s->jobs) {
+ HASHMAP_FOREACH(j, m->jobs) {
if (!strv_fnmatch_or_empty(patterns, j->unit->id, FNM_NOESCAPE))
continue;
return memstream_finalize(&ms, ret, NULL);
}
-void manager_dump_units(Manager *s, FILE *f, char **patterns, const char *prefix) {
+void manager_dump_units(Manager *m, FILE *f, char **patterns, const char *prefix) {
Unit *u;
const char *t;
- assert(s);
+ assert(m);
assert(f);
- HASHMAP_FOREACH_KEY(u, t, s->units) {
+ HASHMAP_FOREACH_KEY(u, t, m->units) {
if (u->id != t)
continue;
#include "core-forward.h"
-void manager_dump_jobs(Manager *s, FILE *f, char **patterns, const char *prefix);
+void manager_dump_jobs(Manager *m, FILE *f, char **patterns, const char *prefix);
int manager_get_dump_jobs_string(Manager *m, char **patterns, const char *prefix, char **ret);
-void manager_dump_units(Manager *s, FILE *f, char **patterns, const char *prefix);
-void manager_dump(Manager *s, FILE *f, char **patterns, const char *prefix);
+void manager_dump_units(Manager *m, FILE *f, char **patterns, const char *prefix);
+void manager_dump(Manager *m, FILE *f, char **patterns, const char *prefix);
int manager_get_dump_string(Manager *m, char **patterns, char **ret);
void manager_test_summary(Manager *m);
usec_t manager_default_timeout(RuntimeScope scope);
-int manager_new(RuntimeScope scope, ManagerTestRunFlags test_run_flags, Manager **m);
+int manager_new(RuntimeScope scope, ManagerTestRunFlags test_run_flags, Manager **ret);
Manager* manager_free(Manager *m);
DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(show_status, ShowStatus, SHOW_STATUS_YES);
-int parse_show_status(const char *v, ShowStatus *ret) {
- ShowStatus s;
+int parse_show_status(const char *s, ShowStatus *ret) {
+ ShowStatus status;
assert(ret);
- s = show_status_from_string(v);
- if (s < 0 || s == SHOW_STATUS_TEMPORARY)
+ status = show_status_from_string(s);
+ if (status < 0 || status == SHOW_STATUS_TEMPORARY)
return -EINVAL;
- *ret = s;
+ *ret = status;
return 0;
}
static inline bool show_status_on(ShowStatus s) {
return IN_SET(s, SHOW_STATUS_TEMPORARY, SHOW_STATUS_YES);
}
-ShowStatus show_status_from_string(const char *v) _const_;
+ShowStatus show_status_from_string(const char *s) _const_;
const char* show_status_to_string(ShowStatus s) _pure_;
-int parse_show_status(const char *v, ShowStatus *ret);
+int parse_show_status(const char *s, ShowStatus *ret);
-StatusUnitFormat status_unit_format_from_string(const char *v) _const_;
+StatusUnitFormat status_unit_format_from_string(const char *s) _const_;
const char* status_unit_format_to_string(StatusUnitFormat s) _pure_;
int status_vprintf(const char *status, ShowStatusFlags flags, const char *format, va_list ap) _printf_(3,0);
DEFINE_STRING_TABLE_LOOKUP(socket_timestamping, SocketTimestamping);
-SocketTimestamping socket_timestamping_from_string_harder(const char *p) {
+SocketTimestamping socket_timestamping_from_string_harder(const char *s) {
SocketTimestamping t;
int r;
- if (!p)
+ if (!s)
return _SOCKET_TIMESTAMPING_INVALID;
- t = socket_timestamping_from_string(p);
+ t = socket_timestamping_from_string(s);
if (t >= 0)
return t;
/* Let's alternatively support the various other aliases parse_time() accepts for ns and µs here,
* too. */
- if (streq(p, "nsec"))
+ if (streq(s, "nsec"))
return SOCKET_TIMESTAMPING_NS;
- if (STR_IN_SET(p, "usec", "µs", "μs")) /* Accept both small greek letter mu + micro sign unicode codepoints */
+ if (STR_IN_SET(s, "usec", "µs", "μs")) /* Accept both small greek letter mu + micro sign unicode codepoints */
return SOCKET_TIMESTAMPING_US;
- r = parse_boolean(p);
+ r = parse_boolean(s);
if (r < 0)
return _SOCKET_TIMESTAMPING_INVALID;
SocketPeer *socket_peer_ref(SocketPeer *p);
SocketPeer *socket_peer_unref(SocketPeer *p);
-int socket_acquire_peer(Socket *s, int fd, SocketPeer **p);
+int socket_acquire_peer(Socket *s, int fd, SocketPeer **ret);
DEFINE_TRIVIAL_CLEANUP_FUNC(SocketPeer*, socket_peer_unref);
void socket_free_ports(Socket *s);
-int socket_port_to_address(const SocketPort *s, char **ret);
+int socket_port_to_address(const SocketPort *p, char **ret);
int socket_load_service_unit(Socket *s, int cfd, Unit **ret);
SocketResult socket_result_from_string(const char *s) _pure_;
const char* socket_port_type_to_string(SocketPort *p) _pure_;
-SocketType socket_port_type_from_string(const char *p) _pure_;
+SocketType socket_port_type_from_string(const char *s) _pure_;
const char* socket_timestamping_to_string(SocketTimestamping p) _const_;
-SocketTimestamping socket_timestamping_from_string(const char *p) _pure_;
-SocketTimestamping socket_timestamping_from_string_harder(const char *p) _pure_;
+SocketTimestamping socket_timestamping_from_string(const char *s) _pure_;
+SocketTimestamping socket_timestamping_from_string_harder(const char *s) _pure_;
const char* socket_defer_trigger_to_string(SocketDeferTrigger i) _const_;
SocketDeferTrigger socket_defer_trigger_from_string(const char *s) _pure_;
return sd_path_lookup(MANAGER_IS_SYSTEM(u->manager) ? SD_PATH_SYSTEM_SHARED : SD_PATH_USER_SHARED, NULL, ret);
}
-int unit_name_printf(const Unit *u, const char* format, char **ret) {
+int unit_name_printf(const Unit *u, const char *format, char **ret) {
/*
* This will use the passed string as format string and replace the following specifiers (which should all be
* safe for inclusion in unit names):
#include "core-forward.h"
-int unit_name_printf(const Unit *u, const char* text, char **ret);
-int unit_full_printf_full(const Unit *u, const char *text, size_t max_length, char **ret);
+int unit_name_printf(const Unit *u, const char *format, char **ret);
+int unit_full_printf_full(const Unit *u, const char *format, size_t max_length, char **ret);
int unit_full_printf(const Unit *u, const char *text, char **ret);
int unit_path_printf(const Unit *u, const char *text, char **ret);
int unit_fd_printf(const Unit *u, const char *text, char **ret);
/* These functions serialize state for our own usage, i.e.: across a reload/reexec, rather than for being
* passed to a child process. */
-int unit_serialize_state(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs);
+int unit_serialize_state(Unit *u, FILE *f, FDSet *fds, bool switching_root);
int unit_deserialize_state(Unit *u, FILE *f, FDSet *fds);
int unit_deserialize_state_skip(FILE *f);
ActivationDetails *activation_details_new(Unit *trigger_unit);
ActivationDetails *activation_details_ref(ActivationDetails *p);
ActivationDetails *activation_details_unref(ActivationDetails *p);
-void activation_details_serialize(const ActivationDetails *p, FILE *f);
-int activation_details_deserialize(const char *key, const char *value, ActivationDetails **info);
-int activation_details_append_env(const ActivationDetails *info, char ***strv);
-int activation_details_append_pair(const ActivationDetails *info, char ***strv);
+void activation_details_serialize(const ActivationDetails *details, FILE *f);
+int activation_details_deserialize(const char *key, const char *value, ActivationDetails **details);
+int activation_details_append_env(const ActivationDetails *details, char ***strv);
+int activation_details_append_pair(const ActivationDetails *details, char ***strv);
DEFINE_TRIVIAL_CLEANUP_FUNC(ActivationDetails*, activation_details_unref);
typedef struct ActivationDetailsVTable {
/* This should reset all type-specific variables. This should not allocate memory, and is called
* with zero-initialized data. It should hence only initialize variables that need to be set != 0. */
- void (*init)(ActivationDetails *info, Unit *trigger_unit);
+ void (*init)(ActivationDetails *details, Unit *trigger_unit);
/* This should free all type-specific variables. It should be idempotent. */
- void (*done)(ActivationDetails *info);
+ void (*done)(ActivationDetails *details);
/* This should serialize all type-specific variables. */
- void (*serialize)(const ActivationDetails *info, FILE *f);
+ void (*serialize)(const ActivationDetails *details, FILE *f);
/* This should deserialize all type-specific variables, one at a time. */
- int (*deserialize)(const char *key, const char *value, ActivationDetails **info);
+ int (*deserialize)(const char *key, const char *value, ActivationDetails **details);
/* This should format the type-specific variables for the env block of the spawned service,
* and return the number of added items. */
- int (*append_env)(const ActivationDetails *info, char ***strv);
+ int (*append_env)(const ActivationDetails *details, char ***strv);
/* This should append type-specific variables as key/value pairs for the D-Bus property of the job,
* and return the number of added pairs. */
- int (*append_pair)(const ActivationDetails *info, char ***strv);
+ int (*append_pair)(const ActivationDetails *details, char ***strv);
} ActivationDetailsVTable;
extern const ActivationDetailsVTable * const activation_details_vtable[_UNIT_TYPE_MAX];
DEFINE_TRIVIAL_CLEANUP_FUNC(Unit *, unit_free);
int unit_new_for_name(Manager *m, size_t size, const char *name, Unit **ret);
-int unit_add_name(Unit *u, const char *name);
+int unit_add_name(Unit *u, const char *text);
int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_reference, UnitDependencyMask mask);
int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference, UnitDependencyMask mask);
void unit_remove_from_stop_notify_queue(Unit *u);
int unit_merge(Unit *u, Unit *other);
-int unit_merge_by_name(Unit *u, const char *other);
+int unit_merge_by_name(Unit *u, const char *name);
Unit *unit_follow_merge(Unit *u) _pure_;
int unit_set_default_slice(Unit *u);
const char* unit_description(Unit *u) _pure_;
-const char* unit_status_string(Unit *u, char **combined);
+const char* unit_status_string(Unit *u, char **ret_combined_buffer);
bool unit_has_name(const Unit *u, const char *name);
char* unit_concat_strv(char **l, UnitWriteFlags flags);
int unit_write_setting(Unit *u, UnitWriteFlags flags, const char *name, const char *data);
-int unit_write_settingf(Unit *u, UnitWriteFlags mode, const char *name, const char *format, ...) _printf_(4,5);
+int unit_write_settingf(Unit *u, UnitWriteFlags flags, const char *name, const char *format, ...) _printf_(4,5);
int unit_kill_context(Unit *u, KillOperation k);
int unit_set_invocation_id(Unit *u, sd_id128_t id);
int unit_acquire_invocation_id(Unit *u);
-int unit_set_exec_params(Unit *s, ExecParameters *p);
+int unit_set_exec_params(Unit *u, ExecParameters *p);
int unit_fork_helper_process(Unit *u, const char *name, bool into_cgroup, PidRef *ret);
int unit_fork_and_watch_rm_rf(Unit *u, char **paths, PidRef *ret);
uint64_t coredump_storage_size_max(const CoredumpConfig *config);
/* Defined in generated coredump-gperf.c */
-const struct ConfigPerfItem* coredump_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* coredump_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_coredump_storage);
int manager_parse_config_file(Manager *m);
-const struct ConfigPerfItem* homed_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* homed_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_default_storage);
CONFIG_PARSER_PROTOTYPE(config_parse_default_file_system_type);
int home_deactivate(Home *h, bool force, sd_bus_error *error);
int home_create(Home *h, UserRecord *secret, Hashmap *blobs, uint64_t flags, sd_bus_error *error);
int home_remove(Home *h, sd_bus_error *error);
-int home_update(Home *h, UserRecord *new_record, Hashmap *blobs, uint64_t flags, sd_bus_error *error);
+int home_update(Home *h, UserRecord *hr, Hashmap *blobs, uint64_t flags, sd_bus_error *error);
int home_resize(Home *h, uint64_t disk_size, UserRecord *secret, sd_bus_error *error);
int home_passwd(Home *h, UserRecord *new_secret, UserRecord *old_secret, sd_bus_error *error);
int home_unregister(Home *h, sd_bus_error *error);
int home_mount_node(const char *node, const char *fstype, bool discard, unsigned long flags, const char *extra_mount_options);
int home_unshare_and_mkdir(void);
int home_unshare_and_mount(const char *node, const char *fstype, bool discard, unsigned long flags, const char *extra_mount_options);
-int home_move_mount(const char *user_name_and_realm, const char *target);
+int home_move_mount(const char *mount_suffix, const char *target);
int home_shift_uid(int dir_fd, const char *target, uid_t stored_uid, uid_t exposed_uid, int *ret_mount_fd);
#define HOMEWORK_BLOB_FDMAP_FIELD "__systemd_homework_internal_blob_fdmap"
int user_record_synthesize(UserRecord *h, const char *user_name, const char *realm, const char *image_path, UserStorage storage, uid_t uid, gid_t gid);
-int group_record_synthesize(GroupRecord *g, UserRecord *u);
+int group_record_synthesize(GroupRecord *g, UserRecord *h);
typedef enum UserReconcileMode {
USER_RECONCILE_ANY,
int user_record_update_last_changed(UserRecord *h, bool with_password);
int user_record_set_disk_size(UserRecord *h, uint64_t disk_size);
int user_record_set_password(UserRecord *h, char **password, bool prepend);
-int user_record_make_hashed_password(UserRecord *h, char **password, bool extend);
+int user_record_make_hashed_password(UserRecord *h, char **secret, bool extend);
int user_record_set_token_pin(UserRecord *h, char **pin, bool prepend);
int user_record_set_pkcs11_protected_authentication_path_permitted(UserRecord *h, int b);
int user_record_set_fido2_user_presence_permitted(UserRecord *h, int b);
typedef struct CurlGlue CurlGlue;
typedef struct PullJob PullJob;
-int pull_find_old_etags(const char *url, const char *root, int dt, const char *prefix, const char *suffix, char ***etags);
+int pull_find_old_etags(
+ const char *url,
+ const char *root,
+ int dt,
+ const char *prefix,
+ const char *suffix,
+ char ***etags);
-int pull_make_path(const char *url, const char *etag, const char *image_root, const char *prefix, const char *suffix, char **ret);
+int pull_make_path(
+ const char *url,
+ const char *etag,
+ const char *image_root,
+ const char *prefix,
+ const char *suffix,
+ char **ret);
-int pull_make_auxiliary_job(PullJob **ret, const char *url, int (*strip_suffixes)(const char *name, char **ret), const char *suffix, ImportVerify verify, CurlGlue *glue, PullJobOpenDisk on_open_disk, PullJobFinished on_finished, void *userdata);
-int pull_make_verification_jobs(PullJob **ret_checksum_job, PullJob **ret_signature_job, ImportVerify verify, const char *url, CurlGlue *glue, PullJobFinished on_finished, void *userdata);
+int pull_make_auxiliary_job(
+ PullJob **ret,
+ const char *url,
+ int (*strip_suffixes)(const char *name, char **ret),
+ const char *suffix,
+ ImportVerify verify,
+ CurlGlue *glue,
+ PullJobOpenDisk on_open_disk,
+ PullJobFinished on_finished,
+ void *userdata);
+int pull_make_verification_jobs(
+ PullJob **ret_checksum_job,
+ PullJob **ret_signature_job,
+ ImportVerify verify,
+ const char *url,
+ CurlGlue *glue,
+ PullJobFinished on_finished,
+ void *userdata);
-int pull_verify(ImportVerify verify, PullJob *main_job, PullJob *checksum_job, PullJob *signature_job, PullJob *settings_job, PullJob *roothash_job, PullJob *roothash_signature_job, PullJob *verity_job);
+int pull_verify(
+ ImportVerify verify,
+ PullJob *main_job,
+ PullJob *checksum_job,
+ PullJob *signature_job,
+ PullJob *settings_job,
+ PullJob *roothash_job,
+ PullJob *roothash_signature_job,
+ PullJob *verity_job);
typedef enum VerificationStyle {
VERIFICATION_PER_FILE, /* SUSE-style ".sha256" files with detached gpg signature */
_VERIFICATION_STYLE_INVALID = -EINVAL,
} VerificationStyle;
-int verification_style_from_url(const char *url, VerificationStyle *style);
+int verification_style_from_url(const char *url, VerificationStyle *ret);
typedef enum SignatureStyle {
SIGNATURE_GPG_PER_FILE, /* ".sha256" files with detached .gpg signature */
_SIGNATURE_STYLE_INVALID = -EINVAL,
} SignatureStyle;
-int signature_style_from_url(const char *url, SignatureStyle *style, char **ret_filename);
+int signature_style_from_url(const char *url, SignatureStyle *ret, char **ret_filename);
int pull_job_restart_with_sha256sum(PullJob *job, char **ret);
int pull_job_restart_with_signature(PullJob *job, char **ret);
#if HAVE_MICROHTTPD
-static int null_timer_event_handler(sd_event_source *s,
- uint64_t usec,
- void *userdata);
-static int dispatch_http_event(sd_event_source *event,
- int fd,
- uint32_t revents,
- void *userdata);
+static int null_timer_event_handler(sd_event_source *timer_event, uint64_t usec, void *userdata);
+static int dispatch_http_event(sd_event_source *event, int fd, uint32_t revents, void *userdata);
static int build_accept_encoding(char **ret) {
assert(ret);
DEFINE_TRIVIAL_CLEANUP_FUNC(Writer*, writer_unref);
-int writer_write(Writer *s,
+int writer_write(Writer *w,
const struct iovec_wrapper *iovw,
const dual_timestamp *ts,
const sd_id128_t *boot_id,
int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
/* Defined in generated journald-gperf.c */
-const struct ConfigPerfItem* journald_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* journald_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
const char* storage_to_string(Storage s) _const_;
Storage storage_from_string(const char *s) _pure_;
const struct ucred *ucred,
const char *label, size_t label_size,
const char *unit_id,
- usec_t tstamp);
+ usec_t timestamp);
void manager_refresh_client_contexts_on_reload(Manager *m, usec_t old_interval, unsigned old_burst);
void client_context_acquire_default(Manager *m);
/* audit: Maximum number of extra fields we'll import from audit messages */
#define N_IOVEC_AUDIT_FIELDS 64
-void manager_dispatch_message(Manager *m, struct iovec *iovec, size_t n, size_t k, ClientContext *c, const struct timeval *tv, int priority, pid_t object_pid);
+void manager_dispatch_message(Manager *m, struct iovec *iovec, size_t n, size_t mm, ClientContext *c, const struct timeval *tv, int priority, pid_t object_pid);
void manager_driver_message_internal(Manager *m, pid_t object_pid, const char *format, ...) _sentinel_;
#define manager_driver_message(...) manager_driver_message_internal(__VA_ARGS__, NULL)
void manager_forward_syslog(Manager *m, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv);
-void manager_process_syslog_message(Manager *m, const char *buf, size_t buf_len, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len);
+void manager_process_syslog_message(Manager *m, const char *buf, size_t raw_len, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len);
int manager_open_syslog_socket(Manager *m, const char *syslog_socket);
void manager_maybe_warn_forward_syslog_missed(Manager *m);
size_t optlen,
const void *optval);
int dhcp_option_find_option(uint8_t *options, size_t length, uint8_t wanted_code, size_t *ret_offset);
-int dhcp_option_remove_option(uint8_t *options, size_t buflen, uint8_t option_code);
+int dhcp_option_remove_option(uint8_t *options, size_t length, uint8_t option_code);
typedef int (*dhcp_option_callback_t)(uint8_t code, uint8_t len, const void *option, void *userdata);
#include "fuzz.h"
#include "sd-dhcp-server.c"
-ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) {
- return len;
+ssize_t sendto(int __fd, const void *__buf, size_t __n, int flags, const struct sockaddr *__addr, socklen_t __addr_len) {
+ return __n;
}
-ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) {
+ssize_t sendmsg(int __fd, const struct msghdr *__message, int flags) {
return 0;
}
#include "tmpfile-util.h"
/* stub out network so that the server doesn't send */
-ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) {
- return len;
+ssize_t sendto(int __fd, const void *__buf, size_t __n, int flags, const struct sockaddr *__addr, socklen_t __addr_len) {
+ return __n;
}
-ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) {
+ssize_t sendmsg(int __fd, const struct msghdr *__message, int flags) {
return 0;
}
int icmp6_receive(
int fd,
- void *iov_base,
- size_t iov_len,
+ void *buffer,
+ size_t size,
struct in6_addr *ret_sender,
triple_timestamp *ret_timestamp) {
- assert_se(read (fd, iov_base, iov_len) == (ssize_t) iov_len);
+ assert_se(read(fd, buffer, size) == (ssize_t) size);
if (ret_timestamp)
triple_timestamp_now(ret_timestamp);
size_t size,
bool *with_leading_space,
bool (*predicate)(const struct in_addr *addr));
-int deserialize_in_addrs(struct in_addr **addresses, const char *string);
+int deserialize_in_addrs(struct in_addr **ret, const char *string);
void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses,
size_t size,
bool *with_leading_space);
-int deserialize_in6_addrs(struct in6_addr **addresses, const char *string);
+int deserialize_in6_addrs(struct in6_addr **ret, const char *string);
int serialize_dnr(FILE *f, const sd_dns_resolver *dnr, size_t n_dnr, bool *with_leading_space);
int deserialize_dnr(sd_dns_resolver **ret, const char *string);
return 0;
}
-int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **tz) {
+int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **ret) {
assert_return(lease, -EINVAL);
- assert_return(tz, -EINVAL);
+ assert_return(ret, -EINVAL);
if (!lease->timezone)
return -ENODATA;
- *tz = lease->timezone;
+ *ret = lease->timezone;
return 0;
}
#include "bus-type.h"
#include "string-util.h"
-_public_ int sd_bus_message_send(sd_bus_message *reply) {
- assert_return(reply, -EINVAL);
- assert_return(reply->bus, -EINVAL);
- assert_return(!bus_origin_changed(reply->bus), -ECHILD);
+_public_ int sd_bus_message_send(sd_bus_message *m) {
+ assert_return(m, -EINVAL);
+ assert_return(m->bus, -EINVAL);
+ assert_return(!bus_origin_changed(m->bus), -ECHILD);
- return sd_bus_send(reply->bus, reply, NULL);
+ return sd_bus_send(m->bus, m, NULL);
}
_public_ int sd_bus_emit_signal_tov(
_public_ int sd_bus_reply_method_errno(
sd_bus_message *call,
int error,
- const sd_bus_error *p) {
+ const sd_bus_error *e) {
_cleanup_(sd_bus_error_free) sd_bus_error berror = SD_BUS_ERROR_NULL;
if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
return 0;
- if (sd_bus_error_is_set(p))
- return sd_bus_reply_method_error(call, p);
+ if (sd_bus_error_is_set(e))
+ return sd_bus_reply_method_error(call, e);
sd_bus_error_set_errno(&berror, error);
return r;
}
-_public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_bus_creds **ret) {
+_public_ int sd_bus_query_sender_creds(sd_bus_message *m, uint64_t mask, sd_bus_creds **ret) {
uint64_t missing;
sd_bus_creds *c;
- assert_return(call, -EINVAL);
- assert_return(call->sealed, -EPERM);
- assert_return(call->bus, -EINVAL);
- assert_return(!bus_origin_changed(call->bus), -ECHILD);
+ assert_return(m, -EINVAL);
+ assert_return(m->sealed, -EPERM);
+ assert_return(m->bus, -EINVAL);
+ assert_return(!bus_origin_changed(m->bus), -ECHILD);
assert_return(ret, -EINVAL);
- if (!BUS_IS_OPEN(call->bus->state))
+ if (!BUS_IS_OPEN(m->bus->state))
return -ENOTCONN;
- c = sd_bus_message_get_creds(call);
+ c = sd_bus_message_get_creds(m);
if (c)
missing = mask & ~SD_BUS_CREDS_AUGMENT & ~c->mask;
else
}
/* There's a sender, use that */
- if (call->sender && call->bus->bus_client)
- return sd_bus_get_name_creds(call->bus, call->sender, mask, ret);
+ if (m->sender && m->bus->bus_client)
+ return sd_bus_get_name_creds(m->bus, m->sender, mask, ret);
/* There's no sender. For direct connections the credentials of the AF_UNIX peer matter, which may be
* queried via sd_bus_get_owner_creds(). */
- return sd_bus_get_owner_creds(call->bus, mask, ret);
+ return sd_bus_get_owner_creds(m->bus, mask, ret);
}
-_public_ int sd_bus_query_sender_privilege(sd_bus_message *call, int capability) {
+_public_ int sd_bus_query_sender_privilege(sd_bus_message *m, int capability) {
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL;
uid_t our_uid;
bool know_caps = false;
int r;
- assert_return(call, -EINVAL);
- assert_return(call->sealed, -EPERM);
- assert_return(call->bus, -EINVAL);
- assert_return(!bus_origin_changed(call->bus), -ECHILD);
+ assert_return(m, -EINVAL);
+ assert_return(m->sealed, -EPERM);
+ assert_return(m->bus, -EINVAL);
+ assert_return(!bus_origin_changed(m->bus), -ECHILD);
- if (!BUS_IS_OPEN(call->bus->state))
+ if (!BUS_IS_OPEN(m->bus->state))
return -ENOTCONN;
if (capability >= 0) {
- r = sd_bus_query_sender_creds(call, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_EFFECTIVE_CAPS, &creds);
+ r = sd_bus_query_sender_creds(m, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_EFFECTIVE_CAPS, &creds);
if (r < 0)
return r;
if (r == 0)
know_caps = true;
} else {
- r = sd_bus_query_sender_creds(call, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID, &creds);
+ r = sd_bus_query_sender_creds(m, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID, &creds);
if (r < 0)
return r;
}
int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse);
-int bus_pcap_header(size_t snaplen, const char *os, const char *app, FILE *f);
+int bus_pcap_header(size_t snaplen, const char *os, const char *info, FILE *f);
int bus_message_pcap_frame(sd_bus_message *m, size_t snaplen, FILE *f);
BUS_MATCH_DRIVER,
} BusMatchScope;
-int bus_match_run(sd_bus *bus, BusMatchNode *root, sd_bus_message *m);
+int bus_match_run(sd_bus *bus, BusMatchNode *node, sd_bus_message *m);
int bus_match_add(BusMatchNode *root, BusMatchComponent *components, size_t n_components, BusMatchCallback *callback);
int bus_match_remove(BusMatchNode *root, BusMatchCallback *callback);
sd_bus_message *call,
sd_bus_message **ret,
int error,
- const sd_bus_error *p) {
+ const sd_bus_error *e) {
_cleanup_(sd_bus_error_free) sd_bus_error berror = SD_BUS_ERROR_NULL;
- if (sd_bus_error_is_set(p))
- return sd_bus_message_new_method_error(call, ret, p);
+ if (sd_bus_error_is_set(e))
+ return sd_bus_message_new_method_error(call, ret, e);
sd_bus_error_set_errno(&berror, error);
int bus_body_part_map(BusMessageBodyPart *part);
void bus_body_part_unmap(BusMessageBodyPart *part);
-int bus_message_new_synthetic_error(sd_bus *bus, uint64_t serial, const sd_bus_error *e, sd_bus_message **m);
+int bus_message_new_synthetic_error(sd_bus *bus, uint64_t cookie, const sd_bus_error *e, sd_bus_message **m);
int bus_message_remarshal(sd_bus *bus, sd_bus_message **m);
return bus_default(bus_open, busp, ret);
}
-_public_ int sd_bus_get_tid(sd_bus *b, pid_t *tid) {
+_public_ int sd_bus_get_tid(sd_bus *b, pid_t *ret) {
assert_return(b, -EINVAL);
- assert_return(tid, -EINVAL);
+ assert_return(ret, -EINVAL);
assert_return(!bus_origin_changed(b), -ECHILD);
if (b->tid != 0) {
- *tid = b->tid;
+ *ret = b->tid;
return 0;
}
if (b->event)
- return sd_event_get_tid(b->event, tid);
+ return sd_event_get_tid(b->event, ret);
return -ENXIO;
}
}
int device_set_syspath(sd_device *device, const char *_syspath, bool verify);
-int device_set_ifindex(sd_device *device, const char *ifindex);
+int device_set_ifindex(sd_device *device, const char *name);
int device_set_devuid(sd_device *device, const char *uid);
int device_set_devgid(sd_device *device, const char *gid);
int device_set_devmode(sd_device *device, const char *devmode);
int device_add_devlink(sd_device *device, const char *devlink);
int device_remove_devlink(sd_device *device, const char *devlink);
bool device_has_devlink(sd_device *device, const char *devlink);
-int device_add_property(sd_device *device, const char *property, const char *value);
+int device_add_property(sd_device *device, const char *key, const char *value);
int device_add_propertyf(sd_device *device, const char *key, const char *format, ...) _printf_(3, 4);
int device_add_tag(sd_device *device, const char *tag, bool both);
void device_remove_tag(sd_device *device, const char *tag);
}
}
-_public_ int sd_device_get_parent(sd_device *child, sd_device **ret) {
+_public_ int sd_device_get_parent(sd_device *device, sd_device **ret) {
int r;
- assert_return(child, -EINVAL);
+ assert_return(device, -EINVAL);
- if (!child->parent_set) {
- r = device_new_from_child(&child->parent, child);
+ if (!device->parent_set) {
+ r = device_new_from_child(&device->parent, device);
if (r < 0 && r != -ENODEV)
return r;
- child->parent_set = true;
+ device->parent_set = true;
}
- if (!child->parent)
+ if (!device->parent)
return -ENOENT;
if (ret)
- *ret = child->parent;
+ *ret = device->parent;
return 0;
}
return 0;
}
-_public_ int sd_device_get_devtype(sd_device *device, const char **devtype) {
+_public_ int sd_device_get_devtype(sd_device *device, const char **ret) {
int r;
assert_return(device, -EINVAL);
if (!device->devtype)
return -ENOENT;
- if (devtype)
- *devtype = device->devtype;
+ if (ret)
+ *ret = device->devtype;
return 0;
}
return 0;
}
-_public_ int sd_device_get_devname(sd_device *device, const char **devname) {
+_public_ int sd_device_get_devname(sd_device *device, const char **ret) {
int r;
assert_return(device, -EINVAL);
assert(!isempty(path_startswith(device->devname, "/dev/")));
- if (devname)
- *devname = device->devname;
+ if (ret)
+ *ret = device->devname;
return 0;
}
return 1;
}
-_public_ int sd_event_source_set_enabled(sd_event_source *s, int m) {
+_public_ int sd_event_source_set_enabled(sd_event_source *s, int enabled) {
int r;
- assert_return(IN_SET(m, SD_EVENT_OFF, SD_EVENT_ON, SD_EVENT_ONESHOT), -EINVAL);
+ assert_return(IN_SET(enabled, SD_EVENT_OFF, SD_EVENT_ON, SD_EVENT_ONESHOT), -EINVAL);
/* Quick mode: if the source doesn't exist, SD_EVENT_OFF is a noop. */
- if (m == SD_EVENT_OFF && !s)
+ if (enabled == SD_EVENT_OFF && !s)
return 0;
assert_return(s, -EINVAL);
/* If we are dead anyway, we are fine with turning off sources, but everything else needs to fail. */
if (s->event->state == SD_EVENT_FINISHED)
- return m == SD_EVENT_OFF ? 0 : -ESTALE;
+ return enabled == SD_EVENT_OFF ? 0 : -ESTALE;
- if (s->enabled == m) /* No change? */
+ if (s->enabled == enabled) /* No change? */
return 0;
- if (m == SD_EVENT_OFF)
- r = event_source_offline(s, m, s->ratelimited);
+ if (enabled == SD_EVENT_OFF)
+ r = event_source_offline(s, enabled, s->ratelimited);
else
- r = event_source_online(s, m, s->ratelimited);
+ r = event_source_online(s, enabled, s->ratelimited);
if (r < 0)
return r;
int journal_file_parse_verification_key(JournalFile *f, const char *key);
int journal_file_fsprg_evolve(JournalFile *f, uint64_t realtime);
-int journal_file_fsprg_seek(JournalFile *f, uint64_t epoch);
+int journal_file_fsprg_seek(JournalFile *f, uint64_t goal);
bool journal_file_next_evolve_usec(JournalFile *f, usec_t *u);
JournalFile **ret);
int journal_file_set_offline_thread_join(JournalFile *f);
-JournalFile* journal_file_close(JournalFile *j);
+JournalFile* journal_file_close(JournalFile *f);
int journal_file_fstat(JournalFile *f);
DEFINE_TRIVIAL_CLEANUP_FUNC(JournalFile*, journal_file_close);
SD_JOURNAL_INCLUDE_DEFAULT_NAMESPACE | \
SD_JOURNAL_ASSUME_IMMUTABLE)
-_public_ int sd_journal_open_namespace(sd_journal **ret, const char *namespace, int flags) {
+_public_ int sd_journal_open_namespace(sd_journal **ret, const char *name_space, int flags) {
_cleanup_(sd_journal_closep) sd_journal *j = NULL;
int r;
assert_return(ret, -EINVAL);
assert_return((flags & ~OPEN_ALLOWED_FLAGS) == 0, -EINVAL);
- j = journal_new(flags, NULL, namespace);
+ j = journal_new(flags, NULL, name_space);
if (!j)
return -ENOMEM;
return true;
}
-_public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *size) {
+_public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *length) {
JournalFile *f;
size_t field_length;
Object *o;
assert_return(!journal_origin_changed(j), -ECHILD);
assert_return(field, -EINVAL);
assert_return(data, -EINVAL);
- assert_return(size, -EINVAL);
+ assert_return(length, -EINVAL);
assert_return(field_is_valid(field), -EINVAL);
f = j->current_file;
return r;
*data = d;
- *size = l;
+ *length = l;
return 0;
}
return -ENOENT;
}
-_public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *size) {
+_public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *length) {
JournalFile *f;
Object *o;
int r;
assert_return(j, -EINVAL);
assert_return(!journal_origin_changed(j), -ECHILD);
assert_return(data, -EINVAL);
- assert_return(size, -EINVAL);
+ assert_return(length, -EINVAL);
f = j->current_file;
if (!f)
assert(r > 0);
*data = d;
- *size = l;
+ *length = l;
j->current_field++;
return 0;
}
-_public_ int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *size) {
+_public_ int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *length) {
for (;;) {
int r;
- r = sd_journal_enumerate_data(j, data, size);
+ r = sd_journal_enumerate_data(j, data, length);
if (r >= 0)
return r;
if (!JOURNAL_ERRNO_IS_UNAVAILABLE_FIELD(r))
}
}
-_public_ int sd_journal_get_usage(sd_journal *j, uint64_t *ret) {
+_public_ int sd_journal_get_usage(sd_journal *j, uint64_t *ret_bytes) {
JournalFile *f;
uint64_t sum = 0;
assert_return(j, -EINVAL);
assert_return(!journal_origin_changed(j), -ECHILD);
- assert_return(ret, -EINVAL);
+ assert_return(ret_bytes, -EINVAL);
ORDERED_HASHMAP_FOREACH(f, j->files) {
struct stat st;
sum += b;
}
- *ret = sum;
+ *ret_bytes = sum;
return 0;
}
return 0;
}
-_public_ sd_json_variant *sd_json_variant_by_index(sd_json_variant *v, size_t idx) {
+_public_ sd_json_variant *sd_json_variant_by_index(sd_json_variant *v, size_t index) {
if (!v)
return NULL;
if (v == JSON_VARIANT_MAGIC_EMPTY_ARRAY ||
if (!IN_SET(v->type, SD_JSON_VARIANT_ARRAY, SD_JSON_VARIANT_OBJECT))
goto mismatch;
if (v->is_reference)
- return sd_json_variant_by_index(v->reference, idx);
- if (idx >= v->n_elements)
+ return sd_json_variant_by_index(v->reference, index);
+ if (index >= v->n_elements)
return NULL;
- return json_variant_conservative_formalize(v + 1 + idx);
+ return json_variant_conservative_formalize(v + 1 + index);
mismatch:
log_debug("Element in non-array/non-object JSON variant requested by index, returning NULL.");
return sd_json_variant_set_field_string(v, field, SD_ID128_TO_UUID_STRING(value));
}
-_public_ int sd_json_variant_set_field_integer(sd_json_variant **v, const char *field, int64_t i) {
+_public_ int sd_json_variant_set_field_integer(sd_json_variant **v, const char *field, int64_t value) {
_cleanup_(sd_json_variant_unrefp) sd_json_variant *m = NULL;
int r;
- r = sd_json_variant_new_integer(&m, i);
+ r = sd_json_variant_new_integer(&m, value);
if (r < 0)
return r;
return sd_json_variant_set_field(v, field, m);
}
-_public_ int sd_json_variant_set_field_unsigned(sd_json_variant **v, const char *field, uint64_t u) {
+_public_ int sd_json_variant_set_field_unsigned(sd_json_variant **v, const char *field, uint64_t value) {
_cleanup_(sd_json_variant_unrefp) sd_json_variant *m = NULL;
int r;
- r = sd_json_variant_new_unsigned(&m, u);
+ r = sd_json_variant_new_unsigned(&m, value);
if (r < 0)
return r;
}
_public_ int sd_json_parse_with_source(
- const char *input,
+ const char *string,
const char *source,
sd_json_parse_flags_t flags,
sd_json_variant **ret,
_cleanup_(json_source_unrefp) JsonSource *s = NULL;
- if (isempty(input))
+ if (isempty(string))
return -ENODATA;
if (source) {
return -ENOMEM;
}
- return json_parse_internal(&input, s, flags, ret, reterr_line, reterr_column, false);
+ return json_parse_internal(&string, s, flags, ret, reterr_line, reterr_column, false);
}
_public_ int sd_json_parse_with_source_continue(
return IN_SET(r, -ENXIO, -ENOMEDIUM) ? -ENODATA : r;
}
-_public_ int sd_pid_get_machine_name(pid_t pid, char **ret_name) {
+_public_ int sd_pid_get_machine_name(pid_t pid, char **ret_machine) {
int r;
assert_return(pid >= 0, -EINVAL);
- r = cg_pid_get_machine_name(pid, ret_name);
+ r = cg_pid_get_machine_name(pid, ret_machine);
return IN_SET(r, -ENXIO, -ENOMEDIUM) ? -ENODATA : r;
}
return 0;
}
-_public_ int sd_pidfd_get_machine_name(int pidfd, char **ret_name) {
+_public_ int sd_pidfd_get_machine_name(int pidfd, char **ret_machine) {
_cleanup_free_ char *name = NULL;
pid_t pid;
int r;
if (r < 0)
return r;
- if (ret_name)
- *ret_name = TAKE_PTR(name);
+ if (ret_machine)
+ *ret_machine = TAKE_PTR(name);
return 0;
}
return 0;
}
-_public_ int sd_uid_get_display(uid_t uid, char **ret_session) {
+_public_ int sd_uid_get_display(uid_t uid, char **ret_display) {
_cleanup_free_ char *p = NULL, *s = NULL;
int r;
if (isempty(s))
return -ENODATA;
- if (ret_session)
- *ret_session = TAKE_PTR(s);
+ if (ret_display)
+ *ret_display = TAKE_PTR(s);
return 0;
}
return session_get_string(session, "TYPE", ret_type);
}
-_public_ int sd_session_get_class(const char *session, char **ret_class) {
- return session_get_string(session, "CLASS", ret_class);
+_public_ int sd_session_get_class(const char *session, char **ret_clazz) {
+ return session_get_string(session, "CLASS", ret_clazz);
}
_public_ int sd_session_get_desktop(const char *session, char **ret_desktop) {
return r;
}
-_public_ int sd_machine_get_class(const char *machine, char **ret_class) {
+_public_ int sd_machine_get_class(const char *machine, char **ret_clazz) {
_cleanup_free_ char *c = NULL;
int r;
return -EIO;
}
- if (ret_class)
- *ret_class = TAKE_PTR(c);
+ if (ret_clazz)
+ *ret_clazz = TAKE_PTR(c);
return 0;
}
int sd_nfnl_send_batch(
sd_netlink *nfnl,
sd_netlink_message **messages,
- size_t msgcount,
+ size_t n_messages,
uint32_t **ret_serials);
int sd_nfnl_call_batch(
sd_netlink *nfnl,
int nfproto, const char *table, const char *chain);
int sd_nfnl_nft_message_new_set(sd_netlink *nfnl, sd_netlink_message **ret,
int nfproto, const char *table, const char *set_name,
- uint32_t setid, uint32_t klen);
+ uint32_t set_id, uint32_t klen);
int sd_nfnl_nft_message_new_setelems(sd_netlink *nfnl, sd_netlink_message **ret,
int add, int nfproto, const char *table, const char *set_name);
int sd_nfnl_nft_message_append_setelem(sd_netlink_message *m,
return IN_SET(type, RTM_NEWNSID, RTM_DELNSID, RTM_GETNSID);
}
-#define DEFINE_RTNL_MESSAGE_SETTER(class, header_type, element, name, value_type) \
+#define DEFINE_RTNL_MESSAGE_SETTER(class, header_type, element, name, value_type) \
+ /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type value) { \
assert_return(m, -EINVAL); \
assert_return(m->hdr, -EINVAL); \
}
#define DEFINE_RTNL_MESSAGE_PREFIXLEN_SETTER(class, header_type, family_element, element, name, value_type) \
+ /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \
int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type value) { \
assert_return(m, -EINVAL); \
assert_return(m->hdr, -EINVAL); \
size_t *ret_header_size);
const NLAPolicy *policy_set_get_policy(const NLAPolicySet *policy_set, uint16_t attr_type);
-const NLAPolicySet *policy_set_get_policy_set(const NLAPolicySet *type_system, uint16_t attr_type);
-const NLAPolicySetUnion *policy_set_get_policy_set_union(const NLAPolicySet *type_system, uint16_t attr_type);
+const NLAPolicySet *policy_set_get_policy_set(const NLAPolicySet *policy_set, uint16_t attr_type);
+const NLAPolicySetUnion *policy_set_get_policy_set_union(const NLAPolicySet *policy_set, uint16_t attr_type);
uint16_t policy_set_union_get_match_attribute(const NLAPolicySetUnion *policy_set_union);
-const NLAPolicySet *policy_set_union_get_policy_set_by_string(const NLAPolicySetUnion *type_system_union, const char *string);
-const NLAPolicySet *policy_set_union_get_policy_set_by_family(const NLAPolicySetUnion *type_system_union, int family);
+const NLAPolicySet *policy_set_union_get_policy_set_by_string(const NLAPolicySetUnion *policy_set_union, const char *string);
+const NLAPolicySet *policy_set_union_get_policy_set_by_family(const NLAPolicySetUnion *policy_set_union, int family);
int netlink_message_append_in_addr_union(sd_netlink_message *m, unsigned short type, int family, const union in_addr_union *data);
int netlink_message_append_sockaddr_union(sd_netlink_message *m, unsigned short type, const union sockaddr_union *data);
-int netlink_message_read_hw_addr(sd_netlink_message *m, unsigned short type, struct hw_addr_data *data);
-int netlink_message_read_in_addr_union(sd_netlink_message *m, unsigned short type, int family, union in_addr_union *data);
+int netlink_message_read_hw_addr(sd_netlink_message *m, unsigned short type, struct hw_addr_data *ret);
+int netlink_message_read_in_addr_union(sd_netlink_message *m, unsigned short type, int family, union in_addr_union *ret);
void rtattr_append_attribute_internal(struct rtattr *rta, unsigned short type, const void *data, size_t data_length);
int rtattr_append_attribute(struct rtattr **rta, unsigned short type, const void *data, size_t data_length);
size_t netlink_get_reply_callback_count(sd_netlink *nl);
/* TODO: to be exported later */
-int sd_netlink_sendv(sd_netlink *nl, sd_netlink_message **messages, size_t msgcnt, uint32_t **ret_serial);
+int sd_netlink_sendv(sd_netlink *nl, sd_netlink_message **messages, size_t msgcount, uint32_t **ret_serial);
int sd_netlink_read(
sd_netlink *nl,
uint32_t serial,
- uint64_t usec,
+ uint64_t timeout,
sd_netlink_message **ret) {
- usec_t timeout;
+ usec_t usec;
int r;
assert_return(nl, -EINVAL);
assert_return(!netlink_pid_changed(nl), -ECHILD);
- timeout = timespan_to_timestamp(usec);
+ usec = timespan_to_timestamp(timeout);
for (;;) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL;
/* received message, so try to process straight away */
continue;
- if (timeout != USEC_INFINITY) {
+ if (usec != USEC_INFINITY) {
usec_t n;
n = now(CLOCK_MONOTONIC);
- if (n >= timeout)
+ if (n >= usec)
return -ETIMEDOUT;
- left = usec_sub_unsigned(timeout, n);
+ left = usec_sub_unsigned(usec, n);
} else
left = USEC_INFINITY;
int sd_netlink_call(
sd_netlink *nl,
sd_netlink_message *message,
- uint64_t usec,
+ uint64_t timeout,
sd_netlink_message **ret) {
uint32_t serial;
if (r < 0)
return r;
- return sd_netlink_read(nl, serial, usec, ret);
+ return sd_netlink_read(nl, serial, timeout, ret);
}
int sd_netlink_get_events(sd_netlink *nl) {
return wd;
}
-int sd_network_monitor_new(sd_network_monitor **m, const char *category) {
+int sd_network_monitor_new(sd_network_monitor **ret, const char *category) {
_cleanup_close_ int fd = -EBADF;
int k;
bool good = false;
- assert_return(m, -EINVAL);
+ assert_return(ret, -EINVAL);
fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC);
if (fd < 0)
if (!good)
return -EINVAL;
- *m = FD_TO_MONITOR(TAKE_FD(fd));
+ *ret = FD_TO_MONITOR(TAKE_FD(fd));
return 0;
}
#include "sd-resolve.h"
int resolve_getaddrinfo_with_destroy_callback(
- sd_resolve *resolve, sd_resolve_query **q,
+ sd_resolve *resolve, sd_resolve_query **ret,
const char *node, const char *service, const struct addrinfo *hints,
sd_resolve_getaddrinfo_handler_t callback,
sd_resolve_destroy_t destroy_callback, void *userdata);
int resolve_getnameinfo_with_destroy_callback(
- sd_resolve *resolve, sd_resolve_query **q,
+ sd_resolve *resolve, sd_resolve_query **ret,
const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get,
sd_resolve_getnameinfo_handler_t callback,
sd_resolve_destroy_t destroy_callback, void *userdata);
int resolve_getnameinfo_with_destroy_callback(
sd_resolve *resolve,
- sd_resolve_query **ret_query,
+ sd_resolve_query **ret,
const struct sockaddr *sa, socklen_t salen,
int flags,
uint64_t get,
assert_return(callback, -EINVAL);
assert_return(!resolve_pid_changed(resolve), -ECHILD);
- r = alloc_query(resolve, !ret_query, &q);
+ r = alloc_query(resolve, !ret, &q);
if (r < 0)
return r;
resolve->n_outstanding++;
q->destroy_callback = destroy_callback;
- if (ret_query)
- *ret_query = q;
+ if (ret)
+ *ret = q;
TAKE_PTR(q);
return 0;
}
-_public_ int sd_varlink_bind_reply(sd_varlink *v, sd_varlink_reply_t callback) {
+_public_ int sd_varlink_bind_reply(sd_varlink *v, sd_varlink_reply_t reply) {
assert_return(v, -EINVAL);
- if (callback && v->reply_callback && callback != v->reply_callback)
+ if (reply && v->reply_callback && reply != v->reply_callback)
return varlink_log_errno(v, SYNTHETIC_ERRNO(EBUSY), "A different callback was already set.");
- v->reply_callback = callback;
+ v->reply_callback = reply;
return 0;
}
return r;
}
-_public_ int sd_varlink_server_bind_connect(sd_varlink_server *s, sd_varlink_connect_t callback) {
+_public_ int sd_varlink_server_bind_connect(sd_varlink_server *s, sd_varlink_connect_t connect) {
assert_return(s, -EINVAL);
- if (callback && s->connect_callback && callback != s->connect_callback)
+ if (connect && s->connect_callback && connect != s->connect_callback)
return varlink_server_log_errno(s, SYNTHETIC_ERRNO(EBUSY), "A different callback was already set.");
- s->connect_callback = callback;
+ s->connect_callback = connect;
return 0;
}
-_public_ int sd_varlink_server_bind_disconnect(sd_varlink_server *s, sd_varlink_disconnect_t callback) {
+_public_ int sd_varlink_server_bind_disconnect(sd_varlink_server *s, sd_varlink_disconnect_t disconnect) {
assert_return(s, -EINVAL);
- if (callback && s->disconnect_callback && callback != s->disconnect_callback)
+ if (disconnect && s->disconnect_callback && disconnect != s->disconnect_callback)
return varlink_server_log_errno(s, SYNTHETIC_ERRNO(EBUSY), "A different callback was already set.");
- s->disconnect_callback = callback;
+ s->disconnect_callback = disconnect;
return 0;
}
int manager_handle_action(
Manager *m,
InhibitWhat inhibit_key,
- HandleAction handle,
+ HandleAction action,
bool ignore_inhibited,
bool is_edge,
const char *action_seat) {
assert(m);
- assert(handle_action_valid(handle));
+ assert(handle_action_valid(action));
/* If the key handling is turned off, don't do anything */
- if (handle == HANDLE_IGNORE) {
+ if (action == HANDLE_IGNORE) {
log_debug("Handling of %s (%s) is disabled, taking no action.",
inhibit_key == 0 ? "idle timeout" : inhibit_what_to_string(inhibit_key),
is_edge ? "edge" : "level");
if (inhibit_key > 0) {
if (manager_is_inhibited(m, inhibit_key, NULL, MANAGER_IS_INHIBITED_IGNORE_INACTIVE, UID_INVALID, NULL)) {
log_debug("Refusing %s operation, %s is inhibited.",
- handle_action_to_string(handle),
+ handle_action_to_string(action),
inhibit_what_to_string(inhibit_key));
return 0;
}
}
/* Locking and greeter activation is handled differently from the rest. */
- if (handle == HANDLE_LOCK) {
+ if (action == HANDLE_LOCK) {
if (!is_edge)
return 0;
return 1;
}
- if (handle == HANDLE_SECURE_ATTENTION_KEY)
+ if (action == HANDLE_SECURE_ATTENTION_KEY)
return manager_handle_action_secure_attention_key(m, is_edge, action_seat);
- if (HANDLE_ACTION_IS_SLEEP(handle))
- return handle_action_sleep_execute(m, handle, ignore_inhibited, is_edge);
+ if (HANDLE_ACTION_IS_SLEEP(action))
+ return handle_action_sleep_execute(m, action, ignore_inhibited, is_edge);
- return handle_action_execute(m, handle, ignore_inhibited, is_edge);
+ return handle_action_execute(m, action, ignore_inhibited, is_edge);
}
static const char* const handle_action_verb_table[_HANDLE_ACTION_MAX] = {
int manager_handle_action(
Manager *m,
InhibitWhat inhibit_key,
- HandleAction handle,
+ HandleAction action,
bool ignore_inhibited,
bool is_edge,
const char *action_seat);
const char* handle_action_to_string(HandleAction h) _const_;
HandleAction handle_action_from_string(const char *s) _pure_;
-const HandleActionData* handle_action_lookup(HandleAction handle);
+const HandleActionData* handle_action_lookup(HandleAction action);
CONFIG_PARSER_PROTOTYPE(config_parse_handle_action);
return w > 0 && w < _INHIBIT_WHAT_MAX;
}
-const char* inhibit_what_to_string(InhibitWhat k);
+const char* inhibit_what_to_string(InhibitWhat w);
int inhibit_what_from_string(const char *s);
const char* inhibit_mode_to_string(InhibitMode k);
int session_load(Session *s);
int session_kill(Session *s, KillWhom whom, int signo, sd_bus_error *error);
-SessionState session_get_state(Session *u);
+SessionState session_get_state(Session *s);
const char* session_state_to_string(SessionState t) _const_;
SessionState session_state_from_string(const char *s) _pure_;
extern const BusObjectImplementation user_object;
-char* user_bus_path(User *s);
+char* user_bus_path(User *u);
int user_send_signal(User *u, bool new_user);
int user_send_changed_strv(User *u, char **properties);
int manager_get_idle_hint(Manager *m, dual_timestamp *t);
-int manager_get_user_by_pid(Manager *m, pid_t pid, User **user);
+int manager_get_user_by_pid(Manager *m, pid_t pid, User **ret);
int manager_get_session_by_pidref(Manager *m, const PidRef *pid, Session **ret);
int manager_get_session_by_leader(Manager *m, const PidRef *pid, Session **ret);
bool manager_all_buttons_ignored(Manager *m);
/* gperf lookup function */
-const struct ConfigPerfItem* logind_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* logind_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
int manager_set_lid_switch_ignore(Manager *m, usec_t until);
extern const BusObjectImplementation machine_object;
-char* machine_bus_path(Machine *s);
+char* machine_bus_path(Machine *m);
int bus_machine_method_unregister(sd_bus_message *message, void *userdata, sd_bus_error *error);
int bus_machine_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error);
manager_enqueue_gc(m->manager);
}
-MachineState machine_get_state(Machine *s) {
- assert(s);
+MachineState machine_get_state(Machine *m) {
+ assert(m);
- if (s->class == MACHINE_HOST)
+ if (m->class == MACHINE_HOST)
return MACHINE_RUNNING;
- if (s->stopping)
+ if (m->stopping)
return MACHINE_CLOSING;
- if (s->scope_job)
+ if (m->scope_job)
return MACHINE_OPENING;
return MACHINE_RUNNING;
void machine_release_unit(Machine *m);
-MachineState machine_get_state(Machine *u);
+MachineState machine_get_state(Machine *m);
const char* machine_class_to_string(MachineClass t) _const_;
MachineClass machine_class_from_string(const char *s) _pure_;
_cleanup_free_ struct local_address *addresses = NULL;
int n;
- n = local_addresses(/* rtnl = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses);
+ n = local_addresses(/* context = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses);
if (n < 0)
return log_debug_errno(n, "Failed to get local addresses: %m");
pair[0] = safe_close(pair[0]);
- int n = local_addresses(/* rtnl = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses);
+ int n = local_addresses(/* context = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses);
if (n < 0) {
log_debug_errno(n, "Failed to get local addresses: %m");
_exit(EXIT_FAILURE);
int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job);
int manager_kill_unit(Manager *manager, const char *unit, const char *subgroup, int signo, sd_bus_error *error);
int manager_unref_unit(Manager *m, const char *unit, sd_bus_error *error);
-int manager_unit_is_active(Manager *manager, const char *unit, sd_bus_error *reterr_errno);
-int manager_job_is_active(Manager *manager, const char *path, sd_bus_error *reterr_errno);
+int manager_unit_is_active(Manager *manager, const char *unit, sd_bus_error *reterr_error);
+int manager_job_is_active(Manager *manager, const char *path, sd_bus_error *reterr_error);
int manager_find_machine_for_uid(Manager *m, uid_t host_uid, Machine **ret_machine, uid_t *ret_internal_uid);
int manager_find_machine_for_gid(Manager *m, gid_t host_gid, Machine **ret_machine, gid_t *ret_internal_gid);
extern const NetDevVTable bare_udp_vtable;
const char* bare_udp_protocol_to_string(BareUDPProtocol d) _const_;
-BareUDPProtocol bare_udp_protocol_from_string(const char *d) _pure_;
+BareUDPProtocol bare_udp_protocol_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_bare_udp_iftype);
extern const NetDevVTable foutnl_vtable;
const char* fou_encap_type_to_string(FooOverUDPEncapType d) _const_;
-FooOverUDPEncapType fou_encap_type_from_string(const char *d) _pure_;
+FooOverUDPEncapType fou_encap_type_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type);
CONFIG_PARSER_PROTOTYPE(config_parse_fou_tunnel_address);
extern const NetDevVTable geneve_vtable;
const char* geneve_df_to_string(GeneveDF d) _const_;
-GeneveDF geneve_df_from_string(const char *d) _pure_;
+GeneveDF geneve_df_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_geneve_vni);
CONFIG_PARSER_PROTOTYPE(config_parse_geneve_address);
DEFINE_NETDEV_CAST(HSR, Hsr);
extern const NetDevVTable hsr_vtable;
-HsrProtocol hsr_protocol_from_string(const char *d) _pure_;
+HsrProtocol hsr_protocol_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_hsr_protocol);
bool netdev_is_managed(NetDev *netdev);
int netdev_get(Manager *manager, const char *name, NetDev **ret);
void link_assign_netdev(Link *link);
-int netdev_set_ifindex(NetDev *netdev, sd_netlink_message *newlink);
-int netdev_generate_hw_addr(NetDev *netdev, Link *link, const char *name,
+int netdev_set_ifindex(NetDev *netdev, sd_netlink_message *message);
+int netdev_generate_hw_addr(NetDev *netdev, Link *parent, const char *name,
const struct hw_addr_data *hw_addr, struct hw_addr_data *ret);
bool netdev_needs_reconfigure(NetDev *netdev, NetDevLocalAddressType type);
int link_request_stacked_netdev(Link *link, NetDev *netdev);
const char* netdev_kind_to_string(NetDevKind d) _const_;
-NetDevKind netdev_kind_from_string(const char *d) _pure_;
+NetDevKind netdev_kind_from_string(const char *s) _pure_;
static inline NetDevCreateType netdev_get_create_type(NetDev *netdev) {
assert(netdev);
CONFIG_PARSER_PROTOTYPE(config_parse_netdev_hw_addr);
/* gperf */
-const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
/* Macros which append INTERFACE= to the message */
extern const NetDevVTable erspan_vtable;
const char* tunnel_mode_to_string(TunnelMode d) _const_;
-TunnelMode tunnel_mode_from_string(const char *d) _pure_;
+TunnelMode tunnel_mode_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_mode);
CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_local_address);
extern const NetDevVTable vxlan_vtable;
const char* df_to_string(VxLanDF d) _const_;
-VxLanDF df_from_string(const char *d) _pure_;
+VxLanDF df_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_address);
CONFIG_PARSER_PROTOTYPE(config_parse_port_range);
return r;
}
- link_update_operstate(link, /* also_update_bond_master = */ true);
+ link_update_operstate(link, /* also_update_master = */ true);
link_check_ready(link);
return 0;
}
}
}
- link_update_operstate(link, /* also_update_bond_master = */ true);
+ link_update_operstate(link, /* also_update_master = */ true);
link_check_ready(link);
return 0;
}
int manager_parse_config_file(Manager *m);
-const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* networkd_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
int link_get_captive_portal(Link *link, const char **ret);
const char* dhcp_option_data_type_to_string(DHCPOptionDataType d) _const_;
-DHCPOptionDataType dhcp_option_data_type_from_string(const char *d) _pure_;
+DHCPOptionDataType dhcp_option_data_type_from_string(const char *s) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp);
CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_route_metric);
void link_set_state(Link *link, LinkState state);
void link_check_ready(Link *link);
-void link_update_operstate(Link *link, bool also_update_bond_master);
+void link_update_operstate(Link *link, bool also_update_master);
bool link_has_carrier(Link *link);
bool link_multicast_enabled(Link *link);
int manager_enumerate(Manager *m);
int manager_set_hostname(Manager *m, const char *hostname);
-int manager_set_timezone(Manager *m, const char *timezone);
+int manager_set_timezone(Manager *m, const char *tz);
int manager_reload(Manager *m, sd_bus_message *message);
CONFIG_PARSER_PROTOTYPE(config_parse_link_group);
CONFIG_PARSER_PROTOTYPE(config_parse_ignore_carrier_loss);
-const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* network_network_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
const char* keep_configuration_to_string(KeepConfiguration i) _const_;
KeepConfiguration keep_configuration_from_string(const char *s) _pure_;
int route_flags_to_string_alloc(uint32_t flags, char **ret);
-int manager_get_route_table_from_string(const Manager *m, const char *table, uint32_t *ret);
+int manager_get_route_table_from_string(const Manager *m, const char *s, uint32_t *ret);
int manager_get_route_table_to_string(const Manager *m, uint32_t table, bool append_num, char **ret);
CONFIG_PARSER_PROTOTYPE(config_parse_route_table_names);
void qdisc_mark_recursive(QDisc *qdisc);
void link_qdisc_drop_marked(Link *link);
-int link_find_qdisc(Link *link, uint32_t handle, const char *kind, QDisc **qdisc);
+int link_find_qdisc(Link *link, uint32_t handle, const char *kind, QDisc **ret);
int link_request_qdisc(Link *link, const QDisc *qdisc);
int tc_init(double *ret_ticks_in_usec, uint32_t *ret_hz);
int tc_time_to_tick(usec_t t, uint32_t *ret);
-int parse_tc_percent(const char *s, uint32_t *percent);
+int parse_tc_percent(const char *s, uint32_t *ret_fraction);
int tc_transmit_time(uint64_t rate, uint32_t size, uint32_t *ret);
int tc_fill_ratespec_and_table(struct tc_ratespec *rate, uint32_t *rtab, uint32_t mtu);
int parse_handle(const char *t, uint32_t *ret);
#include "shared-forward.h"
#include "nspawn-settings.h"
-int oci_load(FILE *f, const char *path, Settings **ret);
+int oci_load(FILE *f, const char *bundle, Settings **ret);
DEFINE_TRIVIAL_CLEANUP_FUNC(Settings*, settings_free);
-const struct ConfigPerfItem* nspawn_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* nspawn_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_capability);
CONFIG_PARSER_PROTOTYPE(config_parse_expose_port);
dirs,
chown_uid,
chown_range,
- /* host_owner= */ UID_INVALID,
+ /* source_owner= */ UID_INVALID,
/* dest_owner= */ UID_INVALID,
mapping);
if (r == -EINVAL || ERRNO_IS_NEG_NOT_SUPPORTED(r)) {
int userns_registry_load_by_start_uid(int dir_fd, uid_t start, UserNamespaceInfo **ret);
int userns_registry_load_by_start_gid(int dir_fd, gid_t start, UserNamespaceInfo **ret);
-int userns_registry_load_by_userns_inode(int dir_fd, uint64_t userns, UserNamespaceInfo **ret);
+int userns_registry_load_by_userns_inode(int dir_fd, uint64_t inode, UserNamespaceInfo **ret);
int userns_registry_load_by_name(int dir_fd, const char *name, UserNamespaceInfo **ret);
int userns_registry_store(int dir_fd, UserNamespaceInfo *info);
#endif
}
-int userns_restrict_reset_by_inode(
- struct userns_restrict_bpf *obj,
- uint64_t ino) {
+int userns_restrict_reset_by_inode(struct userns_restrict_bpf *obj, uint64_t userns_inode) {
#if HAVE_VMLINUX_H
int r, outer_map_fd;
unsigned u;
assert(obj);
- assert(ino != 0);
+ assert(userns_inode != 0);
- if (ino > UINT32_MAX) /* inodes larger than 32bit are definitely not included in our map, exit early */
+ if (userns_inode > UINT32_MAX) /* inodes larger than 32bit are definitely not included in our map, exit early */
return 0;
outer_map_fd = sym_bpf_map__fd(obj->maps.userns_mnt_id_hash);
if (outer_map_fd < 0)
return log_debug_errno(outer_map_fd, "Failed to get outer BPF map fd: %m");
- u = (uint32_t) ino;
+ u = (uint32_t) userns_inode;
r = sym_bpf_map_delete_elem(outer_map_fd, &u);
if (r < 0)
- return log_debug_errno(r, "Failed to remove entry for inode %" PRIu64 " from outer map: %m", ino);
+ return log_debug_errno(r, "Failed to remove entry for inode %" PRIu64 " from outer map: %m", userns_inode);
return 0;
#else
int oomd_kill_by_swap_usage(Hashmap *h, uint64_t threshold_usage, bool dry_run, char **ret_selected);
int oomd_cgroup_context_acquire(const char *path, OomdCGroupContext **ret);
-int oomd_system_context_acquire(const char *proc_swaps_path, OomdSystemContext *ret);
+int oomd_system_context_acquire(const char *proc_meminfo_path, OomdSystemContext *ret);
/* Get the OomdCGroupContext of `path` and insert it into `new_h`. The key for the inserted context will be `path`.
*
int portable_metadata_hashmap_to_sorted_array(Hashmap *unit_files, PortableMetadata ***ret);
-int portable_extract(RuntimeScope scope, const char *image, char **matches, char **extension_image_paths, const ImagePolicy *image_policy, PortableFlags flags, PortableMetadata **ret_os_release, OrderedHashmap **ret_extension_releases, Hashmap **ret_unit_files, char ***ret_valid_prefixes, sd_bus_error *error);
-
-int portable_attach(RuntimeScope scope, sd_bus *bus, const char *name_or_path, char **matches, const char *profile, char **extension_images, const ImagePolicy* image_policy, PortableFlags flags, PortableChange **changes, size_t *n_changes, sd_bus_error *error);
-int portable_detach(RuntimeScope scope, sd_bus *bus, const char *name_or_path, char **extension_image_paths, PortableFlags flags, PortableChange **changes, size_t *n_changes, sd_bus_error *error);
-
-int portable_get_state(RuntimeScope scope, sd_bus *bus, const char *name_or_path, char **extension_image_paths, PortableFlags flags, PortableState *ret, sd_bus_error *error);
+int portable_extract(
+ RuntimeScope scope,
+ const char *name_or_path,
+ char **matches,
+ char **extension_image_paths,
+ const ImagePolicy *image_policy,
+ PortableFlags flags,
+ PortableMetadata **ret_os_release,
+ OrderedHashmap **ret_extension_releases,
+ Hashmap **ret_unit_files,
+ char ***ret_valid_prefixes,
+ sd_bus_error *error);
+
+int portable_attach(
+ RuntimeScope scope,
+ sd_bus *bus,
+ const char *name_or_path,
+ char **matches,
+ const char *profile,
+ char **extension_image_paths,
+ const ImagePolicy* image_policy,
+ PortableFlags flags,
+ PortableChange **changes,
+ size_t *n_changes,
+ sd_bus_error *error);
+
+int portable_detach(
+ RuntimeScope scope,
+ sd_bus *bus,
+ const char *name_or_path,
+ char **extension_image_paths,
+ PortableFlags flags,
+ PortableChange **changes,
+ size_t *n_changes,
+ sd_bus_error *error);
+
+int portable_get_state(
+ RuntimeScope scope,
+ sd_bus *bus,
+ const char *name_or_path,
+ char **extension_image_paths,
+ PortableFlags flags,
+ PortableState *ret,
+ sd_bus_error *error);
int portable_get_profiles(char ***ret);
void portable_changes_free(PortableChange *changes, size_t n_changes);
const char* portable_change_type_to_string(int t) _const_;
-int portable_change_type_from_string(const char *t) _pure_;
+int portable_change_type_from_string(const char *s) _pure_;
const char* portable_state_to_string(PortableState t) _const_;
-PortableState portable_state_from_string(const char *t) _pure_;
+PortableState portable_state_from_string(const char *s) _pure_;
int manager_parse_config_file(Manager *m);
-const struct ConfigPerfItem* resolved_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* resolved_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_dns_servers);
CONFIG_PARSER_PROTOTYPE(config_parse_search_domains);
int manager_load_delegates(Manager *m);
-const struct ConfigPerfItem* resolved_dns_delegate_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* resolved_dns_delegate_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_delegate_dns_servers);
CONFIG_PARSER_PROTOTYPE(config_parse_delegate_domains);
void dns_query_candidate_notify(DnsQueryCandidate *c);
-int dns_query_new(Manager *m, DnsQuery **q, DnsQuestion *question_utf8, DnsQuestion *question_idna, DnsPacket *question_bypass, int family, uint64_t flags);
+int dns_query_new(Manager *m, DnsQuery **ret, DnsQuestion *question_utf8, DnsQuestion *question_idna, DnsPacket *question_bypass, int ifindex, uint64_t flags);
DnsQuery *dns_query_free(DnsQuery *q);
int dns_query_make_auxiliary(DnsQuery *q, DnsQuery *auxiliary_for);
Link *link,
DnsDelegate *delegate,
int family,
- const union in_addr_union *address,
+ const union in_addr_union *in_addr,
uint16_t port,
int ifindex,
- const char *server_string,
+ const char *server_name,
ResolveConfigSource config_source);
DnsServer* dns_server_ref(DnsServer *s);
void dns_server_unlink_all(DnsServer *first);
void dns_server_unlink_on_reload(DnsServer *server);
bool dns_server_unlink_marked(DnsServer *first);
-void dns_server_mark_all(DnsServer *first);
+void dns_server_mark_all(DnsServer *server);
int manager_parse_search_domains_and_warn(Manager *m, const char *string);
int manager_parse_dns_server_string_and_warn(Manager *m, DnsServerType type, const char *string);
int dns_trust_anchor_load(DnsTrustAnchor *d);
void dns_trust_anchor_flush(DnsTrustAnchor *d);
-int dns_trust_anchor_lookup_positive(DnsTrustAnchor *d, const DnsResourceKey* key, DnsAnswer **answer);
+int dns_trust_anchor_lookup_positive(DnsTrustAnchor *d, const DnsResourceKey* key, DnsAnswer **ret);
int dns_trust_anchor_lookup_negative(DnsTrustAnchor *d, const char *name);
int dns_trust_anchor_check_revoked(DnsTrustAnchor *d, DnsResourceRecord *dnskey, DnsAnswer *rrs);
int dnssd_update_rrs(DnssdRegisteredService *s);
int dnssd_signal_conflict(Manager *manager, const char *name);
-const struct ConfigPerfItem* resolved_dnssd_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* resolved_dnssd_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_dnssd_name);
CONFIG_PARSER_PROTOTYPE(config_parse_dnssd_subtype);
return 0;
}
-int manager_compile_dns_servers(Manager *m, OrderedSet **dns) {
+int manager_compile_dns_servers(Manager *m, OrderedSet **servers) {
Link *l;
int r;
assert(m);
- assert(dns);
+ assert(servers);
- r = ordered_set_ensure_allocated(dns, &dns_server_hash_ops);
+ r = ordered_set_ensure_allocated(servers, &dns_server_hash_ops);
if (r < 0)
return r;
/* First add the system-wide servers and domains */
LIST_FOREACH(servers, s, m->dns_servers) {
- r = ordered_set_put(*dns, s);
+ r = ordered_set_put(*servers, s);
if (r == -EEXIST)
continue;
if (r < 0)
/* Then, add the per-link servers */
HASHMAP_FOREACH(l, m->links)
LIST_FOREACH(servers, s, l->dns_servers) {
- r = ordered_set_put(*dns, s);
+ r = ordered_set_put(*servers, s);
if (r == -EEXIST)
continue;
if (r < 0)
DnsDelegate *d;
HASHMAP_FOREACH(d, m->delegates)
LIST_FOREACH(servers, s, d->dns_servers) {
- r = ordered_set_put(*dns, s);
+ r = ordered_set_put(*servers, s);
if (r == -EEXIST)
continue;
if (r < 0)
}
/* If we found nothing, add the fallback servers */
- if (ordered_set_isempty(*dns)) {
+ if (ordered_set_isempty(*servers)) {
LIST_FOREACH(servers, s, m->fallback_dns_servers) {
- r = ordered_set_put(*dns, s);
+ r = ordered_set_put(*servers, s);
if (r == -EEXIST)
continue;
if (r < 0)
acl_t *ret_acl_access_exec,
acl_t *ret_acl_default,
bool want_mask);
-int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *ret);
+int acls_for_file(const char *path, acl_type_t type, acl_t acl, acl_t *ret);
int fd_add_uid_acl_permission(int fd, uid_t uid, unsigned mask);
int fd_acl_make_read_only(int fd);
#define BARRIER_NULL {-EBADF, -EBADF, {-EBADF, -EBADF}, 0}
-int barrier_create(Barrier *obj);
+int barrier_create(Barrier *b);
Barrier* barrier_destroy(Barrier *b);
DEFINE_TRIVIAL_CLEANUP_FUNC(Barrier*, barrier_destroy);
int block_get_originating(dev_t d, dev_t *ret);
int get_block_device_fd(int fd, dev_t *ret);
-int get_block_device(const char *path, dev_t *dev);
+int get_block_device(const char *path, dev_t *ret);
-int get_block_device_harder_fd(int fd, dev_t *dev);
-int get_block_device_harder(const char *path, dev_t *dev);
+int get_block_device_harder_fd(int fd, dev_t *ret);
+int get_block_device_harder(const char *path, dev_t *ret);
int lock_whole_block_device(dev_t devt, int open_flags, int operation);
} BondPrimaryReselect;
const char* bond_mode_to_string(BondMode d) _const_;
-BondMode bond_mode_from_string(const char *d) _pure_;
+BondMode bond_mode_from_string(const char *s) _pure_;
const char* bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_;
-BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *d) _pure_;
+BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *s) _pure_;
const char* bond_lacp_rate_to_string(BondLacpRate d) _const_;
-BondLacpRate bond_lacp_rate_from_string(const char *d) _pure_;
+BondLacpRate bond_lacp_rate_from_string(const char *s) _pure_;
const char* bond_fail_over_mac_to_string(BondFailOverMac d) _const_;
-BondFailOverMac bond_fail_over_mac_from_string(const char *d) _pure_;
+BondFailOverMac bond_fail_over_mac_from_string(const char *s) _pure_;
const char* bond_ad_select_to_string(BondAdSelect d) _const_;
-BondAdSelect bond_ad_select_from_string(const char *d) _pure_;
+BondAdSelect bond_ad_select_from_string(const char *s) _pure_;
const char* bond_arp_validate_to_string(BondArpValidate d) _const_;
-BondArpValidate bond_arp_validate_from_string(const char *d) _pure_;
+BondArpValidate bond_arp_validate_from_string(const char *s) _pure_;
const char* bond_arp_all_targets_to_string(BondArpAllTargets d) _const_;
-BondArpAllTargets bond_arp_all_targets_from_string(const char *d) _pure_;
+BondArpAllTargets bond_arp_all_targets_from_string(const char *s) _pure_;
const char* bond_primary_reselect_to_string(BondPrimaryReselect d) _const_;
-BondPrimaryReselect bond_primary_reselect_from_string(const char *d) _pure_;
+BondPrimaryReselect bond_primary_reselect_from_string(const char *s) _pure_;
const char *root,
const BootEntrySource source,
const char *dir,
- const char *fname) {
+ const char *filename) {
int r;
assert(config);
assert(f);
assert(root);
assert(dir);
- assert(fname);
+ assert(filename);
if (!GREEDY_REALLOC(config->entries, config->n_entries + 1))
return log_oom();
BootEntry *entry = config->entries + config->n_entries;
- r = boot_entry_load_type1(f, root, source, dir, fname, entry);
+ r = boot_entry_load_type1(f, root, source, dir, filename, entry);
if (r < 0)
return r;
config->n_entries++;
const char *root,
BootEntrySource source,
const char *dir,
- const char *id);
+ const char *filename);
int boot_config_finalize(BootConfig *config);
int boot_config_load(BootConfig *config, const char *esp_path, const char *xbootldr_path);
int boot_config_load_auto(BootConfig *config, const char *override_esp_path, const char *override_xbootldr_path);
-int boot_config_augment_from_loader(BootConfig *config, char **list, bool auto_only);
+int boot_config_augment_from_loader(BootConfig *config, char **found_by_loader, bool auto_only);
int boot_config_select_special_entries(BootConfig *config, bool skip_efivars);
int bpf_serialize_link(FILE *f, FDSet *fds, const char *key, struct bpf_link *link);
-struct bpf_link* bpf_link_free(struct bpf_link *p);
+struct bpf_link* bpf_link_free(struct bpf_link *link);
DEFINE_TRIVIAL_CLEANUP_FUNC(struct bpf_link *, bpf_link_free);
struct ring_buffer* bpf_ring_buffer_free(struct ring_buffer *rb);
int bpf_program_new_from_bpffs_path(const char *path, BPFProgram **ret);
BPFProgram *bpf_program_free(BPFProgram *p);
-int bpf_program_add_instructions(BPFProgram *p, const struct bpf_insn *insn, size_t count);
+int bpf_program_add_instructions(BPFProgram *p, const struct bpf_insn *instructions, size_t count);
int bpf_program_load_kernel(BPFProgram *p, char *log_buf, size_t log_size);
int bpf_program_load_from_bpf_fs(BPFProgram *p, const char *path);
} BridgeState;
const char* bridge_state_to_string(BridgeState d) _const_;
-BridgeState bridge_state_from_string(const char *d) _pure_;
+BridgeState bridge_state_from_string(const char *s) _pure_;
int btrfs_subvol_get_id_fd(int fd, uint64_t *ret);
int btrfs_subvol_get_parent(int fd, uint64_t subvol_id, uint64_t *ret);
-int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *info);
+int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *ret);
int btrfs_subvol_find_subtree_qgroup(int fd, uint64_t subvol_id, uint64_t *ret);
-int btrfs_subvol_get_subtree_quota(const char *path, uint64_t subvol_id, BtrfsQuotaInfo *quota);
-int btrfs_subvol_get_subtree_quota_fd(int fd, uint64_t subvol_id, BtrfsQuotaInfo *quota);
+int btrfs_subvol_get_subtree_quota(const char *path, uint64_t subvol_id, BtrfsQuotaInfo *ret);
+int btrfs_subvol_get_subtree_quota_fd(int fd, uint64_t subvol_id, BtrfsQuotaInfo *ret);
int btrfs_subvol_set_subtree_quota_limit(const char *path, uint64_t subvol_id, uint64_t referenced_max);
int btrfs_subvol_set_subtree_quota_limit_fd(int fd, uint64_t subvol_id, uint64_t referenced_max);
-int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool new_qgroup);
+int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool insert_intermediary_qgroup);
int btrfs_subvol_auto_qgroup(const char *path, uint64_t subvol_id, bool create_intermediary_qgroup);
int btrfs_subvol_make_default(const char *path);
int btrfs_qgroup_find_parents(int fd, uint64_t qgroupid, uint64_t **ret);
-int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *quota);
-int btrfs_qgroup_get_quota(const char *path, uint64_t qgroupid, BtrfsQuotaInfo *quota);
+int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *ret);
+int btrfs_qgroup_get_quota(const char *path, uint64_t qgroupid, BtrfsQuotaInfo *ret);
int btrfs_log_dev_root(int level, int ret, const char *p);
int bus_log_control_api_register(sd_bus *bus);
-int bus_property_get_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
-int bus_property_set_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *value, void *userdata, sd_bus_error *reterr_error);
+int bus_property_get_log_level(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *reterr_error);
+int bus_property_set_log_level(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *value,
+ void *userdata,
+ sd_bus_error *reterr_error);
-int bus_property_get_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
-int bus_property_set_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
+int bus_property_get_log_target(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *reterr_error);
+int bus_property_set_log_target(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *value,
+ void *userdata,
+ sd_bus_error *reterr_error);
-int bus_property_get_syslog_identifier(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error);
+int bus_property_get_syslog_identifier(
+ sd_bus *bus,
+ const char *path,
+ const char *interface,
+ const char *property,
+ sd_bus_message *reply,
+ void *userdata,
+ sd_bus_error *reterr_error);
int bus_connect_capsule_systemd(const char *capsule, sd_bus **ret);
int bus_connect_capsule_bus(const char *capsule, sd_bus **ret);
-int bus_connect_transport(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **bus);
-int bus_connect_transport_systemd(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **bus);
+int bus_connect_transport(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **ret);
+int bus_connect_transport_systemd(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **ret);
int bus_log_address_error(int r, BusTransport transport);
int bus_log_connect_full(int log_level, int r, BusTransport transport, RuntimeScope scope);
Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate);
Condition* condition_free(Condition *c);
-Condition* condition_free_list_type(Condition *first, ConditionType type);
+Condition* condition_free_list_type(Condition *head, ConditionType type);
static inline Condition* condition_free_list(Condition *first) {
return condition_free_list_type(first, _CONDITION_TYPE_INVALID);
}
bool condition_test_list(Condition *first, char **env, condition_to_string_t to_string, condition_test_logger_t logger, void *userdata);
void condition_dump(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string);
-void condition_dump_list(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string);
+void condition_dump_list(Condition *first, FILE *f, const char *prefix, condition_to_string_t to_string);
const char* condition_type_to_string(ConditionType t) _const_;
ConditionType condition_type_from_string(const char *s) _pure_;
ConfigParseFlags flags,
void *userdata,
Hashmap **ret_stats_by_path, /* possibly NULL */
- char ***ret_drop_in_files); /* possibly NULL */
+ char ***ret_dropin_files); /* possibly NULL */
int config_parse_standard_file_with_dropins_full(
const char *root,
typedef int (*copy_progress_bytes_t)(uint64_t n_bytes, uint64_t bytes_per_second, void *userdata);
typedef int (*copy_progress_path_t)(const char *path, const struct stat *st, void *userdata);
-int copy_file_fd_at_full(int dir_fdf, const char *from, int to, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata);
-static inline int copy_file_fd_at(int dir_fdf, const char *from, int to, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata) {
- return copy_file_fd_at_full(dir_fdf, from, to, copy_flags, progress, userdata);
+int copy_file_fd_at_full(int dir_fdf, const char *from, int fdt, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata);
+static inline int copy_file_fd_at(int dir_fdf, const char *from, int fdt, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata) {
+ return copy_file_fd_at_full(dir_fdf, from, fdt, copy_flags, progress, userdata);
}
-static inline int copy_file_fd_full(const char *from, int to, CopyFlags copy_flags) {
- return copy_file_fd_at_full(AT_FDCWD, from, to, copy_flags, NULL, NULL);
+static inline int copy_file_fd_full(const char *from, int fdt, CopyFlags copy_flags) {
+ return copy_file_fd_at_full(AT_FDCWD, from, fdt, copy_flags, NULL, NULL);
}
-static inline int copy_file_fd(const char *from, int to, CopyFlags copy_flags) {
- return copy_file_fd_at(AT_FDCWD, from, to, copy_flags, NULL, NULL);
+static inline int copy_file_fd(const char *from, int fdt, CopyFlags copy_flags) {
+ return copy_file_fd_at(AT_FDCWD, from, fdt, copy_flags, NULL, NULL);
}
int copy_file_at_full(int dir_fdf, const char *from, int dir_fdt, const char *to, int open_flags, mode_t mode, unsigned chattr_flags, unsigned chattr_mask, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata);
return r;
}
-Architecture dissected_image_architecture(DissectedImage *img) {
- assert(img);
+Architecture dissected_image_architecture(DissectedImage *m) {
+ assert(m);
- if (img->partitions[PARTITION_ROOT].found &&
- img->partitions[PARTITION_ROOT].architecture >= 0)
- return img->partitions[PARTITION_ROOT].architecture;
+ if (m->partitions[PARTITION_ROOT].found &&
+ m->partitions[PARTITION_ROOT].architecture >= 0)
+ return m->partitions[PARTITION_ROOT].architecture;
- if (img->partitions[PARTITION_USR].found &&
- img->partitions[PARTITION_USR].architecture >= 0)
- return img->partitions[PARTITION_USR].architecture;
+ if (m->partitions[PARTITION_USR].found &&
+ m->partitions[PARTITION_USR].architecture >= 0)
+ return m->partitions[PARTITION_USR].architecture;
return _ARCHITECTURE_INVALID;
}
bool dissected_image_verity_ready(const DissectedImage *image, PartitionDesignator d);
bool dissected_image_verity_sig_ready(const DissectedImage *image, PartitionDesignator d);
-int mount_image_privately_interactively(const char *path, const ImagePolicy *image_policy, DissectImageFlags flags, char **ret_directory, int *ret_dir_fd, LoopDevice **ret_loop_device);
-
-int verity_dissect_and_mount(int src_fd, const char *src, const char *dest, const MountOptions *options, const ImagePolicy *image_policy, const ImageFilter *image_filter, const ExtensionReleaseData *required_release_data, ImageClass required_class, VeritySettings *verity, RuntimeScope runtime_scope, DissectedImage **ret_image);
+int mount_image_privately_interactively(const char *image, const ImagePolicy *image_policy, DissectImageFlags flags, char **ret_directory, int *ret_dir_fd, LoopDevice **ret_loop_device);
+
+int verity_dissect_and_mount(
+ int src_fd,
+ const char *src,
+ const char *dest,
+ const MountOptions *options,
+ const ImagePolicy *image_policy,
+ const ImageFilter *image_filter,
+ const ExtensionReleaseData *extension_release_data,
+ ImageClass required_class,
+ VeritySettings *verity,
+ RuntimeScope runtime_scope,
+ DissectedImage **ret_image);
int dissect_fstype_ok(const char *fstype);
return 0;
}
-int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret_address) {
+int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret) {
int r;
assert(p);
assert(ret_family);
- assert(ret_address);
+ assert(ret);
r = dns_name_endswith(p, "in-addr.arpa");
if (r < 0)
return r;
*ret_family = AF_INET;
- ret_address->in.s_addr = htobe32(((uint32_t) a[3] << 24) |
+ ret->in.s_addr = htobe32(((uint32_t) a[3] << 24) |
((uint32_t) a[2] << 16) |
((uint32_t) a[1] << 8) |
(uint32_t) a[0]);
return r;
*ret_family = AF_INET6;
- ret_address->in6 = a;
+ ret->in6 = a;
return 1;
}
*ret_family = AF_UNSPEC;
- *ret_address = IN_ADDR_NULL;
+ *ret = IN_ADDR_NULL;
return 0;
}
} DNSLabelFlags;
int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags);
-int dns_label_unescape_suffix(const char *name, const char **label_end, char *dest, size_t sz);
+int dns_label_unescape_suffix(const char *name, const char **label_terminal, char *dest, size_t sz);
int dns_label_escape(const char *p, size_t l, char *dest, size_t sz);
int dns_label_escape_new(const char *p, size_t l, char **ret);
return 1;
}
-void dns_name_hash_func(const char *s, struct siphash *state);
+void dns_name_hash_func(const char *name, struct siphash *state);
int dns_name_compare_func(const char *a, const char *b);
extern const struct hash_ops dns_name_hash_ops;
extern const struct hash_ops dns_name_hash_ops_free;
int dns_name_change_suffix(const char *name, const char *old_suffix, const char *new_suffix, char **ret);
int dns_name_reverse(int family, const union in_addr_union *a, char **ret);
-int dns_name_address(const char *p, int *family, union in_addr_union *a);
+int dns_name_address(const char *p, int *family, union in_addr_union *ret);
bool dns_name_is_root(const char *name);
bool dns_name_is_single_label(const char *name);
(unsigned) DNS_PACKET_ARCOUNT(p);
}
-int dns_packet_new(DnsPacket **p, DnsProtocol protocol, size_t min_alloc_dsize, size_t max_size);
-int dns_packet_new_query(DnsPacket **p, DnsProtocol protocol, size_t min_alloc_dsize, bool dnssec_checking_disabled);
+int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t min_alloc_dsize, size_t max_size);
+int dns_packet_new_query(DnsPacket **ret, DnsProtocol protocol, size_t min_alloc_dsize, bool dnssec_checking_disabled);
int dns_packet_dup(DnsPacket **ret, DnsPacket *p);
int dns_packet_is_reply_for(DnsPacket *p, const DnsResourceKey *key);
-int dns_packet_append_blob(DnsPacket *p, const void *d, size_t sz, size_t *start);
+int dns_packet_append_blob(DnsPacket *p, const void *d, size_t l, size_t *start);
int dns_packet_append_uint8(DnsPacket *p, uint8_t v, size_t *start);
int dns_packet_append_uint16(DnsPacket *p, uint16_t v, size_t *start);
int dns_packet_append_uint32(DnsPacket *p, uint32_t v, size_t *start);
int dns_packet_append_string(DnsPacket *p, const char *s, size_t *start);
int dns_packet_append_raw_string(DnsPacket *p, const void *s, size_t size, size_t *start);
-int dns_packet_append_label(DnsPacket *p, const char *s, size_t l, bool canonical_candidate, size_t *start);
+int dns_packet_append_label(DnsPacket *p, const char *d, size_t l, bool canonical_candidate, size_t *start);
int dns_packet_append_name(DnsPacket *p, const char *name, bool allow_compression, bool canonical_candidate, size_t *start);
int dns_packet_append_key(DnsPacket *p, const DnsResourceKey *key, DnsAnswerFlags flags, size_t *start);
int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, DnsAnswerFlags flags, size_t *start, size_t *rdata_start);
int dns_resource_record_get_cname_target(DnsResourceKey *key, DnsResourceRecord *cname, char **ret);
-DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *i);
+DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *first);
bool dns_txt_item_equal(DnsTxtItem *a, DnsTxtItem *b);
-DnsTxtItem *dns_txt_item_copy(DnsTxtItem *i);
+DnsTxtItem *dns_txt_item_copy(DnsTxtItem *first);
int dns_txt_item_new_empty(DnsTxtItem **ret);
-DnsSvcParam *dns_svc_param_free_all(DnsSvcParam *i);
+DnsSvcParam *dns_svc_param_free_all(DnsSvcParam *first);
bool dns_svc_params_equal(DnsSvcParam *a, DnsSvcParam *b);
DnsSvcParam *dns_svc_params_copy(DnsSvcParam *first);
void dns_resource_key_hash_func(const DnsResourceKey *k, struct siphash *state);
int dns_resource_key_compare_func(const DnsResourceKey *x, const DnsResourceKey *y);
-void dns_resource_record_hash_func(const DnsResourceRecord *i, struct siphash *state);
+void dns_resource_record_hash_func(const DnsResourceRecord *rr, struct siphash *state);
int dns_resource_record_compare_func(const DnsResourceRecord *x, const DnsResourceRecord *y);
uint16_t dnssec_keytag(DnsResourceRecord *dnskey, bool mask_revoke);
int dns_type_from_string(const char *s);
const char* dns_class_to_string(uint16_t class);
-int dns_class_from_string(const char *name);
+int dns_class_from_string(const char *s);
/* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */
const char* tlsa_cert_usage_to_string(uint8_t cert_usage);
const char *file_suffix,
const char *name,
const Set *aliases,
- char ***paths);
+ char ***ret);
int efi_get_reboot_to_firmware(void);
int efi_set_reboot_to_firmware(bool value);
-int efi_get_boot_option(uint16_t nr, char **ret_title, sd_id128_t *ret_part_uuid, char **ret_path, bool *ret_active);
+int efi_get_boot_option(uint16_t id, char **ret_title, sd_id128_t *ret_part_uuid, char **ret_path, bool *ret_active);
int efi_add_boot_option(uint16_t id, const char *title, uint32_t part, uint64_t pstart, uint64_t psize, sd_id128_t part_uuid, const char *path);
int efi_remove_boot_option(uint16_t id);
int efi_get_boot_order(uint16_t **ret_order);
uint32_t advertise);
const char* duplex_to_string(Duplex d) _const_;
-Duplex duplex_from_string(const char *d) _pure_;
+Duplex duplex_from_string(const char *s) _pure_;
int wol_options_to_string_alloc(uint32_t opts, char **ret);
const char* port_to_string(NetDevPort port) _const_;
-NetDevPort port_from_string(const char *port) _pure_;
+NetDevPort port_from_string(const char *s) _pure_;
const char* mdi_to_string(int mdi) _const_;
#include "shared-forward.h"
-int fork_notify(char * const *cmdline, PidRef *ret_pidref);
+int fork_notify(char * const *argv, PidRef *ret_pidref);
void fork_notify_terminate(PidRef *pidref);
int table_add_cell_full(
Table *t,
TableCell **ret_cell,
- TableDataType type,
+ TableDataType dt,
const void *data,
size_t minimum_width,
size_t maximum_width,
TableData *p;
assert(t);
- assert(type >= 0);
- assert(type < _TABLE_DATA_TYPE_MAX);
+ assert(dt >= 0);
+ assert(dt < _TABLE_DATA_TYPE_MAX);
/* Special rule: patch NULL data fields to the empty field */
if (!data)
- type = TABLE_EMPTY;
+ dt = TABLE_EMPTY;
/* Determine the cell adjacent to the current one, but one row up */
if (t->n_cells >= t->n_columns)
assert(align_percent <= 100);
assert(ellipsize_percent <= 100);
- uppercase = type == TABLE_HEADER;
+ uppercase = dt == TABLE_HEADER;
/* Small optimization: Pretty often adjacent cells in two subsequent lines have the same data and
* formatting. Let's see if we can reuse the cell data and ref it once more. */
- if (p && table_data_matches(p, type, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase))
+ if (p && table_data_matches(p, dt, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase))
d = table_data_ref(p);
else {
- d = table_data_new(type, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase);
+ d = table_data_new(dt, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase);
if (!d)
return -ENOMEM;
}
DEFINE_TRIVIAL_CLEANUP_FUNC(Table*, table_unref);
-int table_add_cell_full(Table *t, TableCell **ret_cell, TableDataType type, const void *data, size_t minimum_width, size_t maximum_width, unsigned weight, unsigned align_percent, unsigned ellipsize_percent);
-static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType type, const void *data) {
- return table_add_cell_full(t, ret_cell, type, data, SIZE_MAX, SIZE_MAX, UINT_MAX, UINT_MAX, UINT_MAX);
+int table_add_cell_full(Table *t, TableCell **ret_cell, TableDataType dt, const void *data, size_t minimum_width, size_t maximum_width, unsigned weight, unsigned align_percent, unsigned ellipsize_percent);
+static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType dt, const void *data) {
+ return table_add_cell_full(t, ret_cell, dt, data, SIZE_MAX, SIZE_MAX, UINT_MAX, UINT_MAX, UINT_MAX);
}
-int table_add_cell_stringf_full(Table *t, TableCell **ret_cell, TableDataType type, const char *format, ...) _printf_(4, 5);
+int table_add_cell_stringf_full(Table *t, TableCell **ret_cell, TableDataType dt, const char *format, ...) _printf_(4, 5);
#define table_add_cell_stringf(t, ret_cell, format, ...) table_add_cell_stringf_full(t, ret_cell, TABLE_STRING, format, __VA_ARGS__)
int table_fill_empty(Table *t, size_t until_column);
int generator_open_unit_file_full(
const char *dir,
const char *source,
- const char *fn,
+ const char *filename,
FILE **ret_file,
char **ret_final_path,
char **ret_temp_path) {
*ret_temp_path = TAKE_PTR(p);
} else {
- assert(fn);
+ assert(filename);
- p = path_join(dir, fn);
+ p = path_join(dir, filename);
if (!p)
return log_oom();
#include "shared-forward.h"
#include "main-func.h"
-int generator_open_unit_file_full(const char *dest, const char *source, const char *name, FILE **ret_file, char **ret_final_path, char **ret_temp_path);
-static inline int generator_open_unit_file(const char *dest, const char *source, const char *name, FILE **ret_file) {
- return generator_open_unit_file_full(dest, source, name, ret_file, NULL, NULL);
+int generator_open_unit_file_full(const char *dir, const char *source, const char *filename, FILE **ret_file, char **ret_final_path, char **ret_temp_path);
+static inline int generator_open_unit_file(const char *dir, const char *source, const char *filename, FILE **ret_file) {
+ return generator_open_unit_file_full(dir, source, filename, ret_file, NULL, NULL);
}
int generator_add_symlink_full(const char *dir, const char *dst, const char *dep_type, const char *src, const char *instance);
} GeneveDF;
const char* geneve_df_to_string(GeneveDF d) _const_;
-GeneveDF geneve_df_from_string(const char *d) _pure_;
+GeneveDF geneve_df_from_string(const char *s) _pure_;
}
const char* partition_designator_to_string(PartitionDesignator d) _const_;
-PartitionDesignator partition_designator_from_string(const char *name) _pure_;
+PartitionDesignator partition_designator_from_string(const char *s) _pure_;
const char* partition_mountpoint_to_string(PartitionDesignator d) _const_;
int group_record_build(GroupRecord **ret, ...);
#define group_record_buildo(ret, ...) \
group_record_build((ret), SD_JSON_BUILD_OBJECT(__VA_ARGS__))
-int group_record_clone(GroupRecord *g, UserRecordLoadFlags flags, GroupRecord **ret);
+int group_record_clone(GroupRecord *h, UserRecordLoadFlags flags, GroupRecord **ret);
bool group_record_match(GroupRecord *h, const UserDBMatch *match);
return 0;
}
-int raw_strip_suffixes(const char *p, char **ret) {
+int raw_strip_suffixes(const char *name, char **ret) {
static const char suffixes[] =
".xz\0"
_cleanup_free_ char *q = NULL;
- q = strdup(p);
+ q = strdup(name);
if (!q)
return -ENOMEM;
RuntimeScope scope,
UnitFileFlags flags,
const char *root_dir,
- char * const *names,
+ char * const *files,
InstallChange **changes,
size_t *n_changes);
int unit_file_reenable(
int unit_file_lookup_state(
RuntimeScope scope,
- const LookupPaths *paths,
+ const LookupPaths *lp,
const char *name,
UnitFileState *ret);
int unit_file_get_state(RuntimeScope scope, const char *root_dir, const char *filename, UnitFileState *ret);
-int unit_file_exists_full(RuntimeScope scope, const LookupPaths *paths, const char *name, char **ret_path);
-static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *paths, const char *name) {
- return unit_file_exists_full(scope, paths, name, NULL);
+int unit_file_exists_full(RuntimeScope scope, const LookupPaths *lp, const char *name, char **ret_path);
+static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *lp, const char *name) {
+ return unit_file_exists_full(scope, lp, name, NULL);
}
int unit_file_get_list(RuntimeScope scope, const char *root_dir, char * const *states, char * const *patterns, Hashmap **ret);
return IOPRIO_PRIO_VALUE_HINT(class, IOPRIO_PRIO_LEVEL(data), IOPRIO_PRIO_HINT(data));
}
-int ioprio_class_to_string_alloc(int i, char **s);
+int ioprio_class_to_string_alloc(int i, char **ret);
int ioprio_class_from_string(const char *s);
static inline bool ioprio_class_is_valid(int i) {
} IPVlanFlags;
const char* ipvlan_mode_to_string(IPVlanMode d) _const_;
-IPVlanMode ipvlan_mode_from_string(const char *d) _pure_;
+IPVlanMode ipvlan_mode_from_string(const char *s) _pure_;
const char* ipvlan_flags_to_string(IPVlanFlags d) _const_;
-IPVlanFlags ipvlan_flags_from_string(const char *d) _pure_;
+IPVlanFlags ipvlan_flags_from_string(const char *s) _pure_;
int add_local_address(struct local_address **list, size_t *n_list, int ifindex, unsigned char scope, int family, const union in_addr_union *address);
-int local_addresses(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);
+int local_addresses(sd_netlink *context, int ifindex, int af, struct local_address **ret);
-int local_gateways(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);
+int local_gateways(sd_netlink *context, int ifindex, int af, struct local_address **ret);
-int local_outbounds(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret);
+int local_outbounds(sd_netlink *context, int ifindex, int af, struct local_address **ret);
} MacVlanMode;
const char* macvlan_mode_to_string(MacVlanMode d) _const_;
-MacVlanMode macvlan_mode_from_string(const char *d) _pure_;
+MacVlanMode macvlan_mode_from_string(const char *s) _pure_;
int repeat_unmount(const char *path, int flags);
-int umount_recursive_full(const char *target, int flags, char **keep);
-static inline int umount_recursive(const char *target, int flags) {
- return umount_recursive_full(target, flags, NULL);
+int umount_recursive_full(const char *prefix, int flags, char **keep);
+static inline int umount_recursive(const char *prefix, int flags) {
+ return umount_recursive_full(prefix, flags, NULL);
}
int bind_remount_recursive_with_mountinfo(const char *prefix, unsigned long new_flags, unsigned long flags_mask, char **deny_list, FILE *proc_self_mountinfo);
unsigned long *ret_mount_flags,
char **ret_remaining_options);
-int mode_to_inaccessible_node(const char *runtime_dir, mode_t mode, char **dest);
+int mode_to_inaccessible_node(const char *runtime_dir, mode_t mode, char **ret);
int mount_flags_to_string(unsigned long flags, char **ret);
/* Useful for usage with _cleanup_(), unmounts, removes a directory and frees the pointer */
int open_tree_attr_with_fallback(int dir_fd, const char *path, unsigned flags, struct mount_attr *attr);
int open_tree_try_drop_idmap(int dir_fd, const char *path, unsigned flags);
-int make_userns(uid_t uid_shift, uid_t uid_range, uid_t host_owner, uid_t dest_owner, RemountIdmapping idmapping);
+int make_userns(uid_t uid_shift, uid_t uid_range, uid_t source_owner, uid_t dest_owner, RemountIdmapping idmapping);
int remount_idmap_fd(char **p, int userns_fd, uint64_t extra_mount_attr_set);
-int remount_idmap(char **p, uid_t uid_shift, uid_t uid_range, uid_t host_owner, uid_t dest_owner, RemountIdmapping idmapping);
+int remount_idmap(
+ char **p,
+ uid_t uid_shift,
+ uid_t uid_range,
+ uid_t source_owner,
+ uid_t dest_owner,
+ RemountIdmapping idmapping);
/* Creates a mount point (without any parents) based on the source path or mode - i.e., a file or a directory */
int make_mount_point_inode_from_mode(int dir_fd, const char *dest, mode_t source_mode, mode_t target_mode);
} NamePolicy;
const char* name_policy_to_string(NamePolicy p) _const_;
-NamePolicy name_policy_from_string(const char *p) _pure_;
+NamePolicy name_policy_from_string(const char *s) _pure_;
const char* alternative_names_policy_to_string(NamePolicy p) _const_;
-NamePolicy alternative_names_policy_from_string(const char *p) _pure_;
+NamePolicy alternative_names_policy_from_string(const char *s) _pure_;
int device_get_sysattr_int_filtered(sd_device *device, const char *sysattr, int *ret_value);
int device_get_sysattr_unsigned_filtered(sd_device *device, const char *sysattr, unsigned *ret_value);
}
int apply_numa_policy(const NUMAPolicy *policy);
-int numa_to_cpu_set(const NUMAPolicy *policy, CPUSet *set);
+int numa_to_cpu_set(const NUMAPolicy *policy, CPUSet *ret);
int numa_mask_add_all(CPUSet *mask);
}
const char* open_file_flags_to_string(OpenFileFlag t) _const_;
-OpenFileFlag open_file_flags_from_string(const char *t) _pure_;
+OpenFileFlag open_file_flags_from_string(const char *s) _pure_;
void pager_close(void);
bool pager_have(void) _pure_;
-int show_man_page(const char *page, bool null_stdio);
+int show_man_page(const char *desc, bool null_stdio);
/* Use a different module name per different PAM module. They are all loaded in the same namespace, and this
* helps avoid a clash in the internal data structures of sd-bus. It will be used as key for cache items. */
-int pam_acquire_bus_connection(pam_handle_t *handle, const char *module_name, bool debug, sd_bus **ret_bus, PamBusData **ret_bus_data);
+int pam_acquire_bus_connection(
+ pam_handle_t *handle,
+ const char *module_name,
+ bool debug,
+ sd_bus **ret_bus,
+ PamBusData **ret_pam_bus_data);
int pam_get_bus_data(pam_handle_t *handle, const char *module_name, PamBusData **ret);
void pam_cleanup_free(pam_handle_t *handle, void *data, int error_status);
CK_SLOT_ID slotid,
const CK_TOKEN_INFO *token_info,
const char *friendly_name,
- const char *askpw_icon,
- const char *askpw_keyring,
- const char *askpw_credential,
+ const char *ask_password_icon,
+ const char *ask_password_keyring,
+ const char *ask_password_credential,
usec_t until,
- AskPasswordFlags askpw_flags,
+ AskPasswordFlags ask_password_flags,
char **ret_used_pin) {
_cleanup_free_ char *token_uri_string = NULL, *token_uri_escaped = NULL, *id = NULL, *token_label = NULL;
if (!passwords)
return log_oom();
- } else if (FLAGS_SET(askpw_flags, ASK_PASSWORD_HEADLESS))
+ } else if (FLAGS_SET(ask_password_flags, ASK_PASSWORD_HEADLESS))
return log_error_errno(SYNTHETIC_ERRNO(ENOPKG), "PIN querying disabled via 'headless' option. Use the 'PIN' environment variable.");
else {
_cleanup_free_ char *text = NULL;
AskPasswordRequest req = {
.tty_fd = -EBADF,
.message = text,
- .icon = askpw_icon,
+ .icon = ask_password_icon,
.id = id,
- .keyring = askpw_keyring,
- .credential = askpw_credential,
+ .keyring = ask_password_keyring,
+ .credential = ask_password_credential,
.until = until,
.hup_fd = -EBADF,
};
/* We never cache PINs, simply because it's fatal if we use wrong PINs, since usually there are only 3 tries */
- r = ask_password_auto(&req, askpw_flags, &passwords);
+ r = ask_password_auto(&req, ask_password_flags, &passwords);
if (r < 0)
return log_error_errno(r, "Failed to query PIN for security token '%s': %m", token_label);
}
char* pkcs11_token_model(const CK_TOKEN_INFO *token_info);
int pkcs11_token_login_by_pin(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, const CK_TOKEN_INFO *token_info, const char *token_label, const void *pin, size_t pin_size);
-int pkcs11_token_login(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_SLOT_ID slotid, const CK_TOKEN_INFO *token_info, const char *friendly_name, const char *icon_name, const char *key_name, const char *credential_name, usec_t until, AskPasswordFlags ask_password_flags, char **ret_used_pin);
+int pkcs11_token_login(
+ CK_FUNCTION_LIST *m,
+ CK_SESSION_HANDLE session,
+ CK_SLOT_ID slotid,
+ const CK_TOKEN_INFO *token_info,
+ const char *friendly_name,
+ const char *ask_password_icon,
+ const char *ask_password_key,
+ const char *ask_password_credential,
+ usec_t until,
+ AskPasswordFlags ask_password_flags,
+ char **ret_used_pin);
int pkcs11_token_find_related_object(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE prototype, CK_OBJECT_CLASS class, CK_OBJECT_HANDLE *ret_object);
#if HAVE_OPENSSL
int pty_forward_honor_vhangup(PTYForward *f);
bool pty_forward_vhangup_honored(const PTYForward *f);
-void pty_forward_set_hangup_handler(PTYForward *f, PTYForwardHangupHandler handler, void *userdata);
-void pty_forward_set_hotkey_handler(PTYForward *f, PTYForwardHotkeyHandler handler, void *userdata);
+void pty_forward_set_hangup_handler(PTYForward *f, PTYForwardHangupHandler cb, void *userdata);
+void pty_forward_set_hotkey_handler(PTYForward *f, PTYForwardHotkeyHandler cb, void *userdata);
int pty_forward_drain(PTYForward *f);
#define EXT4_MINIMAL_SIZE (32U*U64_MB)
uint64_t minimal_size_by_fs_magic(statfs_f_type_t magic);
-uint64_t minimal_size_by_fs_name(const char *str);
+uint64_t minimal_size_by_fs_name(const char *name);
bool fs_can_online_shrink_and_grow(statfs_f_type_t magic);
int seccomp_filter_set_add(Hashmap *filter, bool add, const SyscallFilterSet *set);
int seccomp_add_syscall_filter_item(
- scmp_filter_ctx *ctx,
+ scmp_filter_ctx *seccomp,
const char *name,
uint32_t action,
char **exclude,
int mac_selinux_get_peer_label(int socket_fd, char **ret_label);
int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **ret_label);
-int mac_selinux_create_file_prepare_at(int dirfd, const char *path, mode_t mode);
+int mac_selinux_create_file_prepare_at(int dir_fd, const char *path, mode_t mode);
static inline int mac_selinux_create_file_prepare(const char *path, mode_t mode) {
return mac_selinux_create_file_prepare_at(AT_FDCWD, path, mode);
}
return serialize_item_format(f, key, USEC_FMT, usec);
}
-int serialize_dual_timestamp(FILE *f, const char *name, const dual_timestamp *t) {
+int serialize_dual_timestamp(FILE *f, const char *key, const dual_timestamp *t) {
assert(f);
- assert(name);
+ assert(key);
assert(t);
if (!dual_timestamp_is_set(t))
return 0;
- return serialize_item_format(f, name, USEC_FMT " " USEC_FMT, t->realtime, t->monotonic);
+ return serialize_item_format(f, key, USEC_FMT " " USEC_FMT, t->realtime, t->monotonic);
}
int serialize_strv(FILE *f, const char *key, char * const *l) {
int serialize_item(FILE *f, const char *key, const char *value);
int serialize_item_escaped(FILE *f, const char *key, const char *value);
-int serialize_item_format(FILE *f, const char *key, const char *value, ...) _printf_(3,4);
+int serialize_item_format(FILE *f, const char *key, const char *format, ...) _printf_(3,4);
int serialize_item_hexmem(FILE *f, const char *key, const void *p, size_t l);
int serialize_item_base64mem(FILE *f, const char *key, const void *p, size_t l);
int serialize_fd(FILE *f, FDSet *fds, const char *key, int fd);
int deserialize_fd_many(FDSet *fds, const char *value, size_t n, int *ret);
int deserialize_usec(const char *value, usec_t *ret);
int deserialize_dual_timestamp(const char *value, dual_timestamp *ret);
-int deserialize_environment(const char *value, char ***environment);
+int deserialize_environment(const char *value, char ***list);
int deserialize_strv(const char *value, char ***l);
int deserialize_pidref(FDSet *fds, const char *value, PidRef *ret);
void deserialize_ratelimit(RateLimit *rl, const char *name, const char *value);
SleepConfig* sleep_config_free(SleepConfig *sc);
DEFINE_TRIVIAL_CLEANUP_FUNC(SleepConfig*, sleep_config_free);
-int parse_sleep_config(SleepConfig **sleep_config);
+int parse_sleep_config(SleepConfig **ret);
bool sleep_needs_mem_sleep(const SleepConfig *sc, SleepOperation operation) _pure_;
DEFINE_STRING_TABLE_LOOKUP(socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
-SocketAddressBindIPv6Only socket_address_bind_ipv6_only_or_bool_from_string(const char *n) {
+SocketAddressBindIPv6Only socket_address_bind_ipv6_only_or_bool_from_string(const char *s) {
int r;
- r = parse_boolean(n);
+ r = parse_boolean(s);
if (r > 0)
return SOCKET_ADDRESS_IPV6_ONLY;
if (r == 0)
return SOCKET_ADDRESS_BOTH;
- return socket_address_bind_ipv6_only_from_string(n);
+ return socket_address_bind_ipv6_only_from_string(s);
}
int socket_address_listen(
ASSERT_SIGNAL_FORK_PARENT = 1, /* We are in the parent process */
};
-int assert_signal_internal(int *ret_status);
+int assert_signal_internal(int *ret_signal);
#ifdef __COVERITY__
# define ASSERT_SIGNAL(expr, signal) __coverity_check__(((expr), false))
size_t passlen,
const void *salt,
size_t saltlen,
- uint8_t ret_key[static SHA256_DIGEST_SIZE]) {
+ uint8_t ret[static SHA256_DIGEST_SIZE]) {
_cleanup_(erase_and_freep) uint8_t *buffer = NULL;
uint8_t u[SHA256_DIGEST_SIZE];
hmac_sha256(pass, passlen, buffer, saltlen + sizeof(block_cnt), u);
/* dk needs to be an unmodified u as u gets modified in the loop */
- memcpy(ret_key, u, SHA256_DIGEST_SIZE);
- uint8_t *dk = ret_key;
+ memcpy(ret, u, SHA256_DIGEST_SIZE);
+ uint8_t *dk = ret;
for (size_t i = 1; i < PBKDF2_HMAC_SHA256_ITERATIONS; i++) {
hmac_sha256(pass, passlen, u, sizeof(u), u);
size_t tpm2_tpml_pcr_selection_weight(const TPML_PCR_SELECTION *l);
#define tpm2_tpml_pcr_selection_is_empty(l) (tpm2_tpml_pcr_selection_weight(l) == 0)
-int tpm2_digest_many(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const struct iovec data[], size_t count, bool extend);
+int tpm2_digest_many(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const struct iovec data[], size_t n_data, bool extend);
static inline int tpm2_digest_buffer(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const void *data, size_t len, bool extend) {
return tpm2_digest_many(alg, digest, &IOVEC_MAKE((void*) data, len), 1, extend);
}
-int tpm2_digest_many_digests(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const TPM2B_DIGEST data[], size_t count, bool extend);
+int tpm2_digest_many_digests(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const TPM2B_DIGEST data[], size_t n_data, bool extend);
static inline int tpm2_digest_rehash(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest) {
return tpm2_digest_many(alg, digest, NULL, 0, true);
}
size_t passlen,
const void *salt,
size_t saltlen,
- uint8_t res[static SHA256_DIGEST_SIZE]);
+ uint8_t ret[static SHA256_DIGEST_SIZE]);
enum {
/* Additional defines for the PCR index naming enum from "fundamental/tpm2-pcr.h" */
int udev_parse_config(void);
int device_wait_for_initialization(sd_device *device, const char *subsystem, usec_t timeout_usec, sd_device **ret);
-int device_wait_for_devlink(const char *path, const char *subsystem, usec_t timeout_usec, sd_device **ret);
+int device_wait_for_devlink(const char *devlink, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_is_renaming(sd_device *dev);
int device_is_processed(sd_device *dev);
const char **ret_fragment_path,
Set **ret_names);
-const char* runlevel_to_target(const char *rl);
+const char* runlevel_to_target(const char *word);
const char **user_record_self_modifiable_fields(UserRecord *h);
const char **user_record_self_modifiable_blobs(UserRecord *h);
const char **user_record_self_modifiable_privileged(UserRecord *h);
-int user_record_self_changes_allowed(UserRecord *current, UserRecord *new);
+int user_record_self_changes_allowed(UserRecord *current, UserRecord *incoming);
int user_record_build_image_path(UserStorage storage, const char *user_name_and_realm, char **ret);
int vconsole_convert_to_x11(const VCContext *vc, X11VerifyCallback verify, X11Context *ret);
int x11_convert_to_vconsole(const X11Context *xc, VCContext *ret);
-int vconsole_serialize(const VCContext *vc, const X11Context *xc, char ***ret);
+int vconsole_serialize(const VCContext *vc, const X11Context *xc, char ***env);
int watchdog_set_device(const char *path);
int watchdog_setup(usec_t timeout);
-int watchdog_setup_pretimeout(usec_t usec);
+int watchdog_setup_pretimeout(usec_t timeout);
int watchdog_setup_pretimeout_governor(const char *governor);
int watchdog_ping(void);
void watchdog_report_if_missing(void);
int sd_bus_set_address(sd_bus *bus, const char *address);
int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd);
int sd_bus_set_exec(sd_bus *bus, const char *path, char *const *argv);
-int sd_bus_get_address(sd_bus *bus, const char **address);
+int sd_bus_get_address(sd_bus *bus, const char **ret);
int sd_bus_set_bus_client(sd_bus *bus, int b);
int sd_bus_is_bus_client(sd_bus *bus);
-int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t bus_id);
+int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id);
int sd_bus_is_server(sd_bus *bus);
int sd_bus_set_anonymous(sd_bus *bus, int b);
int sd_bus_is_anonymous(sd_bus *bus);
const char* sd_bus_track_first(sd_bus_track *track);
const char* sd_bus_track_next(sd_bus_track *track);
-int sd_bus_track_set_destroy_callback(sd_bus_track *s, sd_bus_destroy_t callback);
-int sd_bus_track_get_destroy_callback(sd_bus_track *s, sd_bus_destroy_t *ret);
+int sd_bus_track_set_destroy_callback(sd_bus_track *track, sd_bus_destroy_t callback);
+int sd_bus_track_get_destroy_callback(sd_bus_track *track, sd_bus_destroy_t *ret);
/* Define helpers so that __attribute__((cleanup(sd_bus_unrefp))) and similar may be used. */
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus, sd_bus_unref);
int sd_device_new_child(sd_device **ret, sd_device *device, const char *suffix);
-int sd_device_get_parent(sd_device *child, sd_device **ret);
-int sd_device_get_parent_with_subsystem_devtype(sd_device *child, const char *subsystem, const char *devtype, sd_device **ret);
+int sd_device_get_parent(sd_device *device, sd_device **ret);
+int sd_device_get_parent_with_subsystem_devtype(sd_device *device, const char *subsystem, const char *devtype, sd_device **ret);
int sd_device_get_syspath(sd_device *device, const char **ret);
int sd_device_get_subsystem(sd_device *device, const char **ret);
int broadcast);
int sd_dhcp_client_set_ifindex(
sd_dhcp_client *client,
- int interface_index);
+ int ifindex);
int sd_dhcp_client_set_ifname(
sd_dhcp_client *client,
- const char *interface_name);
+ const char *ifname);
int sd_dhcp_client_get_ifname(sd_dhcp_client *client, const char **ret);
int sd_dhcp_client_set_mac(
sd_dhcp_client *client,
bool iaid_set,
uint32_t iaid,
uint16_t duid_type,
- const uint8_t *duid,
- size_t duid_len);
+ const uint8_t *duid_data,
+ size_t duid_data_len);
__extension__ int sd_dhcp_client_set_rapid_commit(
sd_dhcp_client *client,
bool rapid_commit);
uint32_t mtu);
int sd_dhcp_client_set_max_attempts(
sd_dhcp_client *client,
- uint64_t attempt);
+ uint64_t max_attempts);
int sd_dhcp_client_set_client_port(
sd_dhcp_client *client,
uint16_t port);
int type);
int sd_dhcp_client_set_socket_priority(
sd_dhcp_client *client,
- int so_priority);
+ int socket_priority);
int sd_dhcp_client_set_fallback_lease_lifetime(
sd_dhcp_client *client,
uint64_t fallback_lease_lifetime);
int sd_dhcp_lease_get_search_domains(sd_dhcp_lease *lease, char ***domains);
int sd_dhcp_lease_get_hostname(sd_dhcp_lease *lease, const char **hostname);
int sd_dhcp_lease_get_root_path(sd_dhcp_lease *lease, const char **root_path);
-int sd_dhcp_lease_get_captive_portal(sd_dhcp_lease *lease, const char **captive_portal);
+int sd_dhcp_lease_get_captive_portal(sd_dhcp_lease *lease, const char **ret);
int sd_dhcp_lease_get_dnr(sd_dhcp_lease *lease, sd_dns_resolver **ret_resolvers);
int sd_dhcp_lease_get_static_routes(sd_dhcp_lease *lease, sd_dhcp_route ***ret);
int sd_dhcp_lease_get_classless_routes(sd_dhcp_lease *lease, sd_dhcp_route ***ret);
int sd_dhcp_lease_get_vendor_specific(sd_dhcp_lease *lease, const void **data, size_t *data_len);
int sd_dhcp_lease_get_client_id(sd_dhcp_lease *lease, const sd_dhcp_client_id **ret);
-int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **timezone);
+int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **ret);
int sd_dhcp_lease_get_6rd(
sd_dhcp_lease *lease,
uint8_t *ret_ipv4masklen,
int sd_dhcp_server_set_boot_server_name(sd_dhcp_server *server, const char *name);
int sd_dhcp_server_set_boot_filename(sd_dhcp_server *server, const char *filename);
int sd_dhcp_server_set_bind_to_interface(sd_dhcp_server *server, int enabled);
-int sd_dhcp_server_set_timezone(sd_dhcp_server *server, const char *timezone);
+int sd_dhcp_server_set_timezone(sd_dhcp_server *server, const char *tz);
int sd_dhcp_server_set_domain_name(sd_dhcp_server *server, const char *domain_name);
-int sd_dhcp_server_set_router(sd_dhcp_server *server, const struct in_addr *address);
+int sd_dhcp_server_set_router(sd_dhcp_server *server, const struct in_addr *router);
int sd_dhcp_server_set_servers(
sd_dhcp_server *server,
int sd_dhcp6_client_set_ifindex(
sd_dhcp6_client *client,
- int interface_index);
+ int ifindex);
int sd_dhcp6_client_set_ifname(
sd_dhcp6_client *client,
- const char *interface_name);
+ const char *ifname);
int sd_dhcp6_client_get_ifname(sd_dhcp6_client *client, const char **ret);
int sd_dhcp6_client_set_local_address(
sd_dhcp6_client *client,
int sd_dns_resolver_get_priority(sd_dns_resolver *res, uint16_t *ret_priority);
int sd_dns_resolver_get_adn(sd_dns_resolver *res, const char **ret_adn);
-int sd_dns_resolver_get_inet_addresses(sd_dns_resolver *res, const struct in_addr **ret_addrs, size_t *n);
-int sd_dns_resolver_get_inet6_addresses(sd_dns_resolver *res, const struct in6_addr **ret_addrs, size_t *n);
+int sd_dns_resolver_get_inet_addresses(sd_dns_resolver *res, const struct in_addr **ret_addrs, size_t *ret_n_addrs);
+int sd_dns_resolver_get_inet6_addresses(sd_dns_resolver *res, const struct in6_addr **ret_addrs, size_t *ret_n_addrs);
int sd_dns_resolver_get_alpn(sd_dns_resolver *res, sd_dns_alpn_flags *ret_alpn);
int sd_dns_resolver_get_port(sd_dns_resolver *res, uint16_t *ret_port);
int sd_dns_resolver_get_dohpath(sd_dns_resolver *res, const char **ret_dohpath);
typedef int (*sd_event_inotify_handler_t)(sd_event_source *s, const struct inotify_event *event, void *userdata);
typedef _sd_destroy_t sd_event_destroy_t;
-int sd_event_default(sd_event **e);
+int sd_event_default(sd_event **ret);
-int sd_event_new(sd_event **e);
+int sd_event_new(sd_event **ret);
sd_event* sd_event_ref(sd_event *e);
sd_event* sd_event_unref(sd_event *e);
int sd_event_add_memory_pressure(sd_event *e, sd_event_source **ret, sd_event_handler_t callback, void *userdata);
int sd_event_prepare(sd_event *e);
-int sd_event_wait(sd_event *e, uint64_t usec);
+int sd_event_wait(sd_event *e, uint64_t timeout);
int sd_event_dispatch(sd_event *e);
-int sd_event_run(sd_event *e, uint64_t usec);
+int sd_event_run(sd_event *e, uint64_t timeout);
int sd_event_loop(sd_event *e);
int sd_event_exit(sd_event *e, int code);
#endif
int sd_event_source_get_inotify_mask(sd_event_source *s, uint32_t *ret);
int sd_event_source_get_inotify_path(sd_event_source *s, const char **ret);
-int sd_event_source_set_memory_pressure_type(sd_event_source *e, const char *ty);
+int sd_event_source_set_memory_pressure_type(sd_event_source *s, const char *ty);
int sd_event_source_set_memory_pressure_period(sd_event_source *s, uint64_t threshold_usec, uint64_t window_usec);
int sd_event_source_set_destroy_callback(sd_event_source *s, sd_event_destroy_t callback);
int sd_event_source_get_destroy_callback(sd_event_source *s, sd_event_destroy_t *ret);
int sd_ipv4acd_set_callback(sd_ipv4acd *acd, sd_ipv4acd_callback_t cb, void *userdata);
int sd_ipv4acd_set_check_mac_callback(sd_ipv4acd *acd, sd_ipv4acd_check_mac_callback_t cb, void *userdata);
int sd_ipv4acd_set_mac(sd_ipv4acd *acd, const struct ether_addr *addr);
-int sd_ipv4acd_set_ifindex(sd_ipv4acd *acd, int interface_index);
+int sd_ipv4acd_set_ifindex(sd_ipv4acd *acd, int ifindex);
int sd_ipv4acd_get_ifindex(sd_ipv4acd *acd);
-int sd_ipv4acd_set_ifname(sd_ipv4acd *acd, const char *interface_name);
+int sd_ipv4acd_set_ifname(sd_ipv4acd *acd, const char *ifname);
int sd_ipv4acd_get_ifname(sd_ipv4acd *acd, const char **ret);
int sd_ipv4acd_set_timeout(sd_ipv4acd *acd, uint64_t usec);
int sd_ipv4acd_set_address(sd_ipv4acd *acd, const struct in_addr *address);
int sd_ipv4ll_set_check_mac_callback(sd_ipv4ll *ll, sd_ipv4ll_check_mac_callback_t cb, void *userdata);
int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr);
int sd_ipv4ll_set_timeout(sd_ipv4ll *ll, uint64_t usec);
-int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int interface_index);
+int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int ifindex);
int sd_ipv4ll_get_ifindex(sd_ipv4ll *ll);
-int sd_ipv4ll_set_ifname(sd_ipv4ll *ll, const char *interface_name);
+int sd_ipv4ll_set_ifname(sd_ipv4ll *ll, const char *ifname);
int sd_ipv4ll_get_ifname(sd_ipv4ll *ll, const char **ret);
int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address);
int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed);
int sd_journal_set_data_threshold(sd_journal *j, size_t sz);
int sd_journal_get_data_threshold(sd_journal *j, size_t *sz);
-int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *l);
-int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *l);
-int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *l);
+int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *length);
+int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *length);
+int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *length);
void sd_journal_restart_data(sd_journal *j);
int sd_journal_add_match(sd_journal *j, const void *data, size_t size);
int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from, uint64_t *to);
int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, const sd_id128_t boot_id, uint64_t *from, uint64_t *to);
-int sd_journal_get_usage(sd_journal *j, uint64_t *bytes);
+int sd_journal_get_usage(sd_journal *j, uint64_t *ret_bytes);
int sd_journal_query_unique(sd_journal *j, const char *field);
-int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *l);
-int sd_journal_enumerate_available_unique(sd_journal *j, const void **data, size_t *l);
+int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *length);
+int sd_journal_enumerate_available_unique(sd_journal *j, const void **data, size_t *length);
void sd_journal_restart_unique(sd_journal *j);
int sd_journal_enumerate_fields(sd_journal *j, const char **field);
int sd_journal_wait(sd_journal *j, uint64_t timeout_usec);
int sd_journal_reliable_fd(sd_journal *j);
-int sd_journal_get_catalog(sd_journal *j, char **text);
-int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **text);
+int sd_journal_get_catalog(sd_journal *j, char **ret);
+int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **ret);
int sd_journal_has_runtime_files(sd_journal *j);
int sd_journal_has_persistent_files(sd_journal *j);
int sd_json_variant_is_sensitive(sd_json_variant *v);
int sd_json_variant_is_sensitive_recursive(sd_json_variant *v);
-int sd_json_variant_get_source(sd_json_variant *v, const char **ret_source, unsigned *ret_line, unsigned *reterr_column);
+int sd_json_variant_get_source(sd_json_variant *v, const char **ret_source, unsigned *ret_line, unsigned *ret_column);
__extension__ typedef enum _SD_ENUM_TYPE_S64(sd_json_format_flags_t) {
SD_JSON_FORMAT_OFF = 1 << 0, /* disable json output, make json_variant_format() fail with -ENOEXEC */
int sd_lldp_rx_get_ifname(sd_lldp_rx *lldp_rx, const char **ret);
/* Controls how much and what to store in the neighbors database */
-int sd_lldp_rx_set_neighbors_max(sd_lldp_rx *lldp_rx, uint64_t n);
+int sd_lldp_rx_set_neighbors_max(sd_lldp_rx *lldp_rx, uint64_t m);
int sd_lldp_rx_match_capabilities(sd_lldp_rx *lldp_rx, uint16_t mask);
int sd_lldp_rx_set_filter_address(sd_lldp_rx *lldp_rx, const struct ether_addr *address);
-int sd_lldp_rx_get_neighbors(sd_lldp_rx *lldp_rx, sd_lldp_neighbor ***neighbors);
+int sd_lldp_rx_get_neighbors(sd_lldp_rx *lldp_rx, sd_lldp_neighbor ***ret);
sd_lldp_neighbor *sd_lldp_neighbor_ref(sd_lldp_neighbor *n);
sd_lldp_neighbor *sd_lldp_neighbor_unref(sd_lldp_neighbor *n);
int sd_session_get_remote_host(const char *session, char **ret_remote_host);
/* Determine the remote user of this session (if provided by PAM). */
-int sd_session_get_remote_user(const char *session, char **tre_remote_user);
+int sd_session_get_remote_user(const char *session, char **ret_remote_user);
/* Determine the TTY of this session. */
int sd_session_get_tty(const char *session, char **ret_tty);
typedef struct sd_ndisc_redirect sd_ndisc_redirect;
-sd_ndisc_redirect* sd_ndisc_redirect_ref(sd_ndisc_redirect *na);
-sd_ndisc_redirect* sd_ndisc_redirect_unref(sd_ndisc_redirect *na);
+sd_ndisc_redirect* sd_ndisc_redirect_ref(sd_ndisc_redirect *rd);
+sd_ndisc_redirect* sd_ndisc_redirect_unref(sd_ndisc_redirect *rd);
_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ndisc_redirect, sd_ndisc_redirect_unref);
int sd_ndisc_redirect_set_sender_address(sd_ndisc_redirect *rd, const struct in6_addr *addr);
-int sd_ndisc_redirect_get_sender_address(sd_ndisc_redirect *na, struct in6_addr *ret);
-int sd_ndisc_redirect_get_target_address(sd_ndisc_redirect *na, struct in6_addr *ret);
-int sd_ndisc_redirect_get_destination_address(sd_ndisc_redirect *na, struct in6_addr *ret);
-int sd_ndisc_redirect_get_target_mac(sd_ndisc_redirect *na, struct ether_addr *ret);
-int sd_ndisc_redirect_get_redirected_header(sd_ndisc_redirect *na, struct ip6_hdr *ret);
+int sd_ndisc_redirect_get_sender_address(sd_ndisc_redirect *rd, struct in6_addr *ret);
+int sd_ndisc_redirect_get_target_address(sd_ndisc_redirect *rd, struct in6_addr *ret);
+int sd_ndisc_redirect_get_destination_address(sd_ndisc_redirect *rd, struct in6_addr *ret);
+int sd_ndisc_redirect_get_target_mac(sd_ndisc_redirect *rd, struct ether_addr *ret);
+int sd_ndisc_redirect_get_redirected_header(sd_ndisc_redirect *rd, struct ip6_hdr *ret);
_SD_END_DECLARATIONS;
int sd_ndisc_detach_event(sd_ndisc *nd);
sd_event *sd_ndisc_get_event(sd_ndisc *nd);
-int sd_ndisc_set_callback(sd_ndisc *nd, sd_ndisc_callback_t cb, void *userdata);
-int sd_ndisc_set_ifindex(sd_ndisc *nd, int interface_index);
-int sd_ndisc_set_ifname(sd_ndisc *nd, const char *interface_name);
+int sd_ndisc_set_callback(sd_ndisc *nd, sd_ndisc_callback_t callback, void *userdata);
+int sd_ndisc_set_ifindex(sd_ndisc *nd, int ifindex);
+int sd_ndisc_set_ifname(sd_ndisc *nd, const char *ifname);
int sd_ndisc_get_ifname(sd_ndisc *nd, const char **ret);
int sd_ndisc_set_link_local_address(sd_ndisc *nd, const struct in6_addr *addr);
int sd_ndisc_set_mac(sd_ndisc *nd, const struct ether_addr *mac_addr);
int sd_netlink_process(sd_netlink *nl, sd_netlink_message **ret);
int sd_netlink_wait(sd_netlink *nl, uint64_t timeout);
-int sd_netlink_add_match(sd_netlink *nl, sd_netlink_slot **ret_slot, uint16_t match,
+int sd_netlink_add_match(sd_netlink *nl, sd_netlink_slot **ret_slot, uint16_t type,
sd_netlink_message_handler_t callback,
sd_netlink_destroy_t destroy_callback,
void *userdata, const char *description);
sd_radv *sd_radv_unref(sd_radv *ra);
int sd_radv_attach_event(sd_radv *ra, sd_event *event, int64_t priority);
-int sd_radv_detach_event(sd_radv *nd);
+int sd_radv_detach_event(sd_radv *ra);
sd_event *sd_radv_get_event(sd_radv *ra);
int sd_radv_start(sd_radv *ra);
int sd_radv_is_running(sd_radv *ra);
int sd_radv_send(sd_radv *ra);
-int sd_radv_set_ifindex(sd_radv *ra, int interface_index);
-int sd_radv_set_ifname(sd_radv *ra, const char *interface_name);
+int sd_radv_set_ifindex(sd_radv *ra, int ifindex);
+int sd_radv_set_ifname(sd_radv *ra, const char *ifname);
int sd_radv_get_ifname(sd_radv *ra, const char **ret);
int sd_radv_set_link_local_address(sd_radv *ra, const struct in6_addr *addr);
* getaddrinfo(3). The function returns a new query object. When the
* query is completed, you may retrieve the results using
* sd_resolve_getaddrinfo_done(). */
-int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **q, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, void *userdata);
+int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **ret, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, void *userdata);
/* Issue an address-to-name query on the specified session. The
* arguments are compatible with those of libc's
* query is completed, you may retrieve the results using
* sd_resolve_getnameinfo_done(). Set gethost (resp. getserv) to non-zero
* if you want to query the hostname (resp. the service name). */
-int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **q, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, void *userdata);
+int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **ret, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, void *userdata);
sd_resolve_query *sd_resolve_query_ref(sd_resolve_query *q);
sd_resolve_query *sd_resolve_query_unref(sd_resolve_query *q);
int sd_varlink_get_peer_pid(sd_varlink *v, pid_t *ret);
int sd_varlink_get_peer_pidfd(sd_varlink *v);
-int sd_varlink_set_relative_timeout(sd_varlink *v, uint64_t usec);
+int sd_varlink_set_relative_timeout(sd_varlink *v, uint64_t timeout);
sd_varlink_server* sd_varlink_get_server(sd_varlink *v);
void* sd_varlink_server_set_userdata(sd_varlink_server *s, void *userdata);
void* sd_varlink_server_get_userdata(sd_varlink_server *s);
-int sd_varlink_server_attach_event(sd_varlink_server *v, sd_event *e, int64_t priority);
-int sd_varlink_server_detach_event(sd_varlink_server *v);
-sd_event* sd_varlink_server_get_event(sd_varlink_server *v);
+int sd_varlink_server_attach_event(sd_varlink_server *s, sd_event *e, int64_t priority);
+int sd_varlink_server_detach_event(sd_varlink_server *s);
+sd_event* sd_varlink_server_get_event(sd_varlink_server *s);
int sd_varlink_server_loop_auto(sd_varlink_server *server);
#include "timesyncd-forward.h"
-const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
int manager_parse_server_string(Manager *m, ServerType type, const char *string);
int link_apply_config(LinkConfigContext *ctx, Link *link);
const char* mac_address_policy_to_string(MACAddressPolicy p) _const_;
-MACAddressPolicy mac_address_policy_from_string(const char *p) _pure_;
+MACAddressPolicy mac_address_policy_from_string(const char *s) _pure_;
/* gperf lookup function */
-const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+const struct ConfigPerfItem* link_config_gperf_lookup(const char *str, GPERF_LEN_TYPE length);
CONFIG_PARSER_PROTOTYPE(config_parse_udev_property);
CONFIG_PARSER_PROTOTYPE(config_parse_udev_property_name);
bool accept_failure,
const char *cmd,
char *result,
- size_t ressize,
+ size_t result_size,
bool *ret_truncated);
void udev_event_execute_run(UdevEvent *event);
int load_ovmf_config(const char *path, OvmfConfig **ret);
int find_ovmf_config(int search_sb, OvmfConfig **ret);
int find_qemu_binary(char **ret_qemu_binary);
-int vsock_fix_child_cid(int vsock_fd, unsigned *machine_cid, const char *machine);
+int vsock_fix_child_cid(int vhost_device_fd, unsigned *machine_cid, const char *machine);
char* escape_qemu_value(const char *s);