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
+9
View File
@@ -0,0 +1,9 @@
BEGIN{
print "static const char* const socket_protocol_names[] = { "
}
!/HOPOPTS/ {
printf " [IPPROTO_%s] = \"%s\",\n", $1, tolower($1)
}
END{
print "};"
}