blob: 7f1c9f0097c1920f7d96b1dd326f72275070d4b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1
if [ $# -gt 0 ] ; then
uapi_header_dir=$1
else
uapi_header_dir=tools/include/uapi/linux/
fi
printf "static const char *socket_ipproto[] = {\n"
ipproto_regex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*'
egrep $ipproto_regex ${uapi_header_dir}/in.h | \
sed -r "s/$ipproto_regex/\2 \1/g" | \
sort -n | xargs printf "\t[%s] = \"%s\",\n"
printf "};\n"
|