CHAPTER 2
Using Network Setup
Protocol-specific Topics 49
The solution to this problem is very simple: assume that all entity references in
a set refer to entities that are in the same area as the set. This has two practical
consequences.
■ When comparing two entity references that might have come from a set
entity, always pass kOTCfgIgnoreArea when calling OTCfgIsSameEntityRef. The
OTCfgIsSameEntityRef function will then compare the entities as if they were
in the same area.
■ When opening an entity whose reference you have obtained from a set,
always call OTCfgChangeEntityArea to reset its area identifier to that of the
area in which you are working.
Listing 2-14 demonstrates this technique.
Protocol-specific Topics 2
This section contains hints and tips for working with the Network Setup
preferences of certain protocol stacks provided by Apple.
TCP/IP Notes 2
A TCP/IP network connection entity has a class of
kOTCfgClassNetworkConnection and a type of kOTCfgTypeTCPv4. The entity must
contain the following preferences:
■ kOTCfgTCPInterfacesPref, which contains the core TCP/IP configuration
information. For details, see the discussion below and
OTCfgTCPInterfacesUnpacked (page 112), OTCfgTCPInterfacesPacked
(page 114), and OTCfgTCPInterfacesPackedPart (page 114).
■ kOTCfgTCPDeviceTypePref, which contains data needed by the current TCP/IP
control panel. For details, see OTCfgTCPDeviceTypePref in the section “TCP/IP
Constants and Other Data Types” (page 160).
■ kOTCfgTCPRoutersListPref, which contains the list of configured routers. For
details, see OTCfgTCPRoutersList (page 119).
■ kOTCfgTCPSearchListPref, which contains the strings which make up the
implicit search path for DNS. For details, see OTCfgTCPSearchList (page 120).