]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/af-list.h
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / src / basic / af-list.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2014 Lennart Poettering
8 ***/
9
10 #include <sys/socket.h>
11
12 #include "string-util.h"
13
14 const char *af_to_name(int id);
15 int af_from_name(const char *name);
16
17 static inline const char* af_to_name_short(int id) {
18 const char *f;
19
20 if (id == AF_UNSPEC)
21 return "*";
22
23 f = af_to_name(id);
24 if (!f)
25 return "unknown";
26
27 assert(startswith(f, "AF_"));
28 return f + 3;
29 }
30
31 int af_max(void);