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 Structure

Open Transport uses a port structure to describe a port's characteristics, such as its port name, its child ports, whether it is active or disabled, whether it is private or shareable, and the kind of framing it can use.

The port structure is defined by the OTPortRecord data type.

struct OTPortRecord {
   OTPortRef   fRef;
   UInt32      fPortFlags;
   UInt32      fInfoFlags;
   UInt32      fCapabilities;
   size_t      fNumChildPorts;
   OTPortRef*  fChildPorts;
   char        fPortName[kMaxProviderNameSize];
   char        fModuleName[kMaxModuleNameSize];
   char        fSlotID[kMaxSlotIDSize];
   char        fResourceInfo[kMaxResourceInfoSize];
   char        fReserved[164];
};
typedef struct OTPortRecord OTPortRecord;
Field Description
fRef
The port reference; a 32-bit value encoding the port's device type, bus type, slot number, and multiport identifier. For more details, see.
fPortFlags
Flags describing the port's status. If no bits are set, the port is currently inactive--that is, it is not in use at this time.
Flag ValueDescription
kOTPortIsActive0x00000001The port is in use.
kOTPortIsDisabled0x00000002The port may or may not be in use, but no other client can use it.
kOTPortIsUnavailable  0x00000004  The port is not available for use.
kOTPortIsOffline0x00000008The port is off-line. This bit is typically only set when the port is active, the port autoconnects, and it is currently not connected.
fInfoFlags
Flags providing additional information about the port.
Flag ValueDescription
kOTPortIsDLPI0x00000001The port driver is a DLPI STREAMS module.
kOTPortIsTPI0x00000002The port driver is a TPI STREAMS module.
kOTPortCanYield0x00000004The port can yield when requested.
kOTPortCanArbitrate0x00000008Reserved
kOTPortIsTransitory0x00000010The port has off-line/on-line status.
kOTPortAutoConnects0x00000020The port auto connects. The port goes on-line and off-line on demand. ISDN is a typical example.
kOTPortIsSystemRegistered  0x00004000  The port was registered by the system from the Name Registry.
kOTPortIsPrivate0x00008000The port is a private port.
kOTPortIsAlias0x80000000The port is an alias for another port.
fCapabilities
Flags indicating the type of framing capability that a port has. If the port can handle only one type of framing, this field is 0. This field is dependent on the ports device type. For example, Ethernet framing uses the following values:
FlagValue  Description
kOTFramingEthernet0x01The port can use standard Ethernet framing.
kOTFramingEthernetIPX  0x02The port can use IPX Ethernet framing.
kOTFraming80230x04The port can use 802.3 Ethernet framing.
kOTFraming80220x08The port can use 802.2 Ethernet framing.
fNumChildPorts
The number of child ports associated with this port.
fChildPorts
An array of the port references for the child ports associated with this port. When you get a Port Record, this pointer typically points into the SReserved field at the end of the record.
fPortName
A unique name for this port. The port name is a zero-terminated string that can have a maximum length as indicated by the constant kMaxProviderNameSize.
fModuleName
The name of the actual STREAMS module that implements the driver for this port. Open Transport uses this name internally; applications rarely need to use this name.
fSlotID
An 8-byte identifier for a port's slot that contains a 7-byte character string plus a zero for termination. This identifier is typically available only for PCI cards.
fResourceInfo
A zero-terminated string that describes a shared library that can handle configuration information for the device. This field contains an identifier that allows Open Transport to access auxiliary information about the driver (Open Transport creates shared library IDs from this string to be able to find these extra shared libraries). This string should either be unique to the driver or should be set to a NULL string.
fReserved
Reserved.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998