Mac Developer Library

Developer

SystemConfiguration Framework Reference SCDynamicStoreKey Reference

Options
Deployment Target:

On This Page
Language:

SCDynamicStoreKey Reference

The SCDynamicStoreKey programming interface provides convenience functions that an application can use to create a correctly formatted dynamic store key for accessing specific items in the dynamic store. An application can then use the resulting string in any function that requires a dynamic store key.

Functions

  • Creates a dynamic store key using the specified format.

    Declaration

    Objective-C

    CFStringRef SCDynamicStoreKeyCreate ( CFAllocatorRef allocator, CFStringRef fmt, ... );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    fmt

    The description of the format for this key.

    Return Value

    A string containing the formatted key.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Availability

    Available in OS X v10.1 and later.

  • Creates a dynamic store key that can be used to access a specific global (as opposed to a per-service or per-interface) network configuration entity.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateNetworkGlobalEntity(_ allocator: CFAllocator!, _ domain: CFString!, _ entity: CFString!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateNetworkGlobalEntity ( CFAllocatorRef allocator, CFStringRef domain, CFStringRef entity );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    domain

    The desired domain, such as the requested configuration or the current state.

    entity

    The specific global entity, such as IPv4 or DNS.

    Return Value

    A string containing the formatted key.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Creates a dynamic store key that can be used to access the network interface configuration information in the dynamic store.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateNetworkInterface(_ allocator: CFAllocator!, _ domain: CFString!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateNetworkInterface ( CFAllocatorRef allocator, CFStringRef domain );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    domain

    The desired domain, such as the requested configuration or the current state.

    Return Value

    A string containing the formatted key.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Creates a dynamic store key that can be used to access the per-interface network configuration information in the dynamic store.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateNetworkInterfaceEntity(_ allocator: CFAllocator!, _ domain: CFString!, _ ifname: CFString!, _ entity: CFString!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateNetworkInterfaceEntity ( CFAllocatorRef allocator, CFStringRef domain, CFStringRef ifname, CFStringRef entity );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    domain

    The desired domain, such as the requested configuration or the current state.

    ifname

    The interface name or a regular expression pattern.

    entity

    The specific global entity, such as IPv4 or DNS.

    Return Value

    A string containing the formatted key.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Creates a dynamic store key that can be used to access the per-service network configuration information.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateNetworkServiceEntity(_ allocator: CFAllocator!, _ domain: CFString!, _ serviceID: CFString!, _ entity: CFString!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateNetworkServiceEntity ( CFAllocatorRef allocator, CFStringRef domain, CFStringRef serviceID, CFStringRef entity );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    domain

    The desired domain, such as the requested configuration or the current state.

    serviceID

    The service ID or a regular expression pattern.

    entity

    The specific global entity, such as IPv4 or DNS.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Creates a key that can be used to receive notifications when the current computer name changes.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateComputerName(_ allocator: CFAllocator!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateComputerName ( CFAllocatorRef allocator );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    Return Value

    A notification string for the current computer or host name.

    Discussion

    Use this key with the SCDynamicStoreSetNotificationKeys function.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Creates a key that can be used to receive notifications when the current console user changes.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateConsoleUser(_ allocator: CFAllocator!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateConsoleUser ( CFAllocatorRef allocator );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    Return Value

    A notification string for the current console user.

    Discussion

    Use this key with the SCDynamicStoreSetNotificationKeys function.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Creates a key that can be used to receive notifications when the HostNames entity changes.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateHostNames(_ allocator: CFAllocator!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateHostNames ( CFAllocatorRef allocator );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    Return Value

    A notification string for the HostNames entity.

    Discussion

    Use this key with the SCDynamicStoreSetNotificationKeys function. Note that the HostNames entity includes the local host name.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.2 and later.

  • Creates a key that can be used to receive notifications when the location identifier changes.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateLocation(_ allocator: CFAllocator!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateLocation ( CFAllocatorRef allocator );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    Return Value

    A notification string for the current location identifier.

    Discussion

    Use this key with the SCDynamicStoreSetNotificationKeys function.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.2 and later.

  • Creates a key that can be used to receive notifications when the current network proxy settings are changed.

    Declaration

    Swift

    func SCDynamicStoreKeyCreateProxies(_ allocator: CFAllocator!) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef SCDynamicStoreKeyCreateProxies ( CFAllocatorRef allocator );

    Parameters

    allocator

    The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

    Return Value

    A notification string for the current proxy settings.

    Discussion

    Use this key with the SCDynamicStoreSetNotificationKeys function.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.