summaryrefslogtreecommitdiff
path: root/src/basic/generate-arphrd-list.sh
blob: ca1ba7cad4d1380a9087f761d0b0088b15c4434a (plain)
1
2
3
4
5
6
7
8
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eu
set -o pipefail

${1:?} -dM -include linux/if_arp.h -include "${2:?}" - </dev/null | \
       awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
       sed -e 's/ARPHRD_//'