TSP: The Transport Sample Protocol



Provider Core Library
[TSP Core Libraries]

Collaboration diagram for Provider Core Library:The Provider module is the set of all provider library interface. More...


Modules

 Datapool Library
 The datapool library is an internal provider-side TSP API which is used by the GLU in order to push sample data to the Provider Core Library.
 Request Handler
 The RequestHandler module is the set of all request handling API for TSP.
 GLU Library
 The GLU is the part of the TSP provider that should be coded each time the underlying 'real' sampled system (hardware card, simulator, .

Defines

#define TSP_ASYNC_REQUEST_NON_BLOCKING   0x00000
 The different value of the TSP asynchronous request handling mode.
#define TSP_PUBLISH_URLS_NONE   0x0000
 The different value of the TSP asynchronous request URLs publishing mode.

Functions

_EXPORT_TSP_PROVIDER void TSP_provider_end (void)
 Finalize the TSP provider library.
_EXPORT_TSP_PROVIDER int32_t TSP_provider_init (GLU_handle_t *theGLU, int *argc, char **argv[])
 Initialize the TSP provider library.
BEGIN_C_DECLS int TSP_provider_private_init (GLU_handle_t *theGLU, int *argc, char **argv[])
 Initialize TSP provider library.
_EXPORT_TSP_PROVIDER int32_t TSP_provider_run (int spawn_mode)
 Main run function for a TSP provider.
_EXPORT_TSP_PROVIDER char ** TSP_provider_urls (int pub_mode)
 Universal Resource Locators of a TSP provider.


Detailed Description

The Provider module is the set of all provider library interface.


Define Documentation

#define TSP_ASYNC_REQUEST_NON_BLOCKING   0x00000

The different value of the TSP asynchronous request handling mode.

#define TSP_PUBLISH_URLS_NONE   0x0000

The different value of the TSP asynchronous request URLs publishing mode.


Function Documentation

_EXPORT_TSP_PROVIDER void TSP_provider_end ( void   ) 

Finalize the TSP provider library.

After this call the TSP provider library should not be called anymore (even a second call to TSP_provider_init is forbidden).

_EXPORT_TSP_PROVIDER int32_t TSP_provider_init ( GLU_handle_t theGLU,
int *  argc,
char **  argv[] 
)

Initialize the TSP provider library.

Main initialisation function for a TSP provider one should call this function before any other call to the TSP provider library. Call this function at the start of your main function with the received argc/argv. Then use the modified argc/argv. If you do not have argc/argv when calling TSP_provider_init then fake it like this:

int argc = 1; char** argv = 0;

argv = (char**)calloc(argc+1, sizeof(char*));

argv[0] = strdup("MyOwnProvider"); argv[1] = NULL;

Parameters:
[in,out] theGLU the GLU object to be used by this provider.
[in,out] argc You must provide the real argc before using it
[in,out] argv You must provide the real argv before using it
Returns:
TSP_STATUS_OK on success other code on failure.

BEGIN_C_DECLS int TSP_provider_private_init ( GLU_handle_t theGLU,
int *  argc,
char **  argv[] 
)

Initialize TSP provider library.

One should call this before any other TSP provider lib call.

Parameters:
[in,out] theGLU the GLU to be registered into the TSP Provider Library.
[in,out] argc the number of argument of the main
[in,out] argv array of argument of size argc.

_EXPORT_TSP_PROVIDER int32_t TSP_provider_run ( int  spawn_mode  ) 

Main run function for a TSP provider.

Call this function to launch the provider after the initialisation

Parameters:
spawn_mode 
  • 0x00 simple non blocking mode, a separate thread will be spawned in order to handle TSP request. The default TSP asynchronous request channel is used.
  • 0x01 simple blocking mode, this function will block forever.
  • 0x10 dynamic non blocking mode, several separate thread will be spawned in order to handle TSP request on several TSP asynchronous request channel (ONC RPC, XML RPC, SOAP, CORBA,...). The number of thread launched may vary dynamically.
  • 0x11 dynamic blocking mode, this function will block forever.
Returns:
TSP_STATUS_OK on success other code on failure.

_EXPORT_TSP_PROVIDER char** TSP_provider_urls ( int  pub_mode  ) 

Universal Resource Locators of a TSP provider.

Call this function to select a mode of URLs publication after the initialisation. Function always returns a string table of URLs

Parameters:
pub_mode 
  • 0x0000 do nothing else.
  • 0x0010 print to stdout.
  • 0x0100 publish to local SNMP agent (TODO).
Returns:
String table or NULL.

Framework Home Page.


Beware !! TSP wave is coming...