Method and apparatus for content processing and routing6216173Abstract A method and apparatus for incorporating content processing and content routing intelligence into networks. In one embodiment, the content processing and routing (CPR) system is aware of the content and requirements of data and service requests, as well as the capabilities of all services accessible via the system. Efficient network routing is accomplished by considering the capabilities of the available transmission channels, and the transmission needs of all current transmission service requests. Service requests are routed to the most suitable service or combination of services to fulfill the request. A mechanism is also provided for transparently converting data to accommodate data format differences between clients and services. In one embodiment, the CPR system comprises a system kernel consisting of the core software modules that are required to load, initialize and start CPR services, and allow the services to communicate securely. The CPR services conform to several general service types. These types include application services which act as the interface between a specific external application or device and the CPR system; kernel services which provide services on behalf of the kernel; content services which act on information in transit through the CPR system; routing services which contain the routing logic specific to a particular application; and link services which provide for the joining of two CPR instances over a network or other transmission channel. Data exchange is supported for bounded data in the form of media objects and unbounded data in the form of media streams. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
Net/Cost Net/Bandwidth/Minimum
Net/Cost/PricedByUsage Net/Bandwidth/Average
Net/Cost/PricedByConnection Net/Security
Net/Cost/FixedPrice Net/Security/Encryption
Net/Jitter Net/Security/Encryption/Level
Net/Jitter/Maximum Net/Security/Authentication
Net/Jitter/Average Net/Security/Authentication/Level
Net/Latency Net/Security/Delivery
Net/Latency/Maximum Net/Security/Delivery/Guaranteed
Net/Latency/Average Net/Security/Private
Net/Bandwidth Net/Security/VirtualPrivate
Net/Bandwidth/Maximum Net/Security/Public
Person/Name Person/Position
Person/Name/English Person/Company
Person/Name/Japanese Person/TelephoneNumber
Person/Name/LastName Person/TelephoneNumber/Home
Person/Name/FirstName Person/TelephoneNumber/Work
Person/Name/Title Person/TelephoneNumber/Mobile
By performing service requests based on respective service capabilities, it is possible to have the service request transparently fulfilled by any service meeting the capability requirements. This permits service requests to be more generalized in nature without requiring an application to have any specific knowledge of the service providers in the CPR network. Further, applications may be added to the CPR network to provide services simply by providing the necessary application service, and characterizing the capabilities of the services the application can perform. Thus, client and server applications may be plugged into the CPR network without requiring reprogramming of other applications already linked to the CPR network. Also, the capabilities base can be increased or refined by further extending or refining attributes. The network resource service manages resources in a networking environment. Link and network-related application services make remote service calls on the network resource service to request and schedule network resources. The network resource service is able to schedule the use of network resources with consideration for the competing needs of all requesting services. Data transmission is scheduled such that those requests with stricter requirements are granted the resources needed when the less strict requirements of other requests permit. Thus, for example, situations can be avoided where smooth real-time video or audio is disrupted due to high priority e-mail or transaction traffic. Link Services As previously described, a link service establishes a corresponding connection with another link service on a remote CPR node to transfer information between two CPR nodes across a network connection. Any link service may support many simultaneous peer-to-peer sessions. Examples of link services are TCP/IP, SPX/IPX, RTP (UDP) and MQ Assured Object Delivery. The TCP/IP service may be used to transfer media objects between CPR nodes over a TCP/IP network. The SPX/IPX (sequenced packet exchange/internetwork packet exchange) service may be used to transfer media objects between CPR nodes over a SPX/IPX network. The RTP service uses the real-time protocol implemented within UDP (user datagram protocol) to stream media streams over IP networks. The MQ assured delivery service is used to provide assured delivery of media objects between CPR nodes. A link service can establish a connection across any type of network (e.g., LAN, WAN, PSTN, Internet, cable TV, etc.), and can interface to the network at any layer. Also, analog and non-standard "network" connections joining two CPR nodes can be supported. For example, one link service may provide data to an international mail service, which ships the data on, for example, a floppy disk via air mail to another country, where the data is input through a floppy drive to another link service to enter another CPR node. Thus, all types of networks may be used to join CPR nodes via link services. The link service provides the means for transferring data on and off of the given transmission channel. Content Services A content service acts on information in transit within a CPR network. Typically, a content service modifies the media object or data stream. This may be through conversion, replication or termination. Alternatively, a content service may perform non-intrusive analysis of the information in transit and report its results. Examples of content services include: conversion of a video stream from one format to another; generation of a video stream from still images; conversion of proprietary format information into HTML suitable for WWW publishing; conversion of mainframe application data into PC application data; performance of a virus check; language translation; speech-to-text or text-to-speech translation; and performance of keyword detection within a message or file. Also, content services may be developed for assisting the CBSR service by determining new attributes, or transforming existing attributes, associated with service requests. For example, a content service may examine the contents of a media object or stream to determine content aspects of the enclosed data that may be reflected in particular attributes. The content service then assigns those attributes to the media object or stream. The content service may also examine existing attributes on a media object or stream to determine, for instance, by accessing an attribute library, other associated attributes to assign to the object or stream. Existing attributes may also be transformed into new attributes. The case of determining new or alternate attributes based on existing attributes is particularly useful when large streams of data are involved, as it is more efficient to send only the attributes to the content service. Occasionally, the performance of a service request may entail the separation of object or stream data into separate components for individual processing by another service. A content service may be created to perform the requisite separation of data components, and to assign appropriate attributes to each new component. The same or a new content service may then recombine the data at a later step in the fulfillment of the service request. The CPR system provides for the encapsulation of object or stream processing functionality implemented by hardware. This encapsulation is implemented either within a content service (for media processing of in-transit information) or an application service (where an event is triggered or information is sourced). Encapsulation of hardware functionality into a CPR service enables any CPR application to make use of the specialized hardware without additional development. It also permits capabilities to be implemented in the CPR network that may not be possible in a purely software environment. Routing Services A routing service contains the routing logic specific to a particular application, with respect to routing media objects or streams through the appropriate CPR services to carry out sequential processing and onward delivery as required by the application. For example, a subscriber video service may implement a routing service to direct how a single video stream input is routed to a plurality of subscribing customer locations over a CPR network through multiple CPR nodes via respective link services, culminating in the output of the video stream through endpoint application services for display. This routing may include accessing a first content service to censor certain data from the media stream for particular customers, or a second content service to insert subtitles into the media stream. A routing service may route multiple media objects or streams through multiple CPR services or instances of services in parallel, enabling very high CPR system throughput. Service Application Programming Interfaces (APIs) A simple service interface may be used to provide a standard, simplified interface to the CPR system for those services that do not require the use of complex CPR system functionality. In one embodiment of the invention, a simple service interface supports the following API by providing an implementation for each of the function calls: void DLLEXPORT SimpService_Initialise( . . . ) void DLLEXPORT SimpService_Start( . . . ) void DLLEXPORT SimpService_Stop( ); void DLLEXPORT SimpService_Shutdowno; BOOL DLLEXPORT SimpService_RoutelnboundObject( . . . ); void DLLEXPORT SimpService_ProcessRSC( . . . ); void DLLEXPORT SimpService_PrepareTakeover( . . . ) void DLLEXPORT SimpService_Takeovero( ); void DLLEXPORT SimpService_PrepareHandover( ); void DLLEXPORT SimpService_Handovero( ); The Initialize( ) function call refers to the initialization of the simple service interface, and the loading of all associated services. The Shutdown( ) function call implements the controlled shutting down of the simple service interface and all associated services. The Start( ) and Stop( ) function calls are used to start and stop sessions with individual services. RoutelnboundObject( ) routes an incoming media object to the destination service served by the simple service interface, and returns a Boolean value indicating whether the media object can be routed successfully. ProcessRSC( ) is called to process a remote service call via the remote service call manager. PrepareTakeover( ) and Takeover( ) are function calls referring to one service "taking over" for another service, for example, in the replacement of an older version of a service with a newer version. PrepareHandover( ) and Handover( ) are function calls for the service that is "handing operation over" to the service that is "taking over." These function calls allow for services to be swapped without interrupting the operation of the CPR system. In one embodiment of the invention, in addition to any other APIs for carrying out specific functionality, services other than those using the simple service interface provide function call implementations for the following basic API: void DLLEXPORT Service_AddnternalQueue( . . . ) void DLLEXPORT Service_AddExternalQueue( . . . ) void DLLEXPORT Service_Start( . . . ) void DLLEXPORT Service_Stop( . . . ) void DLLEXPORT Service_Shutdown( . . . ) void DLLEXPORT Service_PrepareTakeover( . . . ) void DLLEXPORT Service_Takeover( . . . ) void DLLEXPORT Service_PrepareHandover( . . . ) void DLLEXPORT Service_Handover( . . . ) The AddlnternalQueue( ) and AddExternalQueue( ) function calls are for establishing incoming and outgoing object queues for a given service. The remaining function calls are as discussed above with respect to the simple service interface. To manage application-specific routing of media objects and the links necessary to support those routes in one embodiment of the invention, routing services support the following API: void DLLEXPORT Service_Route_AddMediaType( . . . ) void DLLEXPORT Service_Route_AddRoute( . . . ) void DLLEXPORT Service_Route_AddSupportedType( . . . ) void DLLEXPORT Service_Route_AddRemoteAddress( . . . ) void DLLEXPORT Service_Route_AddConversion( . . . ) void DLLEXPORT Service_Route_StartSingle( . . . ) void DLLEXPORT Service_Route_ShutdownSingle( . . . ) void DLLEXPORT Service_Route_StartServiceLinks( . . . ) void DLLEXPORT Service_Route_ShutdownServiceLinks(. . .) Link services support the following function call for adding the destination address of another CPR node accessible over a network or channel according to one embodiment of the invention. void DLLEXPORT Service_AddExtenalRemoteAddress( . . . ) In one embodiment of the invention, streaming link services also support the following API: void DLLEXPORT Service_Stream_AddStreamRoute( . . . ) void DLLEXPORT Service_Stream_AddRemoteAddress( . . . ) void DLLEXPORT Service_Stream_AddMediaType( . . . ) Other behavioral differences between services may be manifested by their remote service call APIs. System Kernel Embodiment FIG. 1 is a block diagram illustrating components of the system kernel and their interaction with each other and CPR services. Shown in FIG. 1 are eight management components resident in the kernel of the system, and a plurality of services jointly identified as element 128. Components of the system kernel are shown above dashed line 129, whereas services 128 are shown below dashed line 129. The kernel management components in the embodiment of FIG. 1 include the following: boot manager 120, logging manager 121, monitor manager 122, storage manager 123, queue and stream manager 124, remote service call (RSC) manager 125, link manager 126 and configuration manager 127. Lines coupling components in FIG. 1 represent a path of interaction between those components. Boot manager 120 is coupled to logging manager 121, monitor manager 122, storage manager 123, and queue and stream manager 124 via lines 101, 102, 103 and 104, respectively. Boot manager 120 is also coupled to remote service call manager 125, link manager 126 and configuration manager 127 via lines 105, 106, and 107, respectively. Services 128 are coupled to logging manager 121, monitor manager 122, storage manager 123, queue and stream manager 124, remote service call manager 125, link manager 126 and configuration manager 127 via lines 112, 116, 115, 114, 113, 117 and 111, respectively. Configuration manager 127 is further coupled to logging manager 121, storage manager 123, and queue and stream manager 124 via lines 108, 110, 109, respectively. Boot manager 120 (also referred to as the "boot loader") contains the initial start-up code for the CPR system. Boot manager 120 is responsible for starting an instance of the CPR system by loading and starting the other CPR kernel components in the correct order. The lines between boot manager 120 and the other kernel components in FIG. 1 represent the start-up interaction. FIG. 11 illustrates one embodiment of a kernel resource startup procedure carried out by the boot manager. In step 1100, the boot manager invokes the logging manager's Start( ) method, and passes the logging manager the filename and logging level to use for internal logging, as well as the filename to use for resource messages. The logging level is used by the logging manager to filter out lower priority log messages. Those log messages whose logging level falls below the logging level stored in the logging manager are discarded. In step 1101, the boot manager invokes the Start( ) method of the monitor manager, and passes the monitor manager an input queue handle for logging purposes, a filename to use for resource messages, and, optionally, a thread monitoring mode if more than one monitoring mode is supported. The monitor manager may be used in a multi-processor environment to determine processor affinity based on monitored thread execution behavior. The thread monitoring mode can be used to select an affinity assignment strategy. In step 1102, the boot manager invokes the storage manager's Startup( ) method, and passes the storage manager an input queue handle for logging purposes, the filename to use for resource messages, and the local CPR node address. In step 1103, the boot manager invokes the Start( ) method of the queue and stream manager, and passes the input queue handle for logging purposes and the filename to use for resource messages. In step 1104, the boot manager invokes the Start( ) method of the remote service call manager, and passes the input queue handle for logging purposes and the filename to use for resource messages. In step 1105, the boot manager starts the individual modules (compression, authentication, cryptographic, etc.) of the link manager by invoking their respective Start( ) methods. Each module is passed an input queue handle for logging, a filename for resource messages and the handle of a configuration file. In step 1106, the boot manager invokes the Start( ) method of the configuration manager, and passes the input queue handle for logging and the handle of a configuration file. Referring again to FIG. 1, configuration manager 127 initializes any logs required by services through the logging manager 121 as indicated by line 108, initializes any queues required by services through queue and stream manager 124 as indicated by line 109, and initializes any storage entities required by services through the storage manager 123 as indicated by line 110. Then, as stated previously, via line 111, configuration manager 127 loads each service 128 dynamically and passes appropriate log, storage and queue handles. Each service is then started in turn. Services 128 represent the application units of a CPR instance. Each service interacts with logging manager 121 via line 112 for logging messages to a log. Each service also uses the remote service call manager 125 for calling functions on other services and to act as a server for such functions (line 113). Queue and stream manager 124 is used by each service to pass media objects to another service via line 114. Configuration information for each service is loaded and saved via interaction with storage manager 123, as indicated by line 115. Whenever a service creates a thread, the thread is registered with monitor manager 122 via line 116. Link services interact with link manager 126, as indicated by line 117, in the process of communicating with other remote link services. Kernel Components and APIs Logging manager 121 is used by all CPR system components for the logging of messages. The logging manager coordinates the input of logging information from a large number of threads and processes which are imultaneously active within the CPR system. The logging manager also manages the structure and file storage of output logs. One embodiment of the logging manager API is provided below.
Logging Manager API
Start( ); Sets up the internal logging file and logging level, and
begins
internal logging
Stop( ); Stops internal logging
CreateInputQueue( ); Creates an input queue for writing log strings
CreateOutputQueue( ); Creates an output queue; the output queue may receive
strings
from several input queues and write them to a file
DeleteInputQueue( ); Deletes an input queue previously allocated
DeleteOutputQueue( ); Deletes an output queue previously allocated
BindQueue( ); Binds an input queue to an output queue
WriteLog( ); Writes a message to a given input queue; messages below
the
current logging level are discarded
GetLoggingLevel( ); Retrieves the current logging level in force on an
input queue
BindDirect( ); Creates an input queue and binds it to a given output
queue
WriteEventLog( ); Writes a message to a particular event log
Whenever a service wishes to log a message to the CPR logs, the service uses the logging manager API. In one embodiment, the logging manager API methods use a separate resource DLL (dynamic link library) that contains the service's respective log messages, or resource messages, with spaces for insertion of variable text. This allows an alternate language to be used for logging without restarting the CPR instance. Also, the logging manager may write out binary versions of the log messages that do not include any text from the resource file, only the resource ID. This allows a log viewing application to display the binary log in whichever language is required. For example, a TCP/IP link service may use the file mrtcpipres.dll as its resource DLL. Some sample resource messages that might be included in a TCP/IP link service resource DLL are:
Message Name Message
IDS_MRTCP_STARTUP "MRTCPIP Transport service V1.05
Copyright
(c) 1996-97 RedBox Holdings NV. All
rights
reserved."
IDS_STARTUP_FAILED "This service failed to start up
correctly.
This service is unable to route
data."
IDS_STARTUP_WINSOCK_INIT_SUCCESS "Windows Sockets (2.0)
initialized."
IDS_STARTUP_WINSOCK_INIT_FAILURE "Error initializing Windows
Sockets. Error
was %1!d!."
IDS_STARTUP_INVALID_CONFIG_FILE "Error accessing the kdb file. This
service
will have no external links -
unable to route
data."
IDS_SHUTDOWN_WINSOCK_SUCCESS "Windows Sockets successfully
closed."
IDS_SHUTDOWN_WINSOCK_FAILURE "Error closing Windows Sockets.
Error was
%1!d!."
IDS_CONFIG_LINK_LOCAL_IP "Link %1: Local I.P. address is
%2."
IDS_CONFIG_LINK_REMOTE_IP "Link %1: Remote I.P. for this link
is %2."
IDS_CONFIG_LINK_SERVER_PORT "Link %1: The server is listening
on port
%2!d!."
IDS_CONFIG_FILE_ERROR "Link %1: Error in line %2."
IDS_SERVER_START_SUCCESS "Link %1: Server started
successfully."
IDS_SERVER_START_FAILURE "Link %1: Error starting the
server. This link
will not be able to accept incoming
data."
IDS_SERVER_SHUTDOWN_SUCCESS "Link %1: Server stopped
successfully."
IDS_SERVER_SHUTDOWN_FAILURE "Link %1: Error stopping the
server."
IDS_SERVER_SOCKET_CREATE_SUCCESS "Link %1: Server listening socket
created
successfully."
IDS_SERVER_SOCKET_CREATE_FAILURE "Link %1: Error creating Server
listening
socket."
IDS_SERVER_SOCKET_NAME_FAILURE "Link %1: Server unable to name to
socket for
client associations. Error was
%2!d!."
IDS_SERVER_LISTEN_SUCCESS "Link %1: Server listening for
network
ACCEPT and CLOSE messages."
The elements %1, %2, etc. in the resource messages are replaced during message logging by data parameters specific to the event causing the message to be logged. Foreign language versions may alter the order of display of these data parameters to fit the respective language syntax of their messages. Monitor manager 122 monitors all threads created in the respective instance of the CPR system. A mechanism is provided for specifying a thread "type" which may be used, in addition to monitoring of thread execution behavior, to more efficiently determine processor affinity for threads in a multi-processor environment. An embodiment of the monitor manager API is provided below.
Monitor Manager API
Start( ); Starts the monitor manager in a given mode
Shutdown( ); Stops the monitor manager
CreateThread( ); Creates a thread with a given stack size, start address,
thread ID, thread type, etc.
Storage manager 123 is used by all CPR system components for the storage of configuration information. In an embodiment of the invention, a database management scheme is used to store, retrieve and update configuration information. The storage manager API provides mechanisms for loading and closing databases, opening and closing database sessions, and retrieving, writing or deleting information from a database. One embodiment of the API is provided below.
Storage Manager API
Startup( ); Initializes the storage manager
LoadConfig( ); Loads a file as a database and returns a handle
CloseConfig( ); Closes a database and saves the data to a file
Shutdown( ); Shuts down all configuration databases
SetupSession( ); Starts a session with a database
EndSession( ); Cancels a session with a database
GetFirstAddress( ); Retrieves first unique address in database
GetNextAddress( ); Returns next unique address for any given session
GetFirstType( ); Retrieves the first type in a configuration for an
address/type
tuple
GetNextType( ); Retrieves next type in a configuration for the given
session
GetFirstService( ); Retrieves the first unique service given an address and
type
GetNextService( ); Retrieves the next unique service for a given session
GetFirstName( ); Retrieves the first name in a configuration for an
address/type/service three-tuple
GetNextName( ); Retrieves the next name for a session
GetInformation( ); Retrieves info from the specified data point
SaveInformation( ); Adds the given data to the database at the given data
point
DeleteInformation( ); Deletes the specified data point
In one embodiment, configuration information is stored in a Unicode text file, with fields separated by a first character delimiter, such as a comma, and records separated by a second character delimiter, such as a carriage return/line feed pair. The data itself may contain further character delimiters to separate data elements. The fields in one embodiment include: (1) the CPR address or node name; (2) the service type of information (configuration, queue configuration, encryption module configuration, etc.); (3) the data type of the information (queue, service, kernel component, log, etc.); (4) name of data type (service name, queue name, log name, etc.); (5) an update flag (typically, -1); (6) a number indicating (directly or indirectly) the length of the data; and (7) the data itself. An example record for configuring a web (HTTP) service might appear as: CPR1,Config,SERVICE,HTTPSRV,-1,0, ; ; ;C: .backslash.cpr.backslash.bin.backslash.httpsrv.dll; C:.backslash.cpr.backslash.bin.backslash.httpsrvres.dll; ;NORMAL; ; ; ;ROUTE;MainLog;HTTPSRVKDB; ; wherein the node name is CPR1, the service type of information is Config, the data type is SERVICE (i.e., service configuration data), the name of the service is HTTPSRV, the update flag is enabled as "-1". The configuration data elements are delimited by semicolons, and include the pathname for the service DLL (httpsrv.dll), the pathname for the service's resource DLL (httpsrvres.dll) containing resource messages for logging, the log file name (MainLog), a separate routing database for use by the web service (HTTPSRVKDB), and other configuration parameters. Blank data elements are place holders for elements used in the configuration of other services, but unneeded for this particular service example. For instance, for services using the simple service interface, the pathname of the simple service DLL may be entered prior to the pathname of the service DLL. Queue and stream manager 124 manages object queues within the CPR system. Object queues are the input and output queues for all media objects that are being passed to or from CPR services within a single instance of the CPR system. There are usually many such queues in a CPR instance. The queue manager transfers media objects between object queues and signals each service when a media object has arrived on its object queue. Similarly, means are provided for establishing stream buffers for unbounded stream data transmitted between services. The queue and stream manager provides a mechanism for binding services with object queues and stream buffers. The queue and stream manager also creates media objects and stream buffers. Media objects are allocated from a bank or group of media objects of a given size. An embodiment of the queue and stream manager API is provided below.
Queue & Stream Manager API
Start( ); Starts the queue and stream manager
Shutdown( ); Shuts down the queue and stream manager in this
instance
CreateObjectBank( ); Creates a new object bank
DeleteObjectBank( ); Deletes a specified object bank
CreateObjectQueue( ); Creates an object queue
ModifyObjectQueue( ); Modifies an existing object queue
DeleteObjectQueue( ); Deletes a specified object queue
CreateMediaObject( ); Creates a media object (allocated from an
appropriate bank)
LockObjectToPtr( ); Obtains the pointer to the object memory from the
object
handle
UnlockObject( ); Unlocks the object previously locked w/
LockObjectToPtr()
DeleteMediaObject( ); Deletes a media object allocated by
CreateMediaObject()
ReallocateMediaObject( ); Reallocates the size of a media object
BindToInputQueue( ); Binds a given service with input end of a queue
GetQueueClassType( ); Retrieves the class type of objects associated w/ a
given queue
PlaceObjectOnQueue( ); Places a media object on a given queue
BindToOutputQueue( ); Binds a given service with the output end of a
queue
RegisterQueueSemaphore( ); Registers a semaphore object with the output end
of a queue
GetObjectFromQueue( ); Retrieves an object from a queue
UnbindQueue( ); Unbinds a service from a queue
CreateStreamBuffer( ); Creates a stream buffer with a specified maximum
size and
number of channels
DestroyStreamBuffer( ); Destroys a given stream buffer
BindToInputStream( ); Binds a given service to the input of a given
stream buffer
BindToOutputStream( ); Binds a given service to the output of a given
stream buffer
RegisterStreamEvent( ); Registers a given event with a stream
AddDataToStream( ); Adds data to a stream buffer
GetDataFromStream( ); Retrieves data from a stream buffer
Remote service call (RSC) manager 125 enables simple, high performance function calls to be passed between CPR services, independently of location. The remote service call manager handles the packaging or encapsulation of function calls and parameters into media objects for delivery to the appropriate service and the unpackaging at the receiving end. The remote service call manager also manages the return and packaging/unpackaging of results as media objects. The interaction between the RSC manager and CPR services is described more fully with respect to FIGS. 2, 4, and 5A-B, later in this specification. An embodiment of the RSC manager API is provided below.
Remote Service Call Manager API
Start( ); Starts the RSC manager
Shutdown( ); Stops the RSC manager
Callside_Start( ); Initializes the calling side info for a
service
Callside_ProcessObject( ); Used to process a received RSC object at the
calling
side; returns TRUE if processed
InitializeCall( ); Sets up a new function call
AddParameter( ); Adds a parameter to a function
MakeCall( ); Makes a function call
GetStatus( ); Tests the state of a given function call
WaitMore( ); Waits for a longer time for completion of a
function
call
GetStatusDescription( ); Retrieves any description of an error state
GetReturnValue( ); Gets a return parameter from a returned
function
CloseCall( ); Destroys an outbound call
ReceiveSide_Start( ); Starts a session for responding to API calls
ReceiveSide_ProcessMediaObject( ); Used to process an incoming media object
at the
receive side; returns TRUE if processed
GetParameter( ); Retrieves a parameter from a function call
GetSafeParameter( ); Same as above, but exceptions are trapped and
the
size is set to zero and the data to null
automatically
AddReply( ); Adds a reply to a function call
ReturnReply( ); Replies to a function call
CloseReply( ); Closes a reply to a function call
Link manager 126 consists of three primary components used by link services: a compression module manager, an encryption module manager, and a terminal/authentication module manager. The compression module manager provides the management of installable compression modules used mainly by link services. The installable compression modules are kernel level components implemented to support a standard interface specification. The encryption module manager provides the management of installable encryption modules used mainly via link services. The installable encryption modules are also kernel level components implemented to support a standard interface specification. The terminal/authentication module manager provides the management of installable authentication modules which enable two link services on separate CPR nodes to determine that they are each communicating with the authentic correspondent. Each module manager comprises an API for managing the respective component modules. These APIs further include general function calls for authentication, encryption or compression of data. However, authentication, encryption and compression are implemented within the respective component modules. The manager API passes those function calls through to the API of a given installed component module for actual processing. An embodiment of the API for the terminal/authentication module manager is provided below.
Terminal/Authentication Module Manager (Link Manager) API
Start( ); Starts the terminal/authentication module manager
Stop( ); Stops the terminal/authentication module manager
Initialize( ); Sets up all terminal services
AddTerminalService( ); Installs a terminal service DLL (module)
StartTerminalSession( ); Starts a terminal session of a given terminal
service
GetDataFromTerminal( ); Retrieves data to be sent across transmission
channel to the
remote terminal
GiveDataToTerminal( ); Passes data retrieved from the transmission channel
to the
terminal
ConvertToChannelData( ); Lets the terminal convert regular data into a form
to place
on the channel
ConvertFromChannelData( ); Lets the terminal convert channel data back to
the data
buffer originated at the source terminal
StopTerminalSession( ); Ends a terminal session
Each respective terminal/authentication module implements the following API which receives function calls passed from the terminal/authentication module manager: Terminal_Startup( ); //starts the given terminal/authentication module Terminal_StartTerminalSession( ); Terminal_GetDataFromTerminal( ); Terminal_GiveDataToTerminal( ); Terminal_StopTerminalSession( ); Terminal_Shutdown( ); //shuts down the given terminal/authentication module In addition, the following type definitions are associated with the terminal/authentication module manager.
typedef enum
{
KTERM_SLAVE, / / The terminal should wait for
communication
KTERM_MASTER / / The terminal should initiate the protocol
} KTERM_TYPE;
typedef enum
{
KTERM_NOTIFY_WAITING, / / The terminal is waiting for
the other end
KTERM_NOTIFY_HASDATA, / / The terminal has data it
wishes to send over the channel
KTERM_NOTIFY_AUTHENTICATED, / / The terminal has
authenticated the remote terminal
KTERM_NOTIFY_SECURE, / / The terminal has
agreed on an encryption standard for the channel
(all data should flow through the terminal)
KTERM_NOTIFY_COMPRESS, / / The terminal has
agreed on a compression standard for the channel
(all data should flow through the terminal)
KTERM_NOTIFY_NOTAUTHENTICATED, / / The terminal
could not authenticate the remote terminal
KTERM_NOTIFY_DISCONNECT / / The terminal
has disconnected from the channel
} KTERM_NOTIFICATION;
This callback is in the link service: typedef void (*PFN_TERMMAN_CALLBACK)(KTERM_HANDLE *terminal_handle, KTERM_NOTIFICATION notification_message, DWORD *notification_param, LPDWORD callback_data); When a link service wishes to use a terminal/authentication procedure, the link service first calls the StartTerminalSession( ) function of the terminal/authentication module manager as follows:
void DLLEXPORT KTermMan_StartTerminalSession(
const_TCHAR *terminal_name, / / The name of the terminal
service
const_TCHAR *terminal_address, / / Address of terminal
KTERM_TYPE terminal_type, / / Whether the terminal is
to be the master or slave
KTERM_HANDLE *terminal_handle / / Will be filled with
the handle to this terminal session
PFN_TERMMAN_CALLBACK callback, / / The callback to be
used for notification of important state changes
LPDWORD callback_data);
Via the callback function passed to the StartTerminalSession( ) function, the link service receives notifications about the authentication process. If the authentication process requires authentication data to be sent to the remote link service, the callback function is called by the terminal/authentication module manager. The link service retrieves the authentication data from the terminal and sends it to the remote link service. When the remote link service receives the authentication data, the remote link service passes the data to the remote terminal/authentication module manager. Typically, the remote terminal will initiate a further callback from the remote link service to reply to the local terminal. After one or more rounds of sending authentication data between the local and remote terminals, the callback function is called indicating whether the link has been authenticated or not. Embodiments of APIs for the encryption and compression module managers are provided below. The operations indicated below are, in most cases, performed by forwarding the function call to an appropriate module in which the operation is implemented.
Encryption Module Manager (Link Manager) API
Start( ); Starts the encryption module
Stop( ); Stops the encryption module
Initialize( ); Sets up all crypto services found in the configuration
file
AddCryptoService( ); Installs a crypto service DLL
EncryptObject( ); Encrypts a media object
DecryptObject( ); Decrypts an encrypted media object
DeleteObject( ); Deletes an object created by EncryptObject() or
DecryptObject()
AddPublicKey( ); Adds a public key to the database supported by the
encryption type
RevokeKey( ); Revokes a key
Each respective encryption module implements the following API which receives function calls passed from the encryption module manager, and carries out the indicated operation as befits the encryption standard supported by the given module: KCryp_Startup( ); // starts the given encryption module KCryp_EncryptObject( ); KCryp_DecryptObject( ); KCryp_DeleteObject( ); KCryp_AddPublicKey( ); KCryp_RevokeKey( ); KCryp_Shutdown( ); // shuts down the given encryption module
Compression Module Manager (Link Manager) API
Start( ); Starts the compression module manager
Stop( ); Stops the compression module manager
Initialize( ); Sets up all compression services found in the
configuration file
AddCompService( ); Installs a compression service DLL
CompressObject( ); Compresses a media object
DecompressObject( ); Decompresses a compressed media object
DeleteObject( ); Deletes an object created by CompressObject() or
DecompressObject()
Each respective compression module implements the following API which receives function calls passed from the compression module manager, and carries out the indicated operation as befits the compression standard supported by the given module: KComp_Startup( ); // starts the given compression module KComp_CompressObject( ); KComp_DecompressObject( ); KComp_DeleteObject( ); KComp_Shutdown( ); // shuts down the given compression module Configuration manager 127 of FIG. 1 is used to manage the services running in a CPR instance. The configuration manager is responsible for loading and starting all CPR services, including kernel services. The start-up configuration of a CPR instance (i.e., which services get loaded, how initial resources are allocated, language of operation, etc.) is defined by a configuration script. The configuration script is retrieved by the boot manager from a database loaded by the storage manager 123, and is passed to the configuration manager by the boot manager. The configuration manager parses the configuration script to create an internal model of the CPR start-up configuration. The configuration manager then creates the appropriate resources, and loads, initializes, and starts the CPR services, as represented with line 111 in FIG. 1. The configuration manager is also called to provide the orderly shutdown of services and deallocation of initial resources during a CPR shutdown process. The configuration manager can also perform this function dynamically, starting or stopping services during CPR system operation. An embodiment of the configuration manager API is provided below.
Configuration Manager API
Start( ), Starts the configuration manager
Stop( ); Stops the configuration manager
GetVariable( ); Gets a variable defined
GetFirstService( ); Returns details of first services currently
active on
this CPR instance
GetNextService( ); Returns details of next service active on this
CPR
instance
PrepareScriptFromServiceObject( ); Prepares a configuration script from a
running service
and returns the script as a string
ScriptSetup( ); Configures a new service from a string of
configuration
information
ServiceSetup( ); Starts up a service when CPR system is already
running
ServiceShutdown( ); Shuts down an existing service while CPR
system
continues to run
Another kernel component which is not shown in FIG. 1 is the object handler. The object handler provides a standard interface for manipulating the contents of media objects. In one embodiment, the object handler is a media object API, such as that shown below, which provides a set of capabilities that allows any CPR service to manipulate objects without explicit knowledge of their data structure.
Object Handler API
StartSession( ); Starts an object handler session; creates a new
media
object
EndSession( ); Ends an object handler session; deletes the media
object
GetObjectData( ); Copies the raw data of the media object to a
buffer
CompactObject( ); Compacts the data of the media object; removes
media
marked as deleted
GetTotalSize( ); Returns the total size of the media object
Add( ); Adds a medium to the media object
Get( ); Gets a medium from the media object
Delete( ); Marks a medium in the media object as deleted
GetFirstName( ); Retrieves the first name of the specified type,
if present
SingleShot_GetFirstName( ); Starts a session, retrieves first name of the
specified type,
and closes the session
GetNextName( ); Retrieves the next name of the current type
AddName( ); Adds a name of the specified type
GetFirstAddress( ); Retrieves the first address of the specified type
SingleShot_GetFirstAddress( ); Starts a session, retrieves the first
address of the
specified type, and closes the session
GetNextAddress( ); Retrieves the next address of the current type
AddAddress( ); Adds an address of the specified type
CompressObject( ); Compresses the media object
DecompressObject( ); Decompresses the media object
SignObject( ); Creates a message digest for the media object and
encrypts
that digest using the private key for the source
service
CheckSignedObject( ); Tests to see if the media object is signed using
SignObject
A media object is the format in which all bounded data is passed between CPR services. There can be many different types of media objects, all of which share the same general structure. Examples of possible media object and media stream types are: /Fax/FR/Outbound /Fax/FR/Inbound /Fax/FR/Response /Multimedia/Combined/MPEG2System /Multimedia/Video/MPEG2 /Multimedia/Video/AVI /Multimedia/Video/QuickTime /Multimedia/Image/PCX /Multimedia/Image/PCX/4Bit /Multimedia/Image/PCX/8Bit /Multimedia/Image/PCX/16Bit /Multimedia/Image/PCX/24Bit /Multimedia/Image/BMP /Multimedia/Image/TIFF /Multimedia/Image/TIFF/Group3 /Multimedia/Image/TIFF/Group4 $Install/FileGrouping $Install/InstallFile $KRSC/OutboundCall $KRSC/ReturnFromCall $Debug/ObjectSpawn/TestObject $Debug/PipePing/KSTATRequest ($ indicates internal system object types) The above type object and stream types would be placed into the media object or stream as a name type so that the service the object or stream is directed to may know how to interpret the object or stream data. If it is a remote service call embedded in a media object, a service or the remote service call manager may determine that such is the case by using the SingleShot_GetFirstName( ) or GetFirstName( ) methods of the object handler to read the media object type. An example embodiment of a media object is illustrated in FIG. 13. The numbers associated with the media object example are index values that refer to a particular media type. Some specific media types are: name types for identification information, address types for source/destination and routing information, and data types for the data specific to the media object type. Index values 0-99 are used to store name type information, such as the universal ID of the media object or the media object public name types listed above (e.g., "/Fax/FR/Outbound"). Specific name types are assigned to each index value, but multiple names may be added to each name type. This may be accomplished, for example, by appending each added name to the last name after insertion of a name delimiter such as the character "/". Names would thus be stored as character strings in the format "/first name/second name/etc." Similarly, address type information, such as the source and destination CPR node addresses, are stored in index values 100-199. As with name types, each index refers to a specific address type, but multiple addresses may be entered for each address type. In the embodiment shown, index values 200-999 are reserved for other CPR system information. Index values 1000 and beyond are used to store data type information for the media object. The mapping of particular data types to each index above 1000 is specific to the type of media object, and is known by those services handling media objects of the given type. For example, services associated with faxing that use the media object type "/Fax/FR/Outbound" may store, at a first index, data regarding the number of pages in the fax, while at second and third indices, data regarding the recipient's telephone number and resolution may be stored. At another index, the fax data itself is stored. A fax application service may extract this information by invoking the Get( ) method of the object handler and specifying the appropriate media type index. Other services in the CPR system may add, delete or alter data in the media object over the course of the media object's transit of the CPR network. The generation of a media object is performed by first opening a session with the object handler (StartSession( )). This returns a handle to the media object which is used in all subsequent object handler method invocations. Data is then added to the media object by using the AddName( ), AddAddress( ), and Add( ) methods. When all desired name, address and data types have been filled as needed, the media object is compacted by invoking the CompactObject( ) method. This reduces the size of the media object to the actual size of the enclosed data, and removes name, address and data type items marked as deleted. After the media object has been compacted, the object may be compressed, if desired, by invoking the CompressObject( ) method. The GetObjectData( ) method is then used to place the actual data of the media object into a newly allocated variable preferably matching the size of the actual object data. The data in the variable is then sent on to the CPR system for routing and further processing. To clean up after processing the object, the variable is deleted and the object handler session is closed using the EndSession( ) method. Service/Kernel Interaction FIG. 12 is a flow diagram illustrating one embodiment of a general service startup procedure carried out by configuration manager 127. In step 1200 of FIG. 12, the configuration manager uses the handle of the configuration file to access the service configuration setup database in the storage manager. In step 1201, the setup information for the first service is retrieved from the service configuration setup database. Using the setup information, an input queue is created in the logging manager in step 1202. If, in step 1203, an output logging queue has been created, the procedure continues at step 1205. If an output logging queue has not yet been created, the configuration manager creates an output queue in the logging manager in step 1204, before proceeding to step 1205. In step 1205, the configuration manager binds the input logging queue to the output logging queue. In step 1206, object queues are created for the service in the queue and stream manager, and in step 1207, the configuration manager binds the object queues to the service. In step 1208, the configuration manager starts the service, and passes the handles of the logging and object queues to the service. In step 1209, if there are no more services to start, the procedure is completed. Otherwise, the setup information for the next service is retrieved in step 1210, and the procedure returns to step 1202 for handling of the next service. FIG. 2 is a block diagram illustrating the interaction between services and kernel components with respect to the loading of services and establishing of queue handles for the passage of media objects. FIG. 2 comprises queue and stream manager 124, remote service call manager 125, configuration manager 127 and services 128, as well as simple service interface 220 and object handler 221. Simple service interface 220 provides a simplified interface to the CPR system for those services that do not require the use of complex CPR functionality. Configuration manager 127 interacts with queue and stream manager 124 (line 201) to create any object queues to be used by a service. If the configuration data states that the service uses the simple service interface, these queues are passed to the simple service interface module (line 202) which then loads the real service. If the configuration data states that the service is to be loaded directly, the service is loaded by configuration manager 127 (line 203), and the queue handles are passed to the service as described with respect to FIG. 12. A service 128 can use the queue handles passed directly to the service to both receive objects from other services and to send objects to other services via line 204. Media objects that are actually remote service call objects are passed through remote service call manager 125 via line 205. Remote service call manager 125 passes the actual function call to the service via line 206. A number of queues, as represented by line 207, can be used in addition to line 204 to pass objects of various types to and from service 128. The number of queues depends on the current loading of the service. When the service 128 uses the simple service interface 220, all the queues pass through the simple service interface 220, shown by line 208, instead of passing directly to the service 128. The simple service interface 220 then passes the objects onto service 128 (line 209) as a function call. Remote service call manager 125 interacts similarly with simple service interface 220 via line 210, as is done with service 128 via line 206. Service 128 interacts with object handler 221, as represented by line 212, in order to manipulate the contents of media objects. FIG. 3 illustrates the interaction between CPR services and the CPR kernel for the purposes of logging. FIG. 3 includes logging manager 121, configuration manager 127, services 128, simple service interface 220, input queues 310A-310C and output queue 312. Input queues 310A, 310B, and 310C are the inbound log queues for logging manager 121. Each queue contains logged messages from a single service which need to be written to an external log file. Output queue 312 is an outbound log queue for logging manager 121. Output queue 312 contains log messages from multiple services. There may be a plurality of such output queues 312, each servicing multiple input queues. Before loading any service, configuration manager 127 interacts with logging manager 121, as represented by line 301, to create an input log queue for each service. Configuration manager 127 also creates one or more output log queues and binds any number of the input log queues to a given output queue. The handle for the instantiated input log queue is presented to the respective service 128 either directly, as represented by line 303, or via the simple service interface 220 if appropriate, as represented by line 302. When a service 128 needs to log a message, the message is passed to logging manager 121 with the handle for the associated input queue, as represented by line 304. When simple service interface 220 is involved, the log message and the input queue handle are provided to logging manager 121 in a similar manner via lines 305A and 305B. After receiving a message to be logged, logging manager 121 places a logged message on the appropriate input queue (310A, 310B or 310C) as represented by lines 306A, 306B or 306C, based on the handle included with the log message. Each output queue 312 has a monitor thread 311 which detects when there are messages in any bound input queue 310A, 310B or 310C. Monitor thread 311 retrieves the log message from input queues 310A, 310B or 310C, as represented by lines 307A, 307B, or 307C, respectively, and places the message on output log queue 312 via line 308. Another thread monitors the end of the output log queues and writes any message on the output log queues to an appropriate file, as represented by arrow 309. Service-To-Service Communication FIG. 4 is a block diagram illustrating the flow of information between services in the CPR system. FIG. 4 comprises the following elements: kernel router 401; queue and stream manager 124 managing queues 403A, 403B, 404A and 404B; remote service call manager 125; logging manager 121; storage manager 123 and database 414; application 410; network 411; and services 400A, 400B, 400C, 400D and 400E. All lines in FIG. 4 represent interaction between the respective components. In FIG. 4, queue and stream manager 124 manages object queues 403A, 403B, 404A, and 404B, associated with media object communication between kernel router 401 and service 400A. Object queues 403A and 403B are coupled to kernel router 401 via lines 405A and 405B, respectively, and to service 400A via lines 406A and 406B, respectively. Object queues 404A and 404B are coupled to kernel router 401 via lines 407A and 407B, respectively, and to remote service call manager 125 via lines 408A and 408B, respectively. Remote service call manager 125 is coupled to service 400A for the purpose of sending and receiving remote function calls derived from remote service call media objects via lines 409A and 409B. Service 400A is coupled to application 410 and network 411 via lines 412 and 413, respectively. Service 400A is also coupled to logging manager 121 and storage manager 123 via lines 415 and 416, respectively. Storage manager 123 is coupled to database 414. Services 400B, 400C, 400D and 400E are coupled to kernel router 401 via lines 402B, 402C, 402D and 402E, respectively. Although not explicitly shown, services 400B-400E are coupled to kernel router 401 in a similar manner to which service 400A is coupled to kernel router 401, i.e. services 400B-400E are coupled via respective queues in queue and stream manager 124, and via remote service call manager 125 to kernel router 401. If service 400A is an application service, then the service acts as the CPR interface for a third party application or device such as application 410. Information and requests from the third party application or device are thus transmitted via an application service into the CPR system in the form of media objects containing data or remote service calls. Also, media objects and remote service calls may be directed to service 400A to request services from the third party application or to return a service request response to the application. If service 400A is a link service, then the link service provides an interface to other CPR nodes through a network connection or channel, as represented by network 411. Content, routing and kernel services interact directly with other services and components internal to the given CPR instance. Service 400A interacts with logging manager 121 to log messages to a log file as previously described with respect to FIG. 3. Service 400A may interact with storage manager 123 to store and retrieve data to and from database 214. Service 400A sends media objects to other services, such as service 400B, by placing a media object on queue 403B. Kernel router 401 retrieves the media object from queue 403B, reads the next destination (i.e., service 400B) from the object, and places it on similar queue bound to service 400B. Service 400B can similarly put a media object on a queue bound to kernel router 401, after which the kernel router 401 will retrieve the incoming media object and place it on queue 403A where it is retrieved by service 400A. Media objects containing remote service calls originating from or destined for service 400A are passed between the kernel router and the remote service call manager via queues 404A and 404B. Alternatively, remote service call objects may be sent to the service via queue 403A, and forwarded from service 400A to the remote service call manager. Function calls and responses are passed between the remote service call manager and service 400A via lines 409A and 409B. FIGS. 5A and 5B provide a more detailed description of the flow of remote service call objects. FIG. 5A shows the interaction between service 400A and kernel router 401 when service 400A is acting as a server with respect to a remote service call object. FIG. 5B illustrates the interaction between service 400A and kernel router 401 when service 400A is acting as a client with respect to a remote service call object. In this embodiment, remote service call manager 125 is equipped with a single outbound queue 404B directed to kernel router 401. No queue for passing objects from kernel router 401 to remote service call manager 125 is needed in this embodiment. All media objects destined for service 400A, including remote service call objects, are passed to service queue 403A for transmission to service 400A. Those media objects which are remote service calls are detected by service 400A and forwarded to remote service call manager 125 for processing into a function call. Communication between service 400A and remote service call manager 125 is accomplished via stub code compiled into the service. In FIG. 5A, with service 400A acting as a server, a remote service call object generated by a client service (not shown) is forwarded by kernel router 401 to service input queue 403A in step 1. In step 2, the media object is removed from input queue 403A by service 400A, and passed to remote service call manager 125. If remote service call manager 125 cannot process the object, it is returned to service 400A for post processing. If remote service call manager 125 recognizes the object as a remote service call, it unpackages the information from the remote service call and calls a stub function in service 400A in step 3. When service 400A has actually performed the remote service call, service 400A returns any return values and status codes back to remote service call manager 125 in step 4. Remote service call manager 125 packages the function return values and status codes as a media object referencing the original call object, and, in step 5, places the new media object on queue 404B, which is bound to kernel router 401. In step 6, kernel router 401 obtains the returned media object from queue 404B and delivers it to the original client service that made the remote service call. In FIG. 5B, service 400A acts as a client with respect to generating remote service calls. In step 1, service 400A calls stub code compiled into the service which in turn calls remote service call manager 125. In step 2, remote service call manager 125 packages the function call as a remote service call media object, and places the newly created object on queue 404B for kernel router 401. The object is removed from queue 404B in step 3, and kernel router 401 interacts with the service acting as a server as described with respect to FIG. 5A. Kernel router 401 may forward the remote service call object to a CBSR service for determination of an appropriate service to act as a server. In step 4, kernel router 401 places the returned media object containing the response to the remote service call onto queue 403A. On receipt of the return function call object from queue 403A, in step 5, service 400A passes the object to remote service call 125. Remote service call manager 125 unpackages the returned call and correlates the call with the original call, signaling service 400A that the remote service call has completed in step 6. Service 400A then requests the returned parameters from the remote service call manager (again implemented in the same stub as step 1). Node-To-Node Communications FIG. 6 is a block diagram illustrating the process for communication between separate instances or nodes of the CPR system. Node A comprises services 602A, 603A and 604A coupled to kernel router 401A, and node B comprises services 602B, 603B and 604B coupled to kernel router 401B. Interaction between these services and the respective kernel routers is as described with respect to FIGS. 5A and 5B. Kernel router 401A is coupled to link service 600A via object queues 124A. Kernel router 401B is coupled to link service 600B via object queues 124B. Link service 600A and link service 600B are coupled to link manager 126A and link manager 126B, respectively. Link service 600A and link service 600B are coupled together via network 601, which acts as the communication link between node A and node B. The process by which remote services communicate is described as follows with respect to the communication of a media object from service 602A of node A to service 602B of node B. In step 1, service 602A creates a media object addressed to remote service 602B and places the object on a queue bound to kernel router 401A. In step 2, kernel router 401A examines the address of the media object and determines, possibly with the assistance of the CBSR service, the best route to service 602B. In this case, the route found is through link service 600A. Therefore, the media object is placed on queue 124A bound to link service 600A. On reception of the media object from queue 124A, in step 3, link service 600A interacts with li | ||||||
