Network Setup
Page
Contents
Network Setup Reference
Glossary Index
Network Setup Protocol Structures and Data Types
111
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 Not released
Network Setup Version History
Mac OS
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
OTCfgCloseArea
Closes an area in the Network Setup database
On input, a value of type CfgAreaID page 98 that identifies
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
Managing Entities
Deletes an area in the Network Setup database
OTCfgDeleteArea
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
OTCfgDeletePrefs
OTCfgGetDefault
Deletes a preference
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
CfgSetsStruct
CfgResourceLocator
101
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
CfgSetsVector
CfgSetsElement
103
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
TCP/IP Structures
Protocol Structures
111
OTCfgTCPInterfacesUnpacked
113
OTCfgTCPInterfacesPackedPart
OTCfgTCPInterfacesPacked
Containing port, module, and framing information
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
OTCfgTCPRoutersListEntry
OTCfgTCPRoutersList
119
OTCfgTCPSearchList
OTCfgTCPSearchDomains
Number of domains in the list
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
OTCfgRemoteConnect
OTCfgRemoteClientMisc
127
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’
OTCfgRemoteLogOptions
OTCfgRemotePassword
135
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
Size in bytes of this structure
OTCfgATalkGeneralASP
149
OTCfgATalkGeneralATP
Can carry. The default is
Maximum amount of data that packets of this protocol
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
OTCfgATalkGeneralZIP
Default open interval in milliseconds. The default value is
155
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
OTCfgTCPConfigMethod
If set, this bit disables Dhcp INIT-REBOOT capability
If set, this bit turns off path MTU discovery
ARA Per-Connection Preferences Types
Apple Remote Access Constants and Other Data Types
163
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
OTCfgRemotePPPConnectScript
ARA Global Preference Types
Defined but not used by ARA
167
OTCfgRemoteProtocol
OTCfgRemoteDialMode
OTCfgRemoteLogLevel
OTCfgRemoteNetworkProtocol
OTCfgRemoteAnswerMode
169
Modem Constants and Other Data Types
OTCfgRemoteNetAccessMode
171
Modem Global Preference Types
OTCfgModemDialingToneMode
Preference type for the OTCfgModemLocks page 143 structure
Per-connection AppleTalk Preference Types
AppleTalk Constants and Other Data Types
KModemDialToneIgnoreDo not wait for dial tone
Global AppleTalk Preference Types
Infrared Constants and Other Data Types
173
OTCfgIRPortSetting enumeration defines constants for use
OTCfgIRPortSetting
Specifies the Infrared Data Association IrDA protocol
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