support IPv6 in OFConnectionManager

Reviewer: @kenchiang

This pull request refactors a few places that need to handle different protocol
types, then adds IPv6 support. I tested this manually by connecting to a
controller using loopback and link-local addresses.
No. The port number is optional and is separated from the IP by a colon character. Since IPv6 addresses can use zero compression, it can be ambiguous whether a port number is present or if those digits are part of the IP. The brackets resolve the ambiguity.