summaryrefslogtreecommitdiffstats
path: root/src/shared/generate-ip-protocol-list.sh
blob: ff898a9d466f486ece402b43132bdb4a8983496d (plain)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later

set -eu
set -o pipefail

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