basic: introduce socket_protocol_{from,to}_name()

And use them where they can be applicable.
This commit is contained in:
Yu Watanabe
2017-12-23 19:32:04 +09:00
parent 8a211c8edb
commit e045e325df
9 changed files with 141 additions and 33 deletions
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh -eu
$1 -dM -include netinet/in.h - </dev/null | \
awk '/^#define[ \t]+IPPROTO_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
sed -e 's/IPPROTO_//'