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