sysctl-util: introduce sysctl_read_ip_property_int() and _uint32()

Currently not used, but will be used later.
This commit is contained in:
Yu Watanabe
2024-10-15 06:42:12 +09:00
parent 39b2ee5369
commit d56d07fc1e
2 changed files with 29 additions and 0 deletions
+2
View File
@@ -17,6 +17,8 @@ static inline int sysctl_write(const char *property, const char *value) {
}
int sysctl_read_ip_property(int af, const char *ifname, const char *property, char **ret);
int sysctl_read_ip_property_int(int af, const char *ifname, const char *property, int *ret);
int sysctl_read_ip_property_uint32(int af, const char *ifname, const char *property, uint32_t *ret);
int sysctl_write_ip_property(int af, const char *ifname, const char *property, const char *value, Hashmap **shadow);
static inline int sysctl_write_ip_property_boolean(int af, const char *ifname, const char *property, bool value, Hashmap **shadow) {
return sysctl_write_ip_property(af, ifname, property, one_zero(value), shadow);