Participant lists are used for passing addressing information between
protocols. An additional problem is how a high-level protocol
identifies itself to a low-level protocol. In most conventional
protocols, a low-level protocol uses a relative protocol number
to identify the protocols above it; e.g., IP identifies UDP with
protocol number 17 and TCP as protocol number 6. However, protocols
that have been especially designed to use the x-kernel use an
absolute addressing scheme.
Version 3.2 of the x-kernel reconciles these two approaches by
maintaining a table of relative protocol numbers. (See Section
13.1 for the format of this table.) Rather than embed
protocol numbers in the protocol source code, protocols learn the
protocol numbers of protocols above them by querying this table using
the following operation:
long relProtNum( XObj hlp, XObj llp )
This operation returns the protocol number of the high-level
protocol relative to the low-level protocol, or -1 if no such binding
has been configured in the protocol tables. This number will have to
be cast into the appropriate type; e.g., an unsigned short by the
ETH protocol and an unsigned char by IP.
Two other operations provide an alternate query interface. The operation
long protTblGetId( char * protocolName )
returns the protocol ID number for the named protocol. This ID number
can be used with the operation
long relProtNumById(
long hlpId, XObj llp
)
which has the same semantics as relProtNum, except that the
high-level protocol is identified by its ID number rather than by the
XObject itself. This interface can be useful when one needs to
determine relative protocol numbers, but does not have the appropriate
XObjects in scope.
Next: Usage Rules
Up: Participant Library
Previous: Participant List Operations