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
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
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
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
Managing Entities
Deletes an area in the Network Setup database
OTCfgDeleteArea
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
OTCfgDeletePrefs
OTCfgGetDefault
Deletes a preference
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
CfgSetsStruct
CfgResourceLocator
101
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
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
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
TCP/IP Structures
Protocol Structures
111
OTCfgTCPInterfacesUnpacked
113
OTCfgTCPInterfacesPackedPart
OTCfgTCPInterfacesPacked
Containing port, module, and framing information
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
OTCfgTCPRoutersListEntry
OTCfgTCPRoutersList
119
OTCfgTCPSearchList
OTCfgTCPSearchDomains
Number of domains in the list
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
OTCfgRemoteConnect
OTCfgRemoteClientMisc
127
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’
OTCfgRemoteLogOptions
OTCfgRemotePassword
135
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
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
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
OTCfgATalkGeneralZIP
Default open interval in milliseconds. The default value is
155
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
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 OTCfgRemoteLCP page 133 structure
Preference type for the OTCfgRemoteIPCP page 132 structure
Preference type for the OTCfgRemoteX25 page 140 structure
165
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
OTCfgModemDialingToneMode
Modem Global Preference Types
Preference type for the OTCfgModemLocks page 143 structure
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
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