ET System
16.4
|
These routines are used both to configure a bridge between 2 ET systems and to actually run the bridge. More...
Functions | |
int | et_bridge_config_init (et_bridgeconfig *config) |
This routine initializes a configuration used to establish a bridge between 2 ET systems. More... | |
int | et_bridge_config_destroy (et_bridgeconfig sconfig) |
This routine frees the memory allocated when a bridge configuration is initialized by et_bridge_config_init. More... | |
int | et_bridge_config_setmodefrom (et_bridgeconfig config, int val) |
This routine sets the mode of getting events from the "from" ET system. More... | |
int | et_bridge_config_getmodefrom (et_bridgeconfig config, int *val) |
This routine gets the mode of getting events from the "from" ET system. More... | |
int | et_bridge_config_setmodeto (et_bridgeconfig config, int val) |
This routine sets the mode of getting new events from the "to" ET system. More... | |
int | et_bridge_config_getmodeto (et_bridgeconfig config, int *val) |
This routine gets the mode of getting new events from the "to" ET system. More... | |
int | et_bridge_config_setchunkfrom (et_bridgeconfig config, int val) |
This routine sets the maximum number of events to get from the "from" ET system in a single call to et_events_get - the number of events to get in one chunk. More... | |
int | et_bridge_config_getchunkfrom (et_bridgeconfig config, int *val) |
This routine gets the maximum number of events to get from the "from" ET system in a single call to et_events_get - the number of events to get in one chunk. More... | |
int | et_bridge_config_setchunkto (et_bridgeconfig config, int val) |
This routine sets the maximum number of new events to get from the "to" ET system in a single call to et_events_new - the number of events to get in one chunk. More... | |
int | et_bridge_config_getchunkto (et_bridgeconfig config, int *val) |
This routine gets the maximum number of new events to get from the "to" ET system in a single call to et_events_new - the number of events to get in one chunk. More... | |
int | et_bridge_config_settimeoutfrom (et_bridgeconfig config, struct timespec val) |
This routine sets the time to wait for the "from" ET system during all et_events_get calls when the mode is set to ET_TIMED. More... | |
int | et_bridge_config_gettimeoutfrom (et_bridgeconfig config, struct timespec *val) |
This routine gets the time to wait for the "from" ET system during all et_events_get calls when the mode is set to ET_TIMED. More... | |
int | et_bridge_config_settimeoutto (et_bridgeconfig config, struct timespec val) |
This routine sets the time to wait for the "to" ET system during all et_events_new calls when the mode is set to ET_TIMED. More... | |
int | et_bridge_config_gettimeoutto (et_bridgeconfig config, struct timespec *val) |
This routine gets the time to wait for the "to" ET system during all et_events_new calls when the mode is set to ET_TIMED. More... | |
int | et_bridge_config_setfunc (et_bridgeconfig config, ET_SWAP_FUNCPTR func) |
This routine sets the function used to automatically swap data from one endian to another when bridging events between two ET systems. More... | |
int | et_events_bridge (et_sys_id id_from, et_sys_id id_to, et_att_id att_from, et_att_id att_to, et_bridgeconfig bconfig, int num, int *ntransferred) |
This routine transfers events between two ET systems in which events are copied from the "from" ET system and placed into the "to" ET system. More... | |
These routines are used both to configure a bridge between 2 ET systems and to actually run the bridge.
int et_bridge_config_destroy | ( | et_bridgeconfig | sconfig | ) |
This routine frees the memory allocated when a bridge configuration is initialized by et_bridge_config_init.
sconfig | bridge configuration. |
References ET_OK.
Referenced by et_events_bridge().
int et_bridge_config_getchunkfrom | ( | et_bridgeconfig | config, |
int * | val | ||
) |
This routine gets the maximum number of events to get from the "from" ET system in a single call to et_events_get - the number of events to get in one chunk.
sconfig | bridge configuration. |
val | int pointer that gets filled with chunk size. |
References et_bridge_config_t::chunk_from, ET_ERROR, ET_OK, ET_STRUCT_OK, and et_bridge_config_t::init.
int et_bridge_config_getchunkto | ( | et_bridgeconfig | config, |
int * | val | ||
) |
This routine gets the maximum number of new events to get from the "to" ET system in a single call to et_events_new - the number of events to get in one chunk.
sconfig | bridge configuration. |
val | int pointer that gets filled with chunk size. |
References et_bridge_config_t::chunk_to, ET_ERROR, ET_OK, ET_STRUCT_OK, and et_bridge_config_t::init.
int et_bridge_config_getmodefrom | ( | et_bridgeconfig | config, |
int * | val | ||
) |
This routine gets the mode of getting events from the "from" ET system.
sconfig | bridge configuration. |
val | int pointer that gets filled with either ET_SLEEP, ET_TIMED, or ET_ASYNC. |
References ET_ERROR, ET_OK, ET_STRUCT_OK, et_bridge_config_t::init, and et_bridge_config_t::mode_from.
int et_bridge_config_getmodeto | ( | et_bridgeconfig | config, |
int * | val | ||
) |
This routine gets the mode of getting new events from the "to" ET system.
sconfig | bridge configuration. |
val | int pointer that gets filled with either ET_SLEEP, ET_TIMED, or ET_ASYNC. |
References ET_ERROR, ET_OK, ET_STRUCT_OK, et_bridge_config_t::init, and et_bridge_config_t::mode_to.
int et_bridge_config_gettimeoutfrom | ( | et_bridgeconfig | config, |
struct timespec * | val | ||
) |
This routine gets the time to wait for the "from" ET system during all et_events_get calls when the mode is set to ET_TIMED.
sconfig | bridge configuration. |
val | pointer that gets filled with time to wait for events from the "from" ET system. |
References ET_ERROR, ET_OK, ET_STRUCT_OK, et_bridge_config_t::init, and et_bridge_config_t::timeout_from.
int et_bridge_config_gettimeoutto | ( | et_bridgeconfig | config, |
struct timespec * | val | ||
) |
This routine gets the time to wait for the "to" ET system during all et_events_new calls when the mode is set to ET_TIMED.
sconfig | bridge configuration. |
val | pointer that gets filled with time to wait for new events from the "to" ET system. |
References ET_ERROR, ET_OK, ET_STRUCT_OK, et_bridge_config_t::init, and et_bridge_config_t::timeout_to.
int et_bridge_config_init | ( | et_bridgeconfig * | config | ) |
This routine initializes a configuration used to establish a bridge between 2 ET systems.
This MUST be done prior to setting any configuration parameters or all setting routines will return an error.
config | pointer to an bridge configuration variable |
References et_bridge_config_t::chunk_from, et_bridge_config_t::chunk_to, ET_ERROR, ET_OK, ET_SLEEP, ET_STRUCT_OK, et_bridge_config_t::func, et_bridge_config_t::init, et_bridge_config_t::mode_from, et_bridge_config_t::mode_to, et_bridge_config_t::timeout_from, and et_bridge_config_t::timeout_to.
Referenced by et_events_bridge().
int et_bridge_config_setchunkfrom | ( | et_bridgeconfig | config, |
int | val | ||
) |
This routine sets the maximum number of events to get from the "from" ET system in a single call to et_events_get - the number of events to get in one chunk.
sconfig | bridge configuration. |
val | chunk size is any int > 0 with default being 100. |
References et_bridge_config_t::chunk_from, ET_ERROR, ET_OK, and ET_STRUCT_OK.
int et_bridge_config_setchunkto | ( | et_bridgeconfig | config, |
int | val | ||
) |
This routine sets the maximum number of new events to get from the "to" ET system in a single call to et_events_new - the number of events to get in one chunk.
sconfig | bridge configuration. |
val | chunk size is any int > 0 with default being 100. |
References et_bridge_config_t::chunk_to, ET_ERROR, ET_OK, and ET_STRUCT_OK.
int et_bridge_config_setfunc | ( | et_bridgeconfig | config, |
ET_SWAP_FUNCPTR | func | ||
) |
This routine sets the function used to automatically swap data from one endian to another when bridging events between two ET systems.
The function must be of the form: int func(et_event *src, et_event *dest, int bytes, int same_endian) and must return ET_OK if successful, else ET_ERROR. The arguments consists of: src which is a pointer to the event whose data is to be swapped, dest which is a pointer to the event where the swapped data goes, bytes which tells the length of the data in bytes, and same_endian which is a flag equalling one if the machine and the data are of the same endian and zero otherwise. This function must be able to work with src and dest being the same event. With this as a prototype, the user can write a routine which swaps data in the appropriate manner. Notice that the first two arguments are pointers to events and not data buffers. This allows the writer of such a routine to have access to any of the event's header information. In general, such functions should NOT call et_event_setendian in order to change the registered endian value of the data. This is already taken care of in et_events_bridge.
sconfig | bridge configuration. |
val | swapping function pointer. |
References ET_ERROR, ET_OK, ET_STRUCT_OK, et_bridge_config_t::func, and et_bridge_config_t::init.
int et_bridge_config_setmodefrom | ( | et_bridgeconfig | config, |
int | val | ||
) |
This routine sets the mode of getting events from the "from" ET system.
sconfig | bridge configuration. |
val | is set to either ET_SLEEP, ET_TIMED, or ET_ASYNC and determines the mode of getting events from the "from" ET system. The default is ET_SLEEP. |
References ET_ASYNC, ET_ERROR, ET_OK, ET_SLEEP, ET_STRUCT_OK, ET_TIMED, et_bridge_config_t::init, and et_bridge_config_t::mode_from.
int et_bridge_config_setmodeto | ( | et_bridgeconfig | config, |
int | val | ||
) |
This routine sets the mode of getting new events from the "to" ET system.
sconfig | bridge configuration. |
val | is set to either ET_SLEEP, ET_TIMED, or ET_ASYNC and determines the mode of getting new events from the "to" ET system. The default is ET_SLEEP. |
References ET_ASYNC, ET_ERROR, ET_OK, ET_SLEEP, ET_STRUCT_OK, ET_TIMED, et_bridge_config_t::init, and et_bridge_config_t::mode_to.
int et_bridge_config_settimeoutfrom | ( | et_bridgeconfig | config, |
struct timespec | val | ||
) |
This routine sets the time to wait for the "from" ET system during all et_events_get calls when the mode is set to ET_TIMED.
sconfig | bridge configuration. |
val | time to wait for events from the "from" ET system (default = 0 sec). |
References ET_ERROR, ET_OK, ET_STRUCT_OK, et_bridge_config_t::init, and et_bridge_config_t::timeout_from.
int et_bridge_config_settimeoutto | ( | et_bridgeconfig | config, |
struct timespec | val | ||
) |
This routine sets the time to wait for the "to" ET system during all et_events_new calls when the mode is set to ET_TIMED.
sconfig | bridge configuration. |
val | time to wait for new events from the "to" ET system (default = 0 sec). |
References ET_ERROR, ET_OK, ET_STRUCT_OK, et_bridge_config_t::init, and et_bridge_config_t::timeout_to.
int et_events_bridge | ( | et_sys_id | id_from, |
et_sys_id | id_to, | ||
et_att_id | att_from, | ||
et_att_id | att_to, | ||
et_bridgeconfig | bconfig, | ||
int | num, | ||
int * | ntransferred | ||
) |
This routine transfers events between two ET systems in which events are copied from the "from" ET system and placed into the "to" ET system.
A function may be provided to swap the data during the transfer. For the best performance, the process calling this routine should be on the same machine as either the "from" or "to" ET systems. Some experimentation is in order to determine which of the two machines will run the bridging faster. The author's experience suggests that placing the process on the machine with the most processors or computing power will probably give the best results.
id_from | ET system id from which the events are copied. |
id_to | ET system id into which the events are placed. |
att_from | attachment to a station on the "from" ET system. |
att_to | attachment to a station on the "to" ET system (usually GrandCentral). |
bconfig | configuration of the remaining transfer parameters. |
num | total number of events desired to be transferred. |
ntransferred | int pointer that gets filled with the total number of events that were actually transferred at the routine's return. |
References et_id_t::debug, et_bridge_config_destroy(), et_bridge_config_init(), ET_DEBUG_ERROR, ET_ERROR, et_logmsg(), ET_REMOTE, and et_id_t::locality.