]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/basic/af-list.h
util: introduce memcmp_safe()
[thirdparty/systemd.git] / src / basic / af-list.h
CommitLineData
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
8const char *af_to_name(int id);
9int af_from_name(const char *name);
10
202b76ae
ZJS
11static 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 25int af_max(void);