Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 26 - Ports Reference / Constants and Data Types


The Port Reference

Several Open Transport port information functions take as a parameter a pointer to a port reference, which is a 32-bit value that contains a port's device and bus type, its slot number, and information to distinguish among several devices on a single slot. The actual structure of the port reference is private.

The port reference is defined by the OTPortRef data type.

typedef UInt32 OTPortRef;
You can use the OTCreatePortRef function to create a port reference and obtain a pointer to it. The port reference is also a field in the port structure returned by the port information functions: OTGetIndexedPort, OTFindPort, and OTFindPortByRef. To extract information from the port reference, you need to use the functions OTGetDeviceTypeFromPortRef, OTGetBusTypeFromPortRef, and OTGetSlotFromPortRef.

This section lists the possible values for the device type and bus type.

IMPORTANT
Do not arbitrarily add new device types. Please contact Developer Support at Apple Computer, Inc. to obtain a new, unique device type.
Possible hardware device types are given in the following enumeration:

enum {
   kOTNoDeviceType         = 0,
   kOTADEVDevice           = 1,
   kOTMDEVDevice           = 2,
   kOTLocalTalkDevice      = 3,
   kOTIRTalkDevice         = 4,
   kOTTokenRingDevice      = 5,
   kOTISDNDevice           = 6,
   kOTATMDevice            = 7,
   kOTSMDSDevice           = 8,
   kOTSerialDevice         = 9,
   kOTEthernetDevice       = 10,
   kOTSLIPDevice           = 11,
   kOTPPPDevice            = 12,
   kOTModemDevice          = 13,
   kOTFastEthernetDevice   = 14,
   kOTFDDIDevice           = 15,
   kOTIrDADevice           = 16,
   kOTATMSNAPDevice        = 17,
   kOTFibreChannelDevice   = 18,
   kOTFireWireDevice       = 19,
   kOTPseudoDevice         = 1023,
   kOTLastDeviceIndex      = 1022,
   kOTLastSlotNumber       = 255,
   kOTLastOtherNumber      = 255
};
Constant descriptions

kOTNoDeviceType
The port's device type is not specified. This value is illegal.
kOTADEVDevice
The port is specified as an 'adev' device, which is a pseudodevice used by AppleTalk.
kOTMDEVDevice
The port is specified as an 'mdev' device, which is a pseudodevice used by TCP.
kOTLocalTalkDevice
The port is specified as a LocalTalk device.
kOTIRTalkDevice
The port is specified as an IRTalk device.
kOTTokenRingDevice
The port is specified as a token ring device.
kOTISDNDevice
The port is specified as an ISDN device.
kOTATMDevice
The port is specified as an ATM device.
kOTSMDSDevice
The port is specified as a SMDS device.
kOTSerialDevice
The port is specified as a serial device.
kOTEthernetDevice
The port is specified as an Ethernet device.
kOTSLIPDevice
The port is specified as a SLIP pseudodevice.
kOTPPPDevice
The port is specified as a PPP pseudodevice.
kOTModemDevice
The port is specified as a modem pseudodevice.
kOTFastEthernetDevice
The port is specified as an 100 MB Ethernet device.
kOTFDDIDevice
The port is specified as a FDDI device.
kOTIrDADevice
The port is specified as an IrDA Infrared device.
kOTATMSNAPDevice
The port is specified as an ATM pseudodevice simulating a SNAP device.
kOTFibreChannelDevice
The port is specified as a Fibre Channel device.
kOTFireWireDevice
The port is specified as a Firewire device.
kOTPseudoDevice
The port is designated as a pseudodevice.
kOTLastDeviceIndex
The maximum device types that a port can use.
kOTLastSlotNumber
The highest physical slot number a port can use. See "OTCreatePortRef" for more information.
kOTLastOtherNumber
The maximum number of ports a single slot can support. See "OTCreatePortRef" for more information.
Possible bus types are described in"Bus Type Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998