diff options
author | Tom Gundersen <teg@jklm.no> | 2014-01-28 23:23:31 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-01-30 14:30:39 +0100 |
commit | 377a218f876507fb8be9c21ef4121fa2576ec317 (patch) | |
tree | e5da9ac8c900e9150b752cf0b75f027c748424b5 /src/shared/net-util.h | |
parent | eb0ea358b688a6f83ff305c6b825c61f12b6dcb8 (diff) |
sd-dhcp-client/net-util: make netmask_to_prefixlen generic
This was originally included in the dhcp-client at my request, but it is not
really dhcp-specific and useful outside of it, so let's pull it out.
Diffstat (limited to 'src/shared/net-util.h')
-rw-r--r-- | src/shared/net-util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/net-util.h b/src/shared/net-util.h index c7edfb96f0..0ec04db87e 100644 --- a/src/shared/net-util.h +++ b/src/shared/net-util.h @@ -22,6 +22,7 @@ #pragma once #include <netinet/ether.h> +#include <netinet/in.h> #include <stdbool.h> bool net_match_config(const struct ether_addr *match_mac, @@ -35,6 +36,8 @@ bool net_match_config(const struct ether_addr *match_mac, const char *dev_type, const char *dev_name); +unsigned net_netmask_to_prefixlen(const struct in_addr *netmask); + int config_parse_hwaddr(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); |