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