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
 OTCfgGetCurrentArea
Obtains the default area
On input, a value of type CfgDatabaseRef page 98 that
Represents a database session previously opened by calling
 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
 Is large enough to hold the number of area IDs specified by
Be less that expected if areas were deleted between calling
You don’t want to get area IDs, set areaID to Null
On input, an array of elements of type Str255 that is large
 OTCfgCreateArea
Creates an area in the Network Setup database
Output, areaID contains the ID of the area that was created
Value of noErr indicates that OTCfgCreateArea returned
 OTCfgDuplicateArea
Copies the contents of one area to another area
By areaID does not exist, OTCfgDuplicateArea returns
Value of noErr indicates that OTCfgDuplicateArea returned
 OTCfgDeleteArea
Deletes an area in the Network Setup database
Managing Entities
 OTCfgGetEntitiesCount
Not exist, OTCfgGetEntitiesCount returns the error
Classes and Types
KCfgTypeAnyEntity. For a list of possible types, see Entity
 Obtains information about entities in an area
OTCfgGetEntitiesList
 Network Setup Reference
 OTCfgCreateEntity
OTCfgIsSameEntityRef
Compares two entity references
Creates an entity in an area
 Already exists, OTCfgCreateEntity returns the error
AreaID is not writable, OTCfgCreateEntity returns the error
Specifies the class, type, user-visible name, and icon for
On input, a pointer to a value of type CfgEntityRef
 OTCfgDuplicateEntity
OTCfgDeleteEntity
 Obtains the user-visible name of an entity
OTCfgGetEntityLogicalName
Reference for an entity, call OTCfgGetEntitiesList
User-visible name of the entity represented by entityRef
 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 but not the default value itself, set data to Null
Returns as much data as possible and returns the error
Preference Utilities
Value of noErr indicates that OTCfgGetTemplate returned
 OTCfgDecrypt
OTCfgEncrypt
 OTCfgInstallNotifier
Installing and Removing a Notification Callback
 Notification callback when it is called
Notification callback that is to be installed
Value of noErr indicates that OTCfgInstallNotifier returned
Values, see the constants described in Entity Classes
 Application-Defined Routines
Was specified when the notification callback was installed
OTCfgRemoveNotifier
Removes a notification callback
 Notification Callback Routine
Network Setup Structures and Data Types
 CfgAreaID
CfgDatabaseRef
Value of type CfgAreaID identifies an area
An unsigned 32-bit value that uniquely identifies an area
 CfgEntityInfo
CfgEntityRef
CfgEntityRef structure refers to a specific entity
Area in which the entity resides
 CfgPrefsHeader
CfgEntityAccessID
 101
CfgResourceLocator
CfgSetsStruct
 An array of time stamps used during legacy import
For the fFlags field that follows
Export indexed by the enumeration for the fTimes field that
Follows
 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
 Dummy preference type used for free blocks in an entity
This preference is not documented
Following enumeration defines global preference types
107
 Set Entity Preference Types
 Advanced user mode
Basic user mode
Invalid Area ID
Constant kInvalidCfgAreaID represents an invalid area ID
 Result Codes
 111
Protocol Structures
TCP/IP Structures
 OTCfgTCPInterfacesUnpacked
 113
 Containing port, module, and framing information
OTCfgTCPInterfacesPacked
OTCfgTCPInterfacesPackedPart
 115
OTCfgTCPDHCPLeaseInfo
 OTCfgTCPLocks
OTCfgTCPDNSServersList
Number of IP addresses in the list
An unbounded array containing the IP addresses of name
 117
 Set to True to lock the Ending domain name text field
Set to True to lock the Router address text field
Set to True to lock the Additional search domains text
field
 119
OTCfgTCPRoutersList
OTCfgTCPRoutersListEntry
 Number of domains in the list
OTCfgTCPSearchDomains
OTCfgTCPSearchList
 121
OTCfgTCPUnloadAttr
 Apple Remote Access Structures
 OTCfgRemoteApplication
OTCfgRemoteAlternateAddress
Must be zero
123
 OTCfgRemoteARAP
 125
OTCfgRemoteClientLocks
 ErrorCheck field is set to 1 and unlocked when
Allow error correction and compression in modem
ErrorCheck field is set to zero
Control panel is locked when the headerCompress field is set
 127
OTCfgRemoteClientMisc
OTCfgRemoteConnect
 KOTCfgRemotePasswordPref or set to zero to prompt
Set to 1 to use the password preference
User for a password
Is to log on as Guest
 129
 OTCfgRemoteDialAssist
 131
OTCfgRemoteDialing
 Milliseconds. Must be
OTCfgRemoteIPCP
 133
OTCfgRemoteLCP
 Port. Must be ‘Script’
 135
OTCfgRemotePassword
OTCfgRemoteLogOptions
 OTCfgRemoteServer
 137
OTCfgRemoteServerPort
 OTCfgRemoteTerminal
 139
OTCfgRemoteUserMode
 OTCfgRemoteX25
Administration password. The format is not
Documented
OTCfgRemoteX25 structure stores X.25 connection information
 OTCfgModemGeneral
Modem Structures
Must be zero for standard dial-up connections
141
 OTCfgModemApplication
 143
OTCfgModemLocks
 AppleTalk Structures
Set dialing to zero to unlock the setting
 145
OTCfgATalkGeneral
 OTCfgATalkGeneralAARP
 147
OTCfgATalkGeneralADSP
 Transport Service Data Unit TSDU, which is
FDefaultSendBlockingBytes, default is
Carry. The default is
Extended Tsdu Etsdu size. 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
 Datagram size
Can carry. Must be 586, which is the basic AppleTalk
Whether AppleTalk is active. See discussion below for
Possible values
 153
OTCfgATalkGeneralNBP
 OTCfgATalkGeneralPAP
 155
Default open interval in milliseconds. The default value is
OTCfgATalkGeneralZIP
 OTCfgATalkLocks
 157
OTCfgATalkNetworkArchitecture
 OTCfgATalkPortDeviceType
Infrared Structures
Must be OTOn
Open Transport device type such as
 OTCfgIRGeneral
Protocol Constants and Other Data Types
Reference to the infrared port
159
 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
 Preference type for the OTCfgRemoteLCP page 133 structure
Preference type for the OTCfgRemoteIPCP page 132 structure
Preference type for the OTCfgRemoteX25 page 140 structure
165
 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
 OTCfgModemDialingToneMode
Modem Global Preference Types
Preference type for the OTCfgModemLocks page 143 structure
171
 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