SCNetworkConfiguration

Overview

The SCNetworkConfiguration programming interface provides access to the stored network configuration. The functions include providing access to the network-capable devices on the system, the network sets, network services, and network protocols. Note that these functions follow Core Foundation function-name conventions. A function that has "Create" or "Copy" in its name returns a reference you must release with the CFRelease function.

Note that when using the functions in this programming interface, you must call the SCPreferencesCommitChanges(_:) function to ensure that your changes are committed to permanent storage.

Symbols

Configuring Ethernet Bond Interfaces

func SCBondInterfaceCopyAll(SCPreferences)

Returns all Ethernet bond interfaces on the system.

func SCBondInterfaceCopyAvailableMemberInterfaces(SCPreferences)

Returns all network capable devices on the system that can be added to an Ethernet bond interface.

func SCBondInterfaceCopyStatus(SCBondInterface)

Returns the status of the specified Ethernet bond interface.

func SCBondInterfaceCreate(SCPreferences)

Creates a new Ethernet bond interface.

func SCBondInterfaceGetMemberInterfaces(SCBondInterface)

Returns the member interfaces for the specified Ethernet bond interface.

func SCBondInterfaceGetOptions(SCBondInterface)

Returns the configuration settings associated with the specified Ethernet bond interface.

func SCBondInterfaceRemove(SCBondInterface)

Removes the Ethernet bond interface from the configuration.

func SCBondInterfaceSetLocalizedDisplayName(SCBondInterface, CFString)

Sets the localized display name for the specified Ethernet bond interface.

func SCBondInterfaceSetMemberInterfaces(SCBondInterface, CFArray)

Sets the member interfaces for the specified Ethernet bond interface.

func SCBondInterfaceSetOptions(SCBondInterface, CFDictionary)

Sets the configuration settings for the specified Ethernet bond interface.

func SCBondStatusGetInterfaceStatus(SCBondStatus, SCNetworkInterface?)

Returns the status of the specified member interface of an Ethernet bond or the status of the bond as a whole.

func SCBondStatusGetMemberInterfaces(SCBondStatus)

Returns the member interfaces that are represented with the Ethernet bond interface.

func SCBondStatusGetTypeID()

Returns the type identifier of all SCBondStatusRef instances.

Configuring Network Interfaces

func SCNetworkInterfaceCopyAll()

Returns all network-capable interfaces on the system.

func SCNetworkInterfaceCopyMTU(SCNetworkInterface, UnsafeMutablePointer<Int32>?, UnsafeMutablePointer<Int32>?, UnsafeMutablePointer<Int32>?)

Returns the current MTU setting and the range of allowable values for the specified network interface.

func SCNetworkInterfaceCopyMediaSubTypeOptions(CFArray, CFString)

Returns a list of available media options for the specified interface configuration options and subtype.

func SCNetworkInterfaceCopyMediaSubTypes(CFArray)

Returns a list of available media subtypes for the specified interface configuration options.

func SCNetworkInterfaceCreateWithInterface(SCNetworkInterface, CFString)

Creates a new network interface layered on top of the specified interface.

func SCNetworkInterfaceForceConfigurationRefresh(SCNetworkInterface)

Sends a notification to interested network configuration agents to immediately retry their configuration.

func SCNetworkInterfaceGetBSDName(SCNetworkInterface)

Returns the BSD interface or device name for the specified interface.

func SCNetworkInterfaceGetConfiguration(SCNetworkInterface)

Returns the configuration settings associated with the specified interface.

func SCNetworkInterfaceGetExtendedConfiguration(SCNetworkInterface, CFString)

Returns the extended configuration settings associated with the specified interface.

func SCNetworkInterfaceGetHardwareAddressString(SCNetworkInterface)

Returns a displayable link layer address for the specified interface.

func SCNetworkInterfaceGetInterface(SCNetworkInterface)

Returns the underlying interface, for layered network interfaces.

func SCNetworkInterfaceGetInterfaceType(SCNetworkInterface)

Returns the network interface type of the specified interface.

func SCNetworkInterfaceGetLocalizedDisplayName(SCNetworkInterface)

Returns the localized display name, such as "Ethernet" or "FireWire," for the specified interface.

func SCNetworkInterfaceGetSupportedInterfaceTypes(SCNetworkInterface)

Identifies all of the network interface types, such as PPP, that can be layered on top of the specified interface.

func SCNetworkInterfaceGetSupportedProtocolTypes(SCNetworkInterface)

Identifies all of the network protocol types, such as IPv4 and IPv6, that can be layered on top of the specified interface.

func SCNetworkInterfaceGetTypeID()

Returns the type identifier of all SCNetworkInterface instances.

func SCNetworkInterfaceSetConfiguration(SCNetworkInterface, CFDictionary?)

Stores the configuration settings for the specified interface.

func SCNetworkInterfaceSetExtendedConfiguration(SCNetworkInterface, CFString, CFDictionary?)

Stores the extended configuration settings for the specified interface.

func SCNetworkInterfaceSetMTU(SCNetworkInterface, Int32)

Sets the requested MTU setting for the specified network interface.

func SCNetworkInterfaceSetMediaOptions(SCNetworkInterface, CFString, CFArray)

Sets the requested media subtype and options for the specified network interface.

Configuring Network Protocols

func SCNetworkProtocolGetConfiguration(SCNetworkProtocol)

Returns the configuration settings associated with the specified protocol.

func SCNetworkProtocolGetEnabled(SCNetworkProtocol)

Returns a Boolean value indicating whether the specified protocol is enabled.

func SCNetworkProtocolGetProtocolType(SCNetworkProtocol)

Returns the type of the specified network protocol.

func SCNetworkProtocolGetTypeID()

Returns the type identifier of all SCNetworkProtocol instances.

func SCNetworkProtocolSetConfiguration(SCNetworkProtocol, CFDictionary?)

Stores the configuration settings for the specified network protocol.

func SCNetworkProtocolSetEnabled(SCNetworkProtocol, Bool)

Enables or disables the specified protocol.

Configuring Network Services

func SCNetworkServiceAddProtocolType(SCNetworkService, CFString)

Adds the network protocol of the specified type to the specified service.

func SCNetworkServiceCopy(SCPreferences, CFString)

Returns the network service with the specified identifier.

func SCNetworkServiceCopyAll(SCPreferences)

Returns all available network services for the specified preferences.

func SCNetworkServiceCopyProtocol(SCNetworkService, CFString)

Returns the network protocol of the specified type for the specified service.

func SCNetworkServiceCopyProtocols(SCNetworkService)

Returns all network protocols associated with the specified service.

func SCNetworkServiceCreate(SCPreferences, SCNetworkInterface)

Creates a new network service for the specified interface in the configuration.

func SCNetworkServiceEstablishDefaultConfiguration(SCNetworkService)

Establishes the default configuration for the specified network service.

func SCNetworkServiceGetEnabled(SCNetworkService)

Returns a Boolean value indicating whether the specified service is enabled.

func SCNetworkServiceGetInterface(SCNetworkService)

Returns the network interface associated with the specified service.

func SCNetworkServiceGetName(SCNetworkService)

Returns the user-specified name associated with the specified service.

func SCNetworkServiceGetServiceID(SCNetworkService)

Returns the identifier for the specified service.

func SCNetworkServiceGetTypeID()

Returns the type identifier of all SCNetworkService instances.

func SCNetworkServiceRemove(SCNetworkService)

Removes the specified network service from the configuration.

func SCNetworkServiceRemoveProtocolType(SCNetworkService, CFString)

Removes the network protocol of the specified type from the specified service.

func SCNetworkServiceSetEnabled(SCNetworkService, Bool)

Enables or disables the specified service.

func SCNetworkServiceSetName(SCNetworkService, CFString?)

Stores the user-specified name for the specified service.

Configuring Network Sets

func SCNetworkSetAddService(SCNetworkSet, SCNetworkService)

Adds the specified network service to the specified set.

func SCNetworkSetContainsInterface(SCNetworkSet, SCNetworkInterface)

Returns a Boolean value indicating whether the specified interface is represented by at least one network service in the specified set.

func SCNetworkSetCopy(SCPreferences, CFString)

Returns the set with the specified identifier.

func SCNetworkSetCopyAll(SCPreferences)

Returns all available sets for the specified preferences session.

func SCNetworkSetCopyServices(SCNetworkSet)

Returns all network services associated with the specified set.

func SCNetworkSetCreate(SCPreferences)

Creates a new set in the configuration.

func SCNetworkSetGetName(SCNetworkSet)

Returns the user-specified name associated with the specified set.

func SCNetworkSetGetServiceOrder(SCNetworkSet)

Returns the user-specified ordering of network services within the specified set.

func SCNetworkSetGetSetID(SCNetworkSet)

Returns the identifier for the specified set.

func SCNetworkSetGetTypeID()

Returns the type identifier of all SCNetworkSet instances.

func SCNetworkSetRemove(SCNetworkSet)

Removes the specified set from the configuration.

func SCNetworkSetRemoveService(SCNetworkSet, SCNetworkService)

Removes the specified network service from the specified set.

func SCNetworkSetSetCurrent(SCNetworkSet)

Specifies the set that should be the current set.

func SCNetworkSetSetName(SCNetworkSet, CFString?)

Stores the user-specified name for the specified set.

func SCNetworkSetSetServiceOrder(SCNetworkSet, CFArray)

Stores the user-specified ordering of network services for the specified set.

Configuring VLAN Interfaces

func SCVLANInterfaceCopyAll(SCPreferences)

Returns all virtual LAN (VLAN) interfaces on the system.

func SCVLANInterfaceCopyAvailablePhysicalInterfaces()

Returns the network capable devices on the system that can be associated with a virtual LAN (VLAN) interface.

func SCVLANInterfaceGetOptions(SCVLANInterface)

Returns the configuration settings associated with the virtual LAN (VLAN) interface.

func SCVLANInterfaceGetPhysicalInterface(SCVLANInterface)

Returns the physical interface for the specified virtual LAN (VLAN) interface.

func SCVLANInterfaceGetTag(SCVLANInterface)

Returns the tag for the specified virtual LAN (VLAN) interface.

func SCVLANInterfaceRemove(SCVLANInterface)

Removes the virtual LAN (VLAN) interface from the configuration.

func SCVLANInterfaceSetLocalizedDisplayName(SCVLANInterface, CFString)

Sets the localized display name for the specified virtual LAN (VLAN) interface.

func SCVLANInterfaceSetOptions(SCVLANInterface, CFDictionary)

Sets the specified configuration settings for the specified virtual LAN (VLAN) interface.

func SCVLANInterfaceSetPhysicalInterfaceAndTag(SCVLANInterface, SCNetworkInterface, CFNumber)

Updates the specified virtual LAN (VLAN) interface with the specified information.

Data Types

SCNetworkInterface

The reference to an object that represents a network interface.

SCBondInterface

The reference to an object that represents an Ethernet bond interface.

SCBondStatus

The reference to an object that represents the status of an Ethernet bond interface.

SCVLANInterface

The reference to an object that represents a virtual LAN (VLAN) interface.

SCNetworkProtocol

The reference to an object that represents a network protocol.

SCNetworkService

The reference to an object that represents a network service.

SCNetworkSet

The reference to an object that represents a network set.

Constants

Ethernet Bond Aggregation Status

Ethernet bond aggregation status codes.

Ethernet Bond Status Constants

Ethernet bond status codes.

Network Interface Types

Keys that identify network interface types.

Network Protocol Types

Keys that identify network protocol types.