 
 public extension InetProtocol {
     var rawValue:Int32 {
-        get {
-            switch self {
-                case .TCP:
-                    return IPPROTO_TCP
-                case .UDP:
-                    return IPPROTO_UDP
-            }
+        switch self {
+            case .TCP:
+                return IPPROTO_TCP
+            case .UDP:
+                return IPPROTO_UDP
         }
     }
 }
 
 public extension ProtocolFamily {
     var rawValue:Int32 {
-        get {
-            switch self {
-                case .INET:
-                    return PF_INET
-                case .INET6:
-                    return PF_INET6
-            }
+        switch self {
+            case .INET:
+                return PF_INET
+            case .INET6:
+                return PF_INET6
         }
     }
 }
 */
public struct Address {
    public let addr:Buffer <sockaddr>!
}

// MARK: -


extension Address: CustomStringConvertible {
    public var description: String {

        var copy = self


        return "\(copy.hostname):\(copy.service)"
    }
}

public extension Address {


    public var as_sockaddr_in:sockaddr_in? {
        return protocolFamily == .INET ? UnsafePointer <sockaddr_in>(addr.baseAddress).memory : nil
    }

    public var as_sockaddr_in6:sockaddr_in6? {
        return protocolFamily == .INET ? UnsafePointer <sockaddr_in6>(addr.baseAddress).memory : nil
    }

    public var protocolFamily:ProtocolFamily? {
        switch addr.baseAddress.memory.sa_family {
            case sa_family_t(PF_INET):
                return .INET
            case sa_family_t(PF_INET6):
                return .INET6
            default:
                return nil
        }
    }
}
