]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/af-list.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 This file is part of systemd.
5 Copyright 2013 Lennart Poettering
9 #include <sys/socket.h>
14 static const struct af_name
* lookup_af(register const char *str
, register GPERF_LEN_TYPE len
);
16 #include "af-from-name.h"
17 #include "af-to-name.h"
19 const char *af_to_name(int id
) {
24 if (id
>= (int) ELEMENTSOF(af_names
))
30 int af_from_name(const char *name
) {
31 const struct af_name
*sc
;
35 sc
= lookup_af(name
, strlen(name
));
43 return ELEMENTSOF(af_names
);