diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-04-20 16:28:12 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-04-26 13:51:44 +0200 |
commit | f91c6093efba5738436adb41aa4b6d0abc66cdc9 (patch) | |
tree | b67c122a4a39899996b10e0d1dfb094b7601f1ca /src/basic/parse-util.h | |
parent | 4d7c3570a6cd057cb131d53c19edae8258ed914f (diff) | |
download | systemd-f91c6093efba5738436adb41aa4b6d0abc66cdc9.tar.gz |
parse-util: add explicit parsers for MTU values
We use MTUs all over the place, let's add a unified, strict parser for
it, that takes MTU ranges into account.
We already have parse_ifindex() close-by, hence this appears to be a
natural addition, in particular as the range checking is not entirely
trivial to do, as it depends on the protocol used.
Diffstat (limited to 'src/basic/parse-util.h')
-rw-r--r-- | src/basic/parse-util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/parse-util.h b/src/basic/parse-util.h index 74c30b5570..742063c9a4 100644 --- a/src/basic/parse-util.h +++ b/src/basic/parse-util.h @@ -22,6 +22,7 @@ int parse_dev(const char *s, dev_t *ret); int parse_pid(const char *s, pid_t* ret_pid); int parse_mode(const char *s, mode_t *ret); int parse_ifindex(const char *s, int *ret); +int parse_mtu(int family, const char *s, uint32_t *ret); int parse_size(const char *t, uint64_t base, uint64_t *size); int parse_range(const char *t, unsigned *lower, unsigned *upper); |