soconnect_mac.d from The DTrace book, modified to add IPv6 support.