]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/af-list.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
5 #include <sys/socket.h>
10 static const struct af_name
* lookup_af(register const char *str
, register GPERF_LEN_TYPE len
);
12 #include "af-from-name.h"
13 #include "af-to-name.h"
15 const char *af_to_name(int id
) {
20 if ((size_t) id
>= ELEMENTSOF(af_names
))
26 int af_from_name(const char *name
) {
27 const struct af_name
*sc
;
31 sc
= lookup_af(name
, strlen(name
));
39 return ELEMENTSOF(af_names
);