This removes requirement for existence of obsolete IPPROTO_DIVERT in
<netinet/in.h> and the 'divert' entry in /etc/protocols.
Also, this avoids running through the nsdispatch(3) machinery on startup,
cutting down about 20 syscalls, three of which are open(2). The code of
sockstat(1) itself is also reduced.
The only UI change for a normal execution is that now the divert(4)
sockets are reported as "divert4" instead of "div4". The prefix "4"
itself is also incorrect, as divert(4) is not a part of IPv4. This will
be addressed in a separate change.
There is small UI change for incorrect runs. Previously protocols listed
in /etc/protocols, but not supported, would err out like this:
- sockstat -P ggp sockstat: protocol 3 not supported
And non-existent protocols would err out like this:
- sockstat -P foo sockstat: cap_getprotobyname: No error: 0 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
Now both cases will consistently err:
sockstat: protocol foo not supported