]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/arphrd-list.c
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 This file is part of systemd.
5 Copyright 2014 Lennart Poettering
8 #include <net/if_arp.h>
11 #include "arphrd-list.h"
14 static const struct arphrd_name
* lookup_arphrd(register const char *str
, register GPERF_LEN_TYPE len
);
16 #include "arphrd-from-name.h"
17 #include "arphrd-to-name.h"
19 const char *arphrd_to_name(int id
) {
24 if (id
>= (int) ELEMENTSOF(arphrd_names
))
27 return arphrd_names
[id
];
30 int arphrd_from_name(const char *name
) {
31 const struct arphrd_name
*sc
;
35 sc
= lookup_arphrd(name
, strlen(name
));
42 int arphrd_max(void) {
43 return ELEMENTSOF(arphrd_names
);