Mitigate against possible unaligned access when parsing protocol data.

Reported by:	clang
Resolve warning about comparison of differently signed integers.

Reported by:	clang
Mark an unused variable as such.

Reported by:	clang
be16enc works with host byte order.
Mitigate against possible unaligned access when serialising data into a buffer.

Reported by:	clang
Avoid shadowing the global getopt(3) optarg variable.

Reported by:	clang
Mitigate against possible unaligned access when converting from sockaddr to
sockaddr_in.

Reproted by:	clang
Fix a const vs non-const string issue.

Reported by:	clang