]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
4298d0b5 LP |
2 | #pragma once |
3 | ||
dccca82b LP |
4 | #include <sys/socket.h> |
5 | ||
202b76ae ZJS |
6 | #include "string-util.h" |
7 | ||
4298d0b5 LP |
8 | const char *af_to_name(int id); |
9 | int af_from_name(const char *name); | |
10 | ||
202b76ae ZJS |
11 | static inline const char* af_to_name_short(int id) { |
12 | const char *f; | |
13 | ||
14 | if (id == AF_UNSPEC) | |
15 | return "*"; | |
16 | ||
17 | f = af_to_name(id); | |
18 | if (!f) | |
19 | return "unknown"; | |
20 | ||
21 | assert(startswith(f, "AF_")); | |
22 | return f + 3; | |
23 | } | |
24 | ||
4298d0b5 | 25 | int af_max(void); |