1993-03-21 12:45:37 +03:00
|
|
|
awk '
|
|
|
|
BEGIN {
|
|
|
|
print "#include <sys/param.h>"
|
|
|
|
print "#include <sys/socket.h>"
|
|
|
|
print "#include <sys/socketvar.h>"
|
|
|
|
print "#include <net/route.h>"
|
|
|
|
print "#include <net/if.h>"
|
|
|
|
print "#include <sys/termios.h>"
|
1994-01-09 20:42:17 +03:00
|
|
|
print "#include <net/bpf.h>"
|
1993-03-21 12:45:37 +03:00
|
|
|
print "#define COMPAT_43"
|
|
|
|
print "#include <sys/ioctl.h>"
|
|
|
|
print ""
|
|
|
|
print "char *"
|
|
|
|
print "ioctlname(val)"
|
|
|
|
print "{"
|
|
|
|
print ""
|
|
|
|
}
|
|
|
|
|
1994-01-09 20:42:17 +03:00
|
|
|
/^#[ ]*define[ ]*(BIO|TIO|FIO|SIO|OSIO)[A-Z]*[ ]*_IO/ {
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
# find where the name starts
|
|
|
|
for (i = 1; i <= NF; i++)
|
|
|
|
if ($i ~ /define/)
|
|
|
|
break;
|
|
|
|
++i;
|
|
|
|
#
|
|
|
|
printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i);
|
|
|
|
|
|
|
|
}
|
|
|
|
END {
|
|
|
|
print "\n\treturn(NULL);"
|
|
|
|
print "}"
|
|
|
|
}
|
1994-01-09 20:42:17 +03:00
|
|
|
' /usr/include/sys/ioctl.h /usr/include/sys/ioctl_compat.h /usr/include/net/bpf.h
|