summaryrefslogtreecommitdiff
path: root/src/basic/arphrd-to-name.awk
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic/arphrd-to-name.awk')
-rw-r--r--src/basic/arphrd-to-name.awk11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/basic/arphrd-to-name.awk b/src/basic/arphrd-to-name.awk
index 5a35673e2c..db1c739abb 100644
--- a/src/basic/arphrd-to-name.awk
+++ b/src/basic/arphrd-to-name.awk
@@ -1,9 +1,12 @@
BEGIN{
- print "static const char* const arphrd_names[] = { "
+ print "const char *arphrd_to_name(int id) {"
+ print " switch(id) {"
}
-!/CISCO/ {
- printf " [ARPHRD_%s] = \"%s\",\n", $1, $1
+!/^HDLC$/ {
+ printf " case ARPHRD_%s: return \"%s\";\n", $1, $1
}
END{
- print "};"
+ print " default: return NULL;"
+ print " }"
+ print "}"
}