/src/systemd/src/basic/sysctl-util.h
Line | Count | Source |
1 | | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | | #pragma once |
3 | | |
4 | | |
5 | | #include "basic-forward.h" |
6 | | #include "stdio-util.h" |
7 | | |
8 | | char* sysctl_normalize(char *s); |
9 | | int sysctl_read(const char *property, char **ret); |
10 | | int sysctl_write_full(const char *property, const char *value, Hashmap **shadow); |
11 | | int sysctl_writef(const char *property, const char *format, ...) _printf_(2, 3); |
12 | 0 | static inline int sysctl_write(const char *property, const char *value) { |
13 | 0 | return sysctl_write_full(property, value, NULL); |
14 | 0 | } Unexecuted instantiation: udev-rules.c:sysctl_write Unexecuted instantiation: networkd-ipv6ll.c:sysctl_write Unexecuted instantiation: networkd-ndisc.c:sysctl_write Unexecuted instantiation: networkd-route-util.c:sysctl_write Unexecuted instantiation: networkd-sysctl.c:sysctl_write Unexecuted instantiation: printk-util.c:sysctl_write Unexecuted instantiation: socket-util.c:sysctl_write Unexecuted instantiation: sysctl-util.c:sysctl_write Unexecuted instantiation: manager.c:sysctl_write |
15 | | |
16 | | int sysctl_read_ip_property(int af, const char *ifname, const char *property, char **ret); |
17 | | int sysctl_read_ip_property_int(int af, const char *ifname, const char *property, int *ret); |
18 | | int sysctl_read_ip_property_uint32(int af, const char *ifname, const char *property, uint32_t *ret); |
19 | | int sysctl_write_ip_property(int af, const char *ifname, const char *property, const char *value, Hashmap **shadow); |
20 | | int sysctl_write_ip_property_boolean(int af, const char *ifname, const char *property, bool value, Hashmap **shadow); |
21 | | |
22 | | int sysctl_write_ip_neighbor_property(int af, const char *ifname, const char *property, const char *value, Hashmap **shadow); |
23 | | int sysctl_write_ip_neighbor_property_uint32(int af, const char *ifname, const char *property, uint32_t value, Hashmap **shadow); |
24 | | |
25 | | #define DEFINE_SYSCTL_WRITE_IP_PROPERTY(name, type, format) \ |
26 | 0 | static inline int sysctl_write_ip_property_##name(int af, const char *ifname, const char *property, type value, Hashmap **shadow) { \ |
27 | 0 | char buf[DECIMAL_STR_MAX(type)]; \ |
28 | 0 | xsprintf(buf, format, value); \ |
29 | 0 | return sysctl_write_ip_property(af, ifname, property, buf, shadow); \ |
30 | 0 | } Unexecuted instantiation: udev-rules.c:sysctl_write_ip_property_int Unexecuted instantiation: udev-rules.c:sysctl_write_ip_property_uint32 Unexecuted instantiation: networkd-ipv6ll.c:sysctl_write_ip_property_int Unexecuted instantiation: networkd-ndisc.c:sysctl_write_ip_property_int Unexecuted instantiation: networkd-route-util.c:sysctl_write_ip_property_int Unexecuted instantiation: networkd-route-util.c:sysctl_write_ip_property_uint32 Unexecuted instantiation: printk-util.c:sysctl_write_ip_property_int Unexecuted instantiation: printk-util.c:sysctl_write_ip_property_uint32 Unexecuted instantiation: socket-util.c:sysctl_write_ip_property_int Unexecuted instantiation: socket-util.c:sysctl_write_ip_property_uint32 Unexecuted instantiation: sysctl-util.c:sysctl_write_ip_property_int Unexecuted instantiation: sysctl-util.c:sysctl_write_ip_property_uint32 Unexecuted instantiation: manager.c:sysctl_write_ip_property_int Unexecuted instantiation: manager.c:sysctl_write_ip_property_uint32 |
31 | | |
32 | 0 | DEFINE_SYSCTL_WRITE_IP_PROPERTY(int, int, "%i"); |
33 | | DEFINE_SYSCTL_WRITE_IP_PROPERTY(uint32, uint32_t, "%" PRIu32); Unexecuted instantiation: networkd-ipv6ll.c:sysctl_write_ip_property_uint32 Unexecuted instantiation: networkd-ndisc.c:sysctl_write_ip_property_uint32 Unexecuted instantiation: networkd-sysctl.c:sysctl_write_ip_property_uint32 |