]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/af-list.c
a27caf9399e4e8cae4211df51f274c09104cdf15
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 Copyright 2013 Lennart Poettering
7 #include <sys/socket.h>
12 static const struct af_name
* lookup_af(register const char *str
, register GPERF_LEN_TYPE len
);
14 #include "af-from-name.h"
15 #include "af-to-name.h"
17 const char *af_to_name(int id
) {
22 if (id
>= (int) ELEMENTSOF(af_names
))
28 int af_from_name(const char *name
) {
29 const struct af_name
*sc
;
33 sc
= lookup_af(name
, strlen(name
));
41 return ELEMENTSOF(af_names
);