]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/arphrd-list.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 #include <net/if_arp.h>
7 #include "arphrd-list.h"
9 #include "missing_network.h"
11 static const struct arphrd_name
* lookup_arphrd(register const char *str
, register GPERF_LEN_TYPE len
);
13 #include "arphrd-from-name.h"
14 #include "arphrd-to-name.h"
16 const char *arphrd_to_name(int id
) {
21 if ((size_t) id
>= ELEMENTSOF(arphrd_names
))
24 return arphrd_names
[id
];
27 int arphrd_from_name(const char *name
) {
28 const struct arphrd_name
*sc
;
32 sc
= lookup_arphrd(name
, strlen(name
));
39 int arphrd_max(void) {
40 return ELEMENTSOF(arphrd_names
);