Network Setup
Page
 Contents
 Network Setup Reference
 111
Network Setup Protocol Structures and Data Types
Glossary Index
Page
 Figures, Tables, and Listings
Page
 Conventions Used in This Manual
About This Manual
 For More Information
 Network Setup Architecture
About Network Setup
 1Network configuration prior to Network Setup
 2Network Setup in Mac OS 8.5 through the present
 3Future Network Setup architecture
Inside the Network Setup Library
 4Structure of the Network Setup Library
 Database Structure
Network Setup Database Fundamentals
 Database Structure Example
 5Sample organization of the default area
 Database Operations
 Shows this process diagrammatically
 Preference Coherency
Legacy Issues
 Legacy Synchronization Algorithm
 Mac OS
Network Setup Version History
Mac OS Not released
 About Network Setup Network Setup Version History
 Opening the Database for Reading
Opening and Closing the Network Setup Database
 Opening the Database for Writing
 Using Network Setup
 Closing the Database After Writing
Closing the Database After Reading
 Listing 2-4Closing the database after writing
 Listing All Entities
Working with Entities
 KCfgClassAnyEntity and kCfgTypeAnyEntity, respectively
 NoErr HLock Handle entityRefs
 Listing 2-6Printing the user-visible name for an entity
 Finding an Active Entity
Reading and Writing Preferences
 Listing 2-7Reading a fixed-size preference
Reading Fixed-size Preferences
 OSStatus err AssertdbRef = nil Assertentity
 Listing 2-9Reading the user-visible name preference
Reading Variable-size Preferences
 == noErr HLockbuffer
 Listing 2-11Writing a preference
Writing Preferences
 Iterating the Preferences in an Entity
Listing 2-12Printing an entity’s table of contents
 If err != noErr PrintfFailed with error %ld.\n, err
 Working with Sets
 Finding the Active Set Entity
 Listing 2-13Finding the active set entity
 NoErr Return err
 Working with Sets
 Listing 2-15Finding the active TCP/IP entity
 Areas and Sets
 TCP/IP Notes
Protocol-specific Topics
 Start the cursor at the beginning of the packed preference
 PrefDataErr return paramErr
 AssertpackedPref != nil assertunpackedPref != nil
 Remote Access Notes
 Modem Notes
Listing 2-17Encrypting the user’s password
 Using Network Setup
 Using Network Setup
 Opening and Closing the Network Setup Database
Network Setup Functions
 OTCfgCloseDatabase
OTCfgOpenDatabase
 Managing Areas
 Represents a database session previously opened by calling
Obtains the default area
OTCfgGetCurrentArea
On input, a value of type CfgDatabaseRef page 98 that
 OTCfgOpenArea
OTCfgSetCurrentArea
 On input, a value of type CfgAreaID page 98 that identifies
Closes an area in the Network Setup database
OTCfgCloseArea
 OTCfgBeginAreaModifications
 OTCfgCommitAreaModifications
 OTCfgIsSameAreaID
OTCfgAbortAreaModifications
 OTCfgGetAreaName
 OTCfgSetAreaName
 OTCfgGetAreasList
OTCfgGetAreasCount
 On input, an array of elements of type Str255 that is large
Be less that expected if areas were deleted between calling
Is large enough to hold the number of area IDs specified by
You don’t want to get area IDs, set areaID to Null
 Value of noErr indicates that OTCfgCreateArea returned
Creates an area in the Network Setup database
OTCfgCreateArea
Output, areaID contains the ID of the area that was created
 Value of noErr indicates that OTCfgDuplicateArea returned
Copies the contents of one area to another area
OTCfgDuplicateArea
By areaID does not exist, OTCfgDuplicateArea returns
 OTCfgDeleteArea
Deletes an area in the Network Setup database
Managing Entities
 KCfgTypeAnyEntity. For a list of possible types, see Entity
Not exist, OTCfgGetEntitiesCount returns the error
OTCfgGetEntitiesCount
Classes and Types
 Obtains information about entities in an area
OTCfgGetEntitiesList
 Network Setup Reference
 Creates an entity in an area
OTCfgIsSameEntityRef
OTCfgCreateEntity
Compares two entity references
 On input, a pointer to a value of type CfgEntityRef
AreaID is not writable, OTCfgCreateEntity returns the error
Already exists, OTCfgCreateEntity returns the error
Specifies the class, type, user-visible name, and icon for
 OTCfgDuplicateEntity
OTCfgDeleteEntity
 User-visible name of the entity represented by entityRef
OTCfgGetEntityLogicalName
Obtains the user-visible name of an entity
Reference for an entity, call OTCfgGetEntitiesList
 Obtains the name of an entity
OTCfgGetEntityName
 OTCfgSetEntityName
 OTCfgChangeEntityArea
OTCfgGetEntityArea
 Managing Preferences
 OTCfgOpenPrefs
 OTCfgGetPrefsSize
OTCfgClosePrefs
 OTCfgGetPrefs
 OTCfgSetPrefs
 Gets the number of preferences in an entity
OTCfgGetPrefsTOCCount
 Gets a list of the preferences in an entity
OTCfgGetPrefsTOC
 Deletes a preference
OTCfgGetDefault
OTCfgDeletePrefs
 OTCfgGetTemplate
Gets the default value for a specific preference
 Value of noErr indicates that OTCfgGetTemplate returned
Returns as much data as possible and returns the error
Value but not the default value itself, set data to Null
Preference Utilities
 OTCfgDecrypt
OTCfgEncrypt
 OTCfgInstallNotifier
Installing and Removing a Notification Callback
 Values, see the constants described in Entity Classes
Notification callback that is to be installed
Notification callback when it is called
Value of noErr indicates that OTCfgInstallNotifier returned
 Removes a notification callback
Was specified when the notification callback was installed
Application-Defined Routines
OTCfgRemoveNotifier
 Notification Callback Routine
Network Setup Structures and Data Types
 An unsigned 32-bit value that uniquely identifies an area
CfgDatabaseRef
CfgAreaID
Value of type CfgAreaID identifies an area
 Area in which the entity resides
CfgEntityRef
CfgEntityInfo
CfgEntityRef structure refers to a specific entity
 CfgPrefsHeader
CfgEntityAccessID
 101
CfgResourceLocator
CfgSetsStruct
 Follows
For the fFlags field that follows
An array of time stamps used during legacy import
Export indexed by the enumeration for the fTimes field that
 103
CfgSetsElement
CfgSetsVector
 Entity Classes and Types
Network Setup Constants
 105
Class code for network connection entities
 Following enumeration defines per-connection preference types
Common Preference Types
 107
This preference is not documented
Dummy preference type used for free blocks in an entity
Following enumeration defines global preference types
 Set Entity Preference Types
 Constant kInvalidCfgAreaID represents an invalid area ID
Basic user mode
Advanced user mode
Invalid Area ID
 Result Codes
 111
Protocol Structures
TCP/IP Structures
 OTCfgTCPInterfacesUnpacked
 113
 Containing port, module, and framing information
OTCfgTCPInterfacesPacked
OTCfgTCPInterfacesPackedPart
 115
OTCfgTCPDHCPLeaseInfo
 An unbounded array containing the IP addresses of name
OTCfgTCPDNSServersList
OTCfgTCPLocks
Number of IP addresses in the list
 117
 field
Set to True to lock the Router address text field
Set to True to lock the Ending domain name text field
Set to True to lock the Additional search domains text
 119
OTCfgTCPRoutersList
OTCfgTCPRoutersListEntry
 Number of domains in the list
OTCfgTCPSearchDomains
OTCfgTCPSearchList
 121
OTCfgTCPUnloadAttr
 Apple Remote Access Structures
 123
OTCfgRemoteAlternateAddress
OTCfgRemoteApplication
Must be zero
 OTCfgRemoteARAP
 125
OTCfgRemoteClientLocks
 Control panel is locked when the headerCompress field is set
Allow error correction and compression in modem
ErrorCheck field is set to 1 and unlocked when
ErrorCheck field is set to zero
 127
OTCfgRemoteClientMisc
OTCfgRemoteConnect
 Is to log on as Guest
Set to 1 to use the password preference
KOTCfgRemotePasswordPref or set to zero to prompt
User for a password
 129
 OTCfgRemoteDialAssist
 131
OTCfgRemoteDialing
 Milliseconds. Must be
OTCfgRemoteIPCP
 133
OTCfgRemoteLCP
 Port. Must be ‘Script’
 135
OTCfgRemotePassword
OTCfgRemoteLogOptions
 OTCfgRemoteServer
 137
OTCfgRemoteServerPort
 OTCfgRemoteTerminal
 139
OTCfgRemoteUserMode
 OTCfgRemoteX25 structure stores X.25 connection information
Administration password. The format is not
OTCfgRemoteX25
Documented
 141
Modem Structures
OTCfgModemGeneral
Must be zero for standard dial-up connections
 OTCfgModemApplication
 143
OTCfgModemLocks
 AppleTalk Structures
Set dialing to zero to unlock the setting
 145
OTCfgATalkGeneral
 OTCfgATalkGeneralAARP
 147
OTCfgATalkGeneralADSP
 Extended Tsdu Etsdu size. The default is
FDefaultSendBlockingBytes, default is
Transport Service Data Unit TSDU, which is
Carry. The default is
 149
OTCfgATalkGeneralASP
Size in bytes of this structure
 Maximum amount of data that packets of this protocol
Can carry. The default is
OTCfgATalkGeneralATP
 151
OTCfgATalkGeneralDDP
 Possible values
Can carry. Must be 586, which is the basic AppleTalk
Datagram size
Whether AppleTalk is active. See discussion below for
 153
OTCfgATalkGeneralNBP
 OTCfgATalkGeneralPAP
 155
Default open interval in milliseconds. The default value is
OTCfgATalkGeneralZIP
 OTCfgATalkLocks
 157
OTCfgATalkNetworkArchitecture
 Open Transport device type such as
Infrared Structures
OTCfgATalkPortDeviceType
Must be OTOn
 159
Protocol Constants and Other Data Types
OTCfgIRGeneral
Reference to the infrared port
 KOTCfgTCPSearchListPref
TCP/IP Constants and Other Data Types
 161
Masks for the kOTCfgProtocolOptionsPref Preference
 If set, this bit turns off path MTU discovery
If set, this bit disables Dhcp INIT-REBOOT capability
OTCfgTCPConfigMethod
 163
Apple Remote Access Constants and Other Data Types
ARA Per-Connection Preferences Types
 Preference type for the OTCfgRemoteARAP page 124 structure
 165
Preference type for the OTCfgRemoteIPCP page 132 structure
Preference type for the OTCfgRemoteLCP page 133 structure
Preference type for the OTCfgRemoteX25 page 140 structure
 Defined but not used by ARA
ARA Global Preference Types
OTCfgRemotePPPConnectScript
 167
OTCfgRemoteProtocol
 OTCfgRemoteDialMode
OTCfgRemoteLogLevel
 169
OTCfgRemoteAnswerMode
OTCfgRemoteNetworkProtocol
 Modem Constants and Other Data Types
OTCfgRemoteNetAccessMode
 171
Modem Global Preference Types
OTCfgModemDialingToneMode
Preference type for the OTCfgModemLocks page 143 structure
 KModemDialToneIgnoreDo not wait for dial tone
AppleTalk Constants and Other Data Types
Per-connection AppleTalk Preference Types
 173
Infrared Constants and Other Data Types
Global AppleTalk Preference Types
 Specifies the Infrared Data Association IrDA protocol
OTCfgIRPortSetting
OTCfgIRPortSetting enumeration defines constants for use
 175
Aarp See AppleTalk Address Resolution Protocol
 IP See Internet Protocol
Icmp See Internet Control Message Protocol
 177
Media access control address The six-byte
 O S S a R Y
 179
Index
 History, version
180
 Structure
181
 182
 183
 184