<!--
{
  "availability" : [
    "iOS: 2.0.0 - 27.0.0",
    "iPadOS: 2.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.2.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CFNetwork",
  "identifier" : "/documentation/CFNetwork/CFNetServiceGetAddressing(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "CFNetwork"
    ],
    "preciseIdentifier" : "c:@F@CFNetServiceGetAddressing"
  },
  "title" : "CFNetServiceGetAddressing(_:)"
}
-->

# CFNetServiceGetAddressing(_:)

Gets the IP addressing from a CFNetService.

```
func CFNetServiceGetAddressing(_ theService: CFNetService) -> Unmanaged<CFArray>?
```

## Parameters

`theService`

The CFNetService whose IP addressing is to be obtained; cannot be `NULL`.

## Return Value

A CFArray containing a CFDataRef for each IP address returned, or `NULL`. Each CFDataRef consists of a `sockaddr` structure containing the IP address of the service. This function returns `NULL` if the service’s addressing is unknown because [`CFNetServiceResolve`](/documentation/CFNetwork/CFNetServiceResolve) has not been called for `theService`.

## Discussion

This function gets the IP addressing from a CFNetService. Typically, the CFNetService was obtained by calling [`CFNetServiceBrowserSearchForServices(_:_:_:_:)`](/documentation/CFNetwork/CFNetServiceBrowserSearchForServices(_:_:_:_:)). Before calling this function, call [`CFNetServiceResolve`](/documentation/CFNetwork/CFNetServiceResolve) to update the CFNetService with its IP addressing.

### Special Considerations

This function gets the data in a thread-safe way, but the data itself is not safe if the service is altered from another thread.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)