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