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.
minor: any reason why you wanted the brackets?  to differentiate between v4 and v6?