18c2ecf20Sopenharmony_ci#!/bin/sh 28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: LGPL-2.1 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciprintf "static const char *socket_ipproto[] = {\n" 78c2ecf20Sopenharmony_ciregex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*' 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciegrep $regex ${header_dir}/in.h | \ 108c2ecf20Sopenharmony_ci sed -r "s/$regex/\2 \1/g" | \ 118c2ecf20Sopenharmony_ci sort | xargs printf "\t[%s] = \"%s\",\n" 128c2ecf20Sopenharmony_ciprintf "};\n" 13