Method and apparatus for tunneling any existing data-, control-, or
routing-related protocol through a generic Internet protocol (IP)
transport are described. The method includes providing a generic
messaging structure that includes at least a transport protocol, a
message buffer, a source-address field and one or more data fields for
transparent routing of a user protocol over the IP transport and also
providing an application program interface to the generic messaging
structure, the interface including a mechanism for a user to choose a
desired transport and associated protocol for transparently routing the
user protocol over the transport in accordance with the chosen transport
protocol within the one or more data fields. Alternatively or
additionally, the method includes creating a base class library including
plural defined source and header files and further providing a mechanism
for deriving a transaction-based protocol-specific class that is
compatible with the base class library. The apparatus is an application
programming interface (API), preferably coded in C/C++, for transparently
routing data between sockets in such an IP transport. The API includes a
message buffer data structure defining a protocol-generic parent class,
message, source-address and data fields; a message creation mechanism for
creating a message and adding it to the message buffer data structure;
and a protocol creation mechanism for deriving a protocol-specific child
class that renders new protocol-specific sub-fields of the protocol field
of the message buffer data structure.