     }
 }
 
-/// Performs the call `Darwin.getaddrinfo()`.
-///
-/// The `getaddrinfo(hostname:servname:hints:)` function is used to get a list 
-/// of IP addresses and port numebrs for host `hostname` and service `servname`.
-/// - parameter hostname: Either a valid host name or a numeric host address, 
-///     consisting of a dotted decimal IPv4 address or a n IPv6 address.
-/// - parameter servername: Either a decimal port number or a service name
-///     listed in services(5) - see the man pages.
-///
-/// - Attention: `hostname` and `servername` can not be both nil, that is, only
-///                 only one may be nil at a time.
-/// 
+/// Obtains a list of IP addresses and port number, given the requirements
+/// `hostname`, `serviceName` and `hints`.
+///
+/// The list of addresses given will be filtered out by the options specificed.
+/// If `serviceName` is specified, then only hosts with that service will be
+/// returned, this is likewise for `hostname` too.
+///
+/// `hints` provides additional specification to the type of address returned.
+/// You may set these fields to filter for a specific type of address:
+///
+/// - `ai_family` to control the protocol family used. If this
+///     value can be any, then it should be set to `PF_UNSPEC`. This is
+///     equivelent to `DomainAddressFamily`.
+/// - `ai_socktype` denotes the allowed socket type given. Zero allows
+///     any type. This is equivelent to `SocketType`.
+/// - `ai_protocol` indicates the transport layer desired. Zero again
+///     allows any protocol. This is equivelent to `CommunicationProtocol`.
+/// - `ai_flags` allows additional filtering. See this
+///     [page](x-man-page://3/getaddrinfo)
+///
+///
+/// - Attention:    `hostname` and `servername` may not be both nil at the same
+///                 time.
+///
+/// - parameters:
+///     - hostname:     Either a valid host name or a numeric host address,
+///                     cosisting of a dotted decimal IPv4 address or a IPv6
+///                     address.
+///     - servicename:  Either a decimal port number or a service name (see
+///                     [services](x-man-page://5/services))
+///
+///
 /// - Throws:
-///     - `NetworkUtilities.ParmeterError` when invalid parameters are present.
-///     - `NetworkUtilities.LibraryError` when an error occured within 
-///         `Darwin.getaddrinfo()`. The functions return value is returned as
-///         an associate value, see the man pages for the corresponding error
-///         codes.
-public func getaddrinfo(host hostname: String?, service servername: String?,
+///     - `NetworkUtilities.ParmeterError`
+///     - `NetworkUtilities.GetAddressInfoFailed`
+public func getaddrinfo(host hostname: String?, service serviceName: String?,
     hints: UnsafePointer<addrinfo>) throws -> [AddrInfo] {
     
-        guard !(hostname == nil && servername == nil) else {
+        guard !(hostname == nil && serviceName == nil) else {
             throw NetworkUtilitiesError.ParameterError(
                 "Host name and server name cannot be nil at the same time!"
             )

        let hostname_val: (ptr: UnsafeMutablePointer, len: Int) =
        hostname?.getCString ?? (nil, 0)
        let servname_val: (ptr: UnsafeMutablePointer, len: Int) =
        servername?.getCString ?? (nil, 0)
        
        defer {
            if hostname_val.len > 0 {

    
    @available(*, unavailable, renamed="GetAddressInfoFailed")
    case GetAddressFailed(Int32)
    /// Thrown by `getnameinfo(
    case GetNameInfoFailed(Int32)
    /// Occurs when an invalid parameter is given.
    case ParameterError(String)
