]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/arphrd-list.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #include <net/if_arp.h>
6 #include "arphrd-list.h"
9 static const struct arphrd_name
* lookup_arphrd(register const char *str
, register GPERF_LEN_TYPE len
);
11 #include "arphrd-from-name.h"
12 #include "arphrd-to-name.h"
14 const char *arphrd_to_name(int id
) {
19 if (id
>= (int) ELEMENTSOF(arphrd_names
))
22 return arphrd_names
[id
];
25 int arphrd_from_name(const char *name
) {
26 const struct arphrd_name
*sc
;
30 sc
= lookup_arphrd(name
, strlen(name
));
37 int arphrd_max(void) {
38 return ELEMENTSOF(arphrd_names
);