30 #include "etCommonNetwork.h"
46 #define ET_VERSION_MINOR 5
50 #define ET_LANG_JAVA 2
52 #define ET_SYSTEM_TYPE_C 1
53 #define ET_SYSTEM_TYPE_JAVA 2
55 #define ET_IPADDRSTRLEN 16
58 #define ET_MAXHOSTNAMELEN 256
61 #define ET_MAXADDRESSES 10
72 #define ET_BEAT_NSEC 500000000
75 #define ET_IS_ALIVE_SEC 2
76 #define ET_IS_ALIVE_NSEC 0
79 #define ET_CLOSE_SEC 2
80 #define ET_CLOSE_NSEC 500000000
83 #define ET_HBMODULO UINT_MAX
108 #define ET_ATTACHMENTS_MAX 100
109 #define ET_PROCESSES_MAX ET_ATTACHMENTS_MAX
112 #define ET_ATT_UNUSED 0
113 #define ET_ATT_ACTIVE 1
116 #define ET_ATT_CONTINUE 0
117 #define ET_ATT_QUIT 1
120 #define ET_ATT_UNBLOCKED 0
121 #define ET_ATT_BLOCKED 1
124 #define ET_ATT_NOSLEEP 0
125 #define ET_ATT_SLEEP 1
128 #define ET_PROC_CLOSED 0
129 #define ET_PROC_OPEN 1
132 #define ET_PROC_ETDEAD 0
133 #define ET_PROC_ETOK 1
136 #define ET_STRUCT_NEW 0
137 #define ET_STRUCT_OK 1
140 #define ET_THREAD_KEEP 0
141 #define ET_THREAD_KILL 1
144 #define ET_MUTEX_SHARE 0
145 #define ET_MUTEX_NOSHARE 1
148 #define ET_MUTEX_UNLOCKED 0
149 #define ET_MUTEX_LOCKED 1
154 #define ET_INITIAL_SHARED_MEM_DATA_BYTES 64
244 #define ET_FIX_READ 0
245 #define ET_FIX_DUMP 1
376 #define ET_BIT64_MASK 0x1
378 #define ET_KILL_MASK 0x2
380 #define ET_GET_BIT64(x) ((x) & ET_BIT64_MASK)
382 #define ET_GET_KILL(x) ((x) & ET_KILL_MASK)
384 #define ET_SET_BIT64(x) ((x) | ET_BIT64_MASK)
386 #define ET_SET_KILL(x) ((x) | ET_KILL_MASK)
584 #define ET_NET_EV_GET_L 0
585 #define ET_NET_EVS_GET_L 1
586 #define ET_NET_EV_PUT_L 2
587 #define ET_NET_EVS_PUT_L 3
588 #define ET_NET_EV_NEW_L 4
589 #define ET_NET_EVS_NEW_L 5
590 #define ET_NET_EV_DUMP_L 6
591 #define ET_NET_EVS_DUMP_L 7
592 #define ET_NET_EVS_NEW_GRP_L 8
595 #define ET_NET_EV_GET 20
596 #define ET_NET_EVS_GET 21
597 #define ET_NET_EV_PUT 22
598 #define ET_NET_EVS_PUT 23
599 #define ET_NET_EV_NEW 24
600 #define ET_NET_EVS_NEW 25
601 #define ET_NET_EV_DUMP 26
602 #define ET_NET_EVS_DUMP 27
603 #define ET_NET_EVS_NEW_GRP 28
605 #define ET_NET_EVS_NEW_GRP_JAVA 29
607 #define ET_NET_ALIVE 40
608 #define ET_NET_WAIT 41
609 #define ET_NET_CLOSE 42
610 #define ET_NET_FCLOSE 43
611 #define ET_NET_WAKE_ATT 44
612 #define ET_NET_WAKE_ALL 45
613 #define ET_NET_KILL 46
615 #define ET_NET_STAT_ATT 60
616 #define ET_NET_STAT_DET 61
617 #define ET_NET_STAT_CRAT 62
618 #define ET_NET_STAT_RM 63
619 #define ET_NET_STAT_SPOS 64
620 #define ET_NET_STAT_GPOS 65
622 #define ET_NET_STAT_ISAT 80
623 #define ET_NET_STAT_EX 81
624 #define ET_NET_STAT_SSW 82
625 #define ET_NET_STAT_GSW 83
626 #define ET_NET_STAT_LIB 84
627 #define ET_NET_STAT_FUNC 85
628 #define ET_NET_STAT_CLASS 86
630 #define ET_NET_STAT_GATTS 100
631 #define ET_NET_STAT_STATUS 101
632 #define ET_NET_STAT_INCNT 102
633 #define ET_NET_STAT_OUTCNT 103
634 #define ET_NET_STAT_GBLOCK 104
635 #define ET_NET_STAT_GUSER 105
636 #define ET_NET_STAT_GRESTORE 106
637 #define ET_NET_STAT_GPRE 107
638 #define ET_NET_STAT_GCUE 108
639 #define ET_NET_STAT_GSELECT 109
641 #define ET_NET_STAT_SBLOCK 115
642 #define ET_NET_STAT_SUSER 116
643 #define ET_NET_STAT_SRESTORE 117
644 #define ET_NET_STAT_SPRE 118
645 #define ET_NET_STAT_SCUE 119
647 #define ET_NET_ATT_PUT 130
648 #define ET_NET_ATT_GET 131
649 #define ET_NET_ATT_DUMP 132
650 #define ET_NET_ATT_MAKE 133
652 #define ET_NET_SYS_TMP 150
653 #define ET_NET_SYS_TMPMAX 151
654 #define ET_NET_SYS_STAT 152
655 #define ET_NET_SYS_STATMAX 153
656 #define ET_NET_SYS_PROC 154
657 #define ET_NET_SYS_PROCMAX 155
658 #define ET_NET_SYS_ATT 156
659 #define ET_NET_SYS_ATTMAX 157
660 #define ET_NET_SYS_HBEAT 158
661 #define ET_NET_SYS_PID 159
662 #define ET_NET_SYS_GRP 160
664 #define ET_NET_SYS_DATA 170
665 #define ET_NET_SYS_HIST 171
666 #define ET_NET_SYS_GRPS 172
707 #define ET_P2EVENT(etid, place) ((et_event *)((et_event *)(etid->events) + (place)))
712 #define ET_PEVENT2USR(p, offset) ((et_event *)((char *)(p) + (offset)))
714 #define ET_PEVENT2ET(p, offset) ((et_event *)((char *)(p) - (offset)))
717 #define ET_PSTAT2USR(p, offset) ((et_station *)((char *)(p) + (offset)))
719 #define ET_PSTAT2ET(p, offset) ((et_station *)((char *)(p) - (offset)))
722 #define ET_PDATA2USR(p, offset) ((void *)((char *)(p) + (offset)))
724 #define ET_PDATA2ET(p, offset) ((void *)((char *)(p) - (offset)))
730 #define ET_64BIT_UINT(hi,lo) (((uint64_t)(hi) << 32) | ((uint64_t)(lo) & 0x00000000FFFFFFFF))
734 #define ET_64BIT_INT(hi,lo) (((int64_t)(hi) << 32) | ((int64_t)(lo) & 0x00000000FFFFFFFF))
738 #define ET_64BIT_P(hi,lo) ((void *)(((uint64_t)(hi) << 32) | ((uint64_t)(lo) & 0x00000000FFFFFFFF)))
741 #define ET_HIGHINT(i) ((uint32_t)(((uint64_t)(i) >> 32) & 0x00000000FFFFFFFF))
744 #define ET_LOWINT(i) ((uint32_t)((uint64_t)(i) & 0x00000000FFFFFFFF))
802 int _mode,
et_att_id att,
struct timespec *time);
804 et_att_id att,
struct timespec *time,
int num,
int *nread);
806 et_att_id att,
struct timespec *time,
int num,
int group,
int *nread);
818 extern int et_mem_create(
const char *name,
size_t memsize,
void **pmemory,
size_t *totalSize);
820 uint32_t headerByteSize, uint64_t eventByteSize,
821 uint64_t headerPosition, uint64_t dataPosition,
822 uint64_t totalByteSize, uint64_t usedByteSize);
826 extern int et_mem_size(
const char *name,
size_t *totalsize,
size_t *usedsize);
834 int mode,
struct timespec *deltatime,
size_t size);
836 int mode,
struct timespec *deltatime,
size_t size,
int num,
int *nread);
838 int mode,
struct timespec *deltatime,
839 size_t size,
int num,
int group,
int *nread);
841 int wait,
struct timespec *deltatime);
843 int wait,
struct timespec *deltatime,
int num,
int *nread);
860 int position,
int parallelposition);
867 int parallelposition);
869 int *parallelposition);
928 int mode,
struct timespec *deltatime,
size_t size);
930 int mode,
struct timespec *deltatime,
size_t size,
int num,
int *nread);
932 int mode,
struct timespec *deltatime,
933 size_t size,
int num,
int group,
int *nread);
935 int mode,
struct timespec *deltatime);
937 int mode,
struct timespec *deltatime,
int num,
int *nread);
975 extern void et_logmsg (
char *sev,
char *fmt, ...);
void * et_statconfig
ET station configuration.
Definition: et.h:340
#define ET_STATNAME_LENGTH
Max length of station name + 1.
Definition: et.h:95
void * et_sys_id
ET system id.
Definition: et.h:339
int(* ET_SWAP_FUNCPTR)(et_event *, et_event *, int, int)
Used to define a data-swapping function.
Definition: et.h:336
int et_att_id
ET attachment id.
Definition: et.h:346
void * et_openconfig
ET open configuration.
Definition: et.h:342
#define ET_STATION_SELECT_INTS
Number of control integers associated with each station.
Definition: et.h:69
int et_proc_id
ET process id.
Definition: et.h:345
#define ET_FUNCNAME_LENGTH
Max length of user's event selection func name + 1.
Definition: et.h:94
#define ET_FILENAME_LENGTH
Max length of ET system file name + 1.
Definition: et.h:93
#define ET_EVENT_GROUPS_MAX
Default max number of groups events are divided into.
Definition: et.h:60
int et_stat_id
ET station id.
Definition: et.h:344
void et_id_destroy(et_sys_id id)
int etr_station_getfunction(et_sys_id id, et_stat_id stat_id, char *function)
Definition: et_remote.c:1156
int etr_station_getstatus(et_sys_id id, et_stat_id stat_id, int *status)
Definition: et_remote.c:1254
int etn_events_new(et_sys_id id, et_att_id att, et_event *evs[], int mode, struct timespec *deltatime, size_t size, int num, int *nread)
#define ET_IPADDRSTRLEN
Max string length of dotted-decimal ip address.
Definition: et_private.h:55
int et_restore_events(et_id *id, et_att_id att, et_stat_id stat_id)
int etr_system_getgroupcount(et_sys_id id, int *groupCnt)
Definition: et_remote.c:1557
int et_station_compare_parallel(et_id *id, et_stat_config *group, et_stat_config *config)
This routine compares all relevant station configuration parameters to see if both configs are compat...
Definition: et_statconfig.c:878
int et_mem_size(const char *name, size_t *totalsize, size_t *usedsize)
int etr_station_getselect(et_sys_id id, et_stat_id stat_id, int *select)
Definition: et_remote.c:1314
void et_llist_lock(et_list *pl)
void et_system_lock(et_system *sys)
struct et_response_t et_response
Structure for holding an ET system's single response to ET client's broad/multicast.
void et_station_unlock(et_system *sys)
int etl_wait_for_alive(et_sys_id id)
int et_look(et_sys_id *id, const char *filename)
void * et_temp_create(const char *name, size_t size)
int etr_events_new_group(et_sys_id id, et_att_id att, et_event *evs[], int mode, struct timespec *deltatime, size_t size, int num, int group, int *nread)
Definition: et_remote.c:2147
#define ET_ATTACHMENTS_MAX
Maximum number of attachments allowed on the system.
Definition: et_private.h:108
int etr_forcedclose(et_sys_id id)
Definition: et_remote.c:414
int et_mem_create(const char *name, size_t memsize, void **pmemory, size_t *totalSize)
int etr_system_getattachments(et_sys_id id, int *atts)
Definition: et_remote.c:1517
int etr_station_detach(et_sys_id id, et_att_id att)
Definition: et_remote.c:786
int etr_system_getprocs(et_sys_id id, int *procs)
Definition: et_remote.c:1497
int etn_event_put(et_sys_id id, et_att_id att, et_event *ev)
struct et_system_t et_system
Structure containing all ET system information.
void * et_temp_attach(const char *name, size_t size)
int et_station_read(et_id *id, et_stat_id stat_id, et_event **pe, int _mode, et_att_id att, struct timespec *time)
struct et_netthread_t et_netthread
Struct for passing data from system to network threads.
int et_responds(const char *etname)
int etr_open(et_sys_id *id, const char *et_filename, et_openconfig openconfig)
Definition: et_remote.c:37
int et_station_nwrite(et_id *id, et_stat_id stat_id, et_event *pe[], int num)
int etr_system_gettemps(et_sys_id id, int *temps)
Definition: et_remote.c:1457
void et_init_attachment(et_system *sys, et_att_id id)
int etr_station_getinputcount(et_sys_id id, et_stat_id stat_id, int *cnt)
Definition: et_remote.c:1264
int etr_system_getstationsmax(et_sys_id id, int *stationsmax)
Definition: et_remote.c:1487
int etr_station_exists(et_sys_id id, et_stat_id *stat_id, const char *stat_name)
Definition: et_remote.c:931
int etr_station_getposition(et_sys_id id, et_stat_id stat_id, int *position, int *parallelposition)
Definition: et_remote.c:853
void * et_netserver(void *arg)
void et_flush_events(et_id *id, et_att_id att, et_stat_id stat_id)
int etr_kill(et_sys_id id)
Definition: et_remote.c:438
int et_llist_write_gc(et_id *id, et_event **pe, int num)
#define ET_MAXHOSTNAMELEN
Max length of a host name including the terminating char.
Definition: et_private.h:58
int etr_station_setprescale(et_sys_id id, et_stat_id stat_id, int prescale)
Definition: et_remote.c:1402
int etr_system_gettempsmax(et_sys_id id, int *tempsmax)
Definition: et_remote.c:1467
int etr_station_getoutputcount(et_sys_id id, et_stat_id stat_id, int *cnt)
Definition: et_remote.c:1274
int etn_event_dump(et_sys_id id, et_att_id att, et_event *ev)
int etr_system_getheartbeat(et_sys_id id, int *heartbeat)
Definition: et_remote.c:1537
int etr_station_getrestore(et_sys_id id, et_stat_id stat_id, int *restore)
Definition: et_remote.c:1304
int etr_system_getprocsmax(et_sys_id id, int *procsmax)
Definition: et_remote.c:1507
struct et_sys_config_t et_sys_config
Structure containing all info necessary to configure an ET system.
int etn_open(et_sys_id *id, const char *filename, et_openconfig openconfig)
void et_init_event_(et_event *pe)
void et_llist_unlock(et_list *pl)
void et_init_event(et_event *pe)
int etr_station_setcue(et_sys_id id, et_stat_id stat_id, int cue)
Definition: et_remote.c:1410
int etr_events_dump(et_sys_id id, et_att_id att, et_event *evs[], int num)
Definition: et_remote.c:3148
void et_station_lock(et_system *sys)
int et_station_dump(et_id *id, et_event *pe)
int et_repair_station(et_id *id, et_stat_id stat_id)
int et_temp_remove(const char *name, void *pmem, size_t size)
int etr_events_new(et_sys_id id, et_att_id att, et_event *evs[], int mode, struct timespec *deltatime, size_t size, int num, int *nread)
Definition: et_remote.c:1895
int etr_wait_for_alive(et_sys_id id)
Definition: et_remote.c:502
void et_memRead_lock(et_id *id)
void et_init_station(et_station *ps)
int et_station_nread(et_id *id, et_stat_id stat_id, et_event *pe[], int mode, et_att_id att, struct timespec *time, int num, int *nread)
void et_system_unlock(et_system *sys)
int et_mem_unmap(const char *name, void *pmem)
int etl_open(et_sys_id *id, const char *filename, et_openconfig openconfig)
int etr_station_setrestore(et_sys_id id, et_stat_id stat_id, int restore)
Definition: et_remote.c:1394
struct et_list_t et_list
Structure defining a station's input or output list of events.
int etr_wakeup_attachment(et_sys_id id, et_att_id att)
Definition: et_remote.c:530
int etr_close(et_sys_id id)
Definition: et_remote.c:390
struct et_stat_data_t et_stat_data
Structure to hold the current state of a station.
int etr_station_create_at(et_sys_id id, et_stat_id *stat_id, const char *stat_name, et_statconfig sconfig, int position, int parallelposition)
Definition: et_remote.c:576
int etr_station_getclass(et_sys_id id, et_stat_id stat_id, char *classs)
Definition: et_remote.c:1109
int etn_kill(et_sys_id id)
void et_init_stats_station(et_station *ps)
int et_station_config_check(et_id *id, et_stat_config *sc)
This routine checks a station's configuration settings for internal inconsistencies or bad values.
Definition: et_statconfig.c:763
int et_mutex_locked(pthread_mutex_t *pmutex)
struct et_mem_t et_mem
Structure containing info stored at front of shared or mapped memory.
int etn_forcedclose(et_sys_id id)
struct et_stat_config_t et_stat_config
Structure to hold parameters used to configure a station.
void * et_cast_thread(void *arg)
int etn_event_new(et_sys_id id, et_att_id att, et_event **ev, int mode, struct timespec *deltatime, size_t size)
void et_mem_write_first_block(char *ptr, uint32_t headerByteSize, uint64_t eventByteSize, uint64_t headerPosition, uint64_t dataPosition, uint64_t totalByteSize, uint64_t usedByteSize)
int et_station_write(et_id *id, et_stat_id stat_id, et_event *pe)
void et_init_process(et_system *sys, et_proc_id id)
int etr_system_getattsmax(et_sys_id id, int *attsmax)
Definition: et_remote.c:1527
int etr_station_setselectwords(et_sys_id id, et_stat_id stat_id, int select[])
Definition: et_remote.c:987
#define ET_PROCESSES_MAX
Maximum number of local processes allowed to open the system.
Definition: et_private.h:109
int etn_events_new_group(et_sys_id id, et_att_id att, et_event *evs[], int mode, struct timespec *deltatime, size_t size, int num, int group, int *nread)
void et_init_stats_allatts(et_system *sys)
void et_init_histogram(et_id *id)
int etn_events_get(et_sys_id id, et_att_id att, et_event *evs[], int mode, struct timespec *deltatime, int num, int *nread)
void et_init_stats_allstations(et_id *id)
int etr_station_getprescale(et_sys_id id, et_stat_id stat_id, int *prescale)
Definition: et_remote.c:1334
int etr_event_get(et_sys_id id, et_att_id att, et_event **ev, int wait, struct timespec *deltatime)
Definition: et_remote.c:2397
int et_llist_write(et_id *id, et_list *pl, et_event **pe, int num)
int etr_attach_geteventsdump(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1632
int etr_station_setposition(et_sys_id id, et_stat_id stat_id, int position, int parallelposition)
Definition: et_remote.c:818
int etr_station_attach(et_sys_id id, et_stat_id stat_id, et_att_id *att)
Definition: et_remote.c:703
int et_llist_read(et_list *pl, et_event **pe)
int etr_system_getpid(et_sys_id id, int *pid)
Definition: et_remote.c:1547
int etn_wait_for_alive(et_sys_id id)
int etl_alive(et_sys_id id)
int etr_attach_geteventsget(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1620
int etr_station_getblock(et_sys_id id, et_stat_id stat_id, int *block)
Definition: et_remote.c:1284
void et_init_stats_all(et_id *id)
int etl_forcedclose(et_sys_id id)
void et_tcp_lock(et_id *id)
int et_mem_attach(const char *name, void **pmemory, et_mem *pInfo)
int et_findlocality(const char *filename, et_openconfig openconfig)
This routine determines whether we are looking for the ET system locally, locally on some non-pthread...
Definition: et_common.c:63
int etn_event_get(et_sys_id id, et_att_id att, et_event **ev, int mode, struct timespec *deltatime)
void et_mem_unlock(et_id *id)
int etr_wakeup_all(et_sys_id id, et_stat_id stat_id)
Definition: et_remote.c:552
int et_repair_gc(et_id *id)
void et_transfer_unlock(et_station *ps)
struct et_id_t et_id
Structure defining an ET system user id (one needed for each system in use) which contains pointers t...
int et_findserver(const char *etname, char *ethost, int *port, uint32_t *inetaddr, et_open_config *config, et_response **allETinfo, int debug)
int etr_attach_geteventsmake(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1644
int etr_events_get(et_sys_id id, et_att_id att, et_event *evs[], int wait, struct timespec *deltatime, int num, int *nread)
Definition: et_remote.c:2593
void et_logmsg(char *sev, char *fmt,...)
Definition: et_common.c:35
int etr_station_getlib(et_sys_id id, et_stat_id stat_id, char *lib)
Definition: et_remote.c:1062
int etr_attach_geteventsput(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1608
int etr_station_getattachments(et_sys_id id, et_stat_id stat_id, int *numatts)
Definition: et_remote.c:1244
int etr_alive(et_sys_id id)
Definition: et_remote.c:463
int etl_kill(et_sys_id id)
int etr_station_remove(et_sys_id id, et_stat_id stat_id)
Definition: et_remote.c:671
void et_memWrite_lock(et_id *id)
int et_station_nread_group(et_id *id, et_stat_id stat_id, et_event *pe[], int mode, et_att_id att, struct timespec *time, int num, int group, int *nread)
int et_station_ndump(et_id *id, et_event *pe[], int num)
void et_init_stats_att(et_system *sys, et_att_id id)
int etr_station_setuser(et_sys_id id, et_stat_id stat_id, int user)
Definition: et_remote.c:1386
int(* ET_SELECT_FUNCPTR)(void *, et_stat_id, et_event *)
Defines event selection function.
Definition: et_private.h:172
int et_mem_remove(const char *name, void *pmem)
int etr_station_getselectwords(et_sys_id id, et_stat_id stat_id, int select[])
Definition: et_remote.c:1022
int et_wait_for_system(et_sys_id id, struct timespec *timeout, const char *etname)
int etr_station_getuser(et_sys_id id, et_stat_id stat_id, int *user)
Definition: et_remote.c:1294
int etn_events_put(et_sys_id id, et_att_id att, et_event *evs[], int num)
int etn_events_dump(et_sys_id id, et_att_id att, et_event *evs[], int num)
int et_unlook(et_sys_id id)
void et_init_llist(et_list *pl)
int etr_events_put(et_sys_id id, et_att_id att, et_event *evs[], int num)
Definition: et_remote.c:2938
int etr_event_dump(et_sys_id id, et_att_id att, et_event *ev)
Definition: et_remote.c:3104
int etr_event_put(et_sys_id id, et_att_id att, et_event *ev)
Definition: et_remote.c:2848
int et_id_init(et_sys_id *id)
void et_transfer_lock_all(et_id *id)
void et_tcp_unlock(et_id *id)
struct et_open_config_t et_open_config
Structure holding all configuration parameters used to open an ET system.
struct et_station_t et_station
Structure defining a station.
int etn_close(et_sys_id id)
int etr_station_isattached(et_sys_id id, et_stat_id stat_id, et_att_id att)
Definition: et_remote.c:899
int etr_station_create(et_sys_id id, et_stat_id *stat_id, const char *stat_name, et_statconfig sconfig)
Definition: et_remote.c:664
int etr_system_getstations(et_sys_id id, int *stations)
Definition: et_remote.c:1477
void et_transfer_lock(et_station *ps)
int etr_station_getcue(et_sys_id id, et_stat_id stat_id, int *cue)
Definition: et_remote.c:1324
struct et_bridge_config_t et_bridge_config
Structure to define configuration parameters used to bridge ET systems (transfer events between 2 sys...
int etl_close(et_sys_id id)
int etn_alive(et_sys_id id)
void et_transfer_unlock_all(et_id *id)
int etr_event_new(et_sys_id id, et_att_id att, et_event **ev, int mode, struct timespec *deltatime, size_t size)
Definition: et_remote.c:1706
int etr_station_setblock(et_sys_id id, et_stat_id stat_id, int block)
Definition: et_remote.c:1378
Structure containing attachment info.
Definition: et_private.h:326
uint64_t events_get
Number of events obtained from station input list.
Definition: et_private.h:339
char interface[ET_IPADDRSTRLEN]
Dot-decimal IP address of outgoing network interface.
Definition: et_private.h:344
int quit
ET_ATT_QUIT to force return from ET API routine, else ET_ATT_CONTINUE if everything OK.
Definition: et_private.h:332
uint64_t events_put
Number of events put into station output list.
Definition: et_private.h:338
et_stat_id stat
Unique index # of station we're attached to.
Definition: et_private.h:329
char host[ET_MAXHOSTNAMELEN]
Host running process that owns attachment.
Definition: et_private.h:343
et_proc_id proc
Unique index # of process owning this attachment.
Definition: et_private.h:328
et_att_id num
Unique index # of this attachment.
Definition: et_private.h:327
int status
ET_ATT_UNUSED is attachment unused or ET_ATT_ACTIVE if active.
Definition: et_private.h:330
uint64_t events_make
Number of new events requested.
Definition: et_private.h:341
int sleep
ET_ATT_SLEEP if attachment is remote and sleeping when getting events (sleep is simulated by multiple...
Definition: et_private.h:334
uint64_t events_dump
Number of events dumped back into GrandCentral's input list (recycles).
Definition: et_private.h:340
int blocked
ET_ATT_BLOCKED if blocked waiting to read events, else ET_ATT_UNBLOCKED.
Definition: et_private.h:331
pid_t pid
Unix process id# of process that owns attachment.
Definition: et_private.h:342
Structure to define configuration parameters used to bridge ET systems (transfer events between 2 sys...
Definition: et_private.h:687
int chunk_to
Number of new events to get from the "to" ET system at one time.
Definition: et_private.h:694
struct timespec timeout_from
Max time to wait when getting events from the "from" ET system.
Definition: et_private.h:695
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:688
int mode_to
ET_SLEEP, ET_TIMED, or ET_ASYNC for getting events from the "to" ET system into which the "from" even...
Definition: et_private.h:691
int chunk_from
Number of events to get from the "from" ET system at one time.
Definition: et_private.h:693
int mode_from
ET_SLEEP, ET_TIMED, or ET_ASYNC for getting events from the "from" ET system.
Definition: et_private.h:689
ET_SWAP_FUNCPTR func
Pointer to function which takes a pointer to an event as an argument, swaps the data,...
Definition: et_private.h:697
struct timespec timeout_to
Max time to wait when getting new events from the "to" ET system.
Definition: et_private.h:696
This structure defines an Event which exists in shared memory, holds data, and gets passed from stati...
Definition: et.h:294
Struct to fix station's input and output linked lists after crash.
Definition: et_private.h:268
struct et_fixout out
Structure to fix station output list.
Definition: et_private.h:270
struct et_fixin in
Structure to fix station input list.
Definition: et_private.h:269
Structure for fixing station input list.
Definition: et_private.h:248
uint64_t eventsin
Value of et_list->events_in at start of dump.
Definition: et_private.h:250
int num
Number of events intended to read/write.
Definition: et_private.h:253
int call
ET_FIX_DUMP if fixing after et_station_(n)dump call, or ET_FIX_READ if fixing after et_station_(n)rea...
Definition: et_private.h:254
int start
Is 1 at start of write and 0 at end.
Definition: et_private.h:251
et_event * first
Value of et_list->firstevent at start of read (NULL if no damage).
Definition: et_private.h:249
int cnt
Value of et_list->cnt at start of read/write.
Definition: et_private.h:252
Structure for fixing station output list.
Definition: et_private.h:260
int num
Number of events intended to read/write.
Definition: et_private.h:263
int cnt
Value of et_list->cnt at start of read/write.
Definition: et_private.h:262
int start
Is 1 at start of write and 0 at end.
Definition: et_private.h:261
Structure defining an ET system user id (one needed for each system in use) which contains pointers t...
Definition: et_private.h:480
int closed
Has et_close been called? 1 = yes, 0 = no.
Definition: et_private.h:485
int port
Port number for ET TCP server.
Definition: et_private.h:523
int locality
ET_LOCAL if process is on same machine as ET system, ET_REMOTE if process is on another machine,...
Definition: et_private.h:515
et_station * stats
Pointer to start of et_station structures in shared memory.
Definition: et_private.h:530
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:481
ptrdiff_t offset
Offset between pointers to same shared memory for ET & user's processes (needed for user process to m...
Definition: et_private.h:511
int bit64
1 if the ET system is a 64 bit executable, else 0.
Definition: et_private.h:486
et_proc_id proc
Unique process id# for process connected to ET system (index into data stored in the et_system struct...
Definition: et_private.h:487
uint64_t esize
Size in bytes of events in ET system.
Definition: et_private.h:510
int alive
Is system alive? 1 = yes, 0 = no.
Definition: et_private.h:484
int version
Major version number of this ET software release.
Definition: et_private.h:503
et_station * grandcentral
Pointer to grandcentral station in shared memory.
Definition: et_private.h:534
int nselects
Number of selection ints per station (or control ints per event).
Definition: et_private.h:504
pthread_mutex_t mutex
Pthread mutex for thread-safe remote communications.
Definition: et_private.h:535
int iov_max
Store the operating system's value iovmax of client's node, default to ET_IOV_MAX (how many separate ...
Definition: et_private.h:521
int group
Default event group for calls to et_event_new and et_events_new.
Definition: et_private.h:502
void * pmap
Pointer to start of shared (mapped) memory.
Definition: et_private.h:528
size_t memsize
Total size of shared memory in bytes - used to unmap the mmapped file when it's already been deleted.
Definition: et_private.h:508
char localAddr[ET_IPADDRSTRLEN]
Local dot-decimal address of socket connection to ET.
Definition: et_private.h:525
pthread_rwlock_t sharedMemlock
Pthread read-write lock for preventing access of unmapped memory after calling et_close.
Definition: et_private.h:537
int nevents
Total number of events in ET system.
Definition: et_private.h:501
et_system * sys
Pointer to et_system structure in shared memory.
Definition: et_private.h:529
int endian
Endianness of client's node ET_ENDIAN_BIG or ET_ENDIAN_LITTLE.
Definition: et_private.h:519
int debug
Level of desired printed debug output which may be ET_DEBUG_NONE, ET_DEBUG_SEVERE,...
Definition: et_private.h:498
int cleanup
Flag used to warn certain routines (such as et_station_detach and et_restore_events) that they are be...
Definition: et_private.h:492
int race
Flag used to eliminate race conditions.
Definition: et_private.h:491
char * data
Pointer to start of event data in shared memory.
Definition: et_private.h:533
int * histogram
Pointer to histogram data in shared memory.
Definition: et_private.h:531
int lang
Language this ET system was written in: ET_LANG_C, ET_LANG_CPP, or ET_LANG_JAVA.
Definition: et_private.h:482
int sockfd
File descriptor of client's TCP socket connection to ET server.
Definition: et_private.h:518
int share
ET_MUTEX_SHARE if operating system can share mutexes between local processes, or ET_MUTEX_NOSHARE for...
Definition: et_private.h:505
et_event * events
Pointer to start of et_event structures in shared memory.
Definition: et_private.h:532
char ethost[ET_MAXHOSTNAMELEN]
Host of the ET system.
Definition: et_private.h:524
int systemendian
Endianness of ET system's node ET_ENDIAN_BIG or ET_ENDIAN_LITTLE.
Definition: et_private.h:520
Structure defining a station's input or output list of events.
Definition: et_private.h:231
uint64_t events_in
Number of events actually put in.
Definition: et_private.h:235
int lasthigh
Place in list of last high priority event.
Definition: et_private.h:233
et_event * lastevent
pointer to last event in linked list.
Definition: et_private.h:238
et_event * firstevent
Pointer to first event in linked list.
Definition: et_private.h:237
pthread_cond_t cread
Pthread condition variable to notify reader that events are here.
Definition: et_private.h:240
pthread_mutex_t mutex
Pthread mutex which protects linked list when reading & writing.
Definition: et_private.h:239
uint64_t events_out
Number of events actually taken out.
Definition: et_private.h:236
int cnt
Number of events in list.
Definition: et_private.h:232
uint64_t events_try
Number of events attempted to be put in (before prescale).
Definition: et_private.h:234
Structure containing info stored at front of shared or mapped memory.
Definition: et_private.h:544
uint64_t usedSize
Desired size of shared memory given as arg to et_mem_create .
Definition: et_private.h:558
uint64_t totalSize
Total size of shared (mapped) memory (must be allocated in pages).
Definition: et_private.h:557
uint32_t byteOrder
Should be 0x01020304, if not, byte order is reversed from local order.
Definition: et_private.h:545
uint32_t minorVersion
Minor version number of this ET software release.
Definition: et_private.h:550
uint32_t numSelectInts
Number of station selection integers per event.
Definition: et_private.h:551
uint64_t headerPosition
Number of bytes past beginning of shared memory that the headers are stored.
Definition: et_private.h:555
uint32_t systemType
Type of local system using the shared memory: ET_SYSTEM_TYPE_C is an ET system written in C,...
Definition: et_private.h:546
uint32_t majorVersion
Major version number of this ET software release.
Definition: et_private.h:549
uint32_t headerByteSize
Total size of a single event's "header" or metadata structure in bytes.
Definition: et_private.h:552
uint64_t eventByteSize
Total size of a single event's data memory in bytes.
Definition: et_private.h:554
uint64_t dataPosition
Number of bytes past beginning of shared memory that the data are stored.
Definition: et_private.h:556
Struct for passing data from system to network threads.
Definition: et_private.h:670
char uname[ET_MAXHOSTNAMELEN]
host obtained with "uname" cmd
Definition: et_private.h:675
et_id * id
system id
Definition: et_private.h:672
et_sys_config * config
system configuration
Definition: et_private.h:673
char * listenaddr
broadcast or multicast address (dot-decimal)
Definition: et_private.h:674
int cast
broad or multicast
Definition: et_private.h:671
Structure holding all configuration parameters used to open an ET system.
Definition: et_private.h:435
int policy
Policy to determine which responding ET system to a broad/ulticast will be chosen as the official res...
Definition: et_private.h:455
codaIpList * bcastaddrs
Linked list of all local subnet broadcast addresses (dot-decimal).
Definition: et_private.h:471
int udpport
Port number for broadcast, multicast & direct UDP communication.
Definition: et_private.h:453
int tcpRecvBufSize
TCP receive buffer size in bytes of socket connecting to ET TCP server.
Definition: et_private.h:461
codaIpAddr * netinfo
Linked list of structs containing all network info.
Definition: et_private.h:470
char interface[ET_IPADDRSTRLEN]
Dot-decimal IP address specifying the network interface.
Definition: et_private.h:469
int debug_default
Default debug output level which may be ET_DEBUG_NONE, ET_DEBUG_SEVERE, ET_DEBUG_ERROR,...
Definition: et_private.h:450
int tcpSendBufSize
TCP send buffer size in bytes of socket connecting to ET TCP server.
Definition: et_private.h:460
int wait
ET_OPEN_WAIT if user wants to wait for ET system to appear, else ET_OPEN_NOWAIT.
Definition: et_private.h:437
int cast
ET_BROADCAST for users to discover host & port # of ET system server by broadcasting,...
Definition: et_private.h:439
int mode
ET_HOST_AS_REMOTE if connection to a local ET system is made as if the client were remote,...
Definition: et_private.h:447
struct timespec timeout
Max time to wait for ET system to appear if wait = ET_OPEN_WAIT.
Definition: et_private.h:463
int serverport
Port number for ET system's TCP server thread.
Definition: et_private.h:454
codaDotDecIpAddrs mcastaddrs
All multicast addresses (dot-decimal).
Definition: et_private.h:472
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:436
int ttl
Multicast ttl value (number of router hops permitted).
Definition: et_private.h:446
int tcpNoDelay
If 0, sockets to system have TCP_NODELAY option off, else on.
Definition: et_private.h:462
char host[ET_MAXHOSTNAMELEN]
Host of ET system which defaults to local host if unset and may be ET_HOST_ANYWHERE for an ET system ...
Definition: et_private.h:464
Structure containing local process info.
Definition: et_private.h:307
int et_status
ET_PROC_ETDEAD if ET system is dead, or ET_PROC_ETOK if ET system is OK.
Definition: et_private.h:316
et_proc_id num
Unique index # of this process.
Definition: et_private.h:308
int status
ET_PROC_OPEN if open or connected to ET system, or ET_PROC_CLOSED if closed/unconnected.
Definition: et_private.h:314
pid_t pid
Unix process id.
Definition: et_private.h:319
pthread_t hmon_thd_id
Heart monitor pthread id.
Definition: et_private.h:321
uint64_t time
Time ET system opened, used to prevent race conditions caused by rapid open and close cycles.
Definition: et_private.h:311
pthread_t hbeat_thd_id
Heartbeat pthread id .
Definition: et_private.h:320
unsigned int heartbeat
Heartbeat periodically incremented to tell ET system it's alive.
Definition: et_private.h:318
et_att_id att[ET_ATTACHMENTS_MAX]
Array in which an element (indexed by the id# of an attachment owned by this process) gives the id# o...
Definition: et_private.h:309
int nattachments
Number of attachments to an ET system in this process.
Definition: et_private.h:313
Structure for holding an ET system's single response to ET client's broad/multicast.
Definition: et_private.h:563
char ** ipaddrs
Array of all IP addresses (dot-decimal string) of host.
Definition: et_private.h:571
uint32_t * addrs
Array of 32bit net byte ordered addresses (1 for each addr).
Definition: et_private.h:570
int addrCount
Number of addresses.
Definition: et_private.h:566
char castIP[ET_IPADDRSTRLEN]
Original broad/multicast IP addr.
Definition: et_private.h:569
int port
ET system's TCP server port.
Definition: et_private.h:564
struct et_response_t * next
Next response in linked list.
Definition: et_private.h:573
char uname[ET_MAXHOSTNAMELEN]
Uname of sending host.
Definition: et_private.h:567
int castType
ET_BROADCAST or ET_MULTICAST (what this is a response to).
Definition: et_private.h:565
char ** bcastaddrs
Array of all broadcast addresses (dot-decimal string) of host.
Definition: et_private.h:572
char canon[ET_MAXHOSTNAMELEN]
Canonical name of sending host.
Definition: et_private.h:568
Structure to hold parameters used to configure a station.
Definition: et_private.h:176
int restore_mode
if process dies, events it read but didn't write can be sent to: 1) station's ouput with ET_STATION_R...
Definition: et_private.h:184
char fname[ET_FUNCNAME_LENGTH]
Name of user-defined event selection routine (for C-based ET system).
Definition: et_private.h:206
char classs[ET_FILENAME_LENGTH]
Name of JAVA class containing method to implement event selection (for Java-based ET system).
Definition: et_private.h:209
int init
ET_STRUCT_OK if structure properly initialized, else ET_STRUCT_NEW.
Definition: et_private.h:177
int user_mode
Number of attachment allowed, ET_STATION_USER_MULTI for any number, or ET_STATION_USER_SINGLE for onl...
Definition: et_private.h:182
int flow_mode
ET_STATION_PARALLEL if station part of a group of stations through which events flow in parallel,...
Definition: et_private.h:179
int cue
For nonblocking stations only, max number of events accepted into input list.
Definition: et_private.h:195
int select[ET_STATION_SELECT_INTS]
Array of ints for use in event selection.
Definition: et_private.h:205
int block_mode
ET_STATION_BLOCKING for accepting every event which meets its condition, or ET_STATION_NONBLOCKING fo...
Definition: et_private.h:190
char lib[ET_FILENAME_LENGTH]
Name of shared library containing user-defined event selection routine (for C-based ET system).
Definition: et_private.h:207
int prescale
For blocking stations only, accept only every Nth normally accepted event.
Definition: et_private.h:193
int select_mode
ET_STATION_SELECT_ALL for accepting every event, ET_STATION_SELECT_MATCH for accepting events whose c...
Definition: et_private.h:196
Structure to hold the current state of a station.
Definition: et_private.h:215
void * lib_handle
Handle for the opened shared library of a user-defined event selection routine.
Definition: et_private.h:225
int pid_create
Process id of process that created the station.
Definition: et_private.h:221
int nattachments
Number of attachments to this station.
Definition: et_private.h:222
int status
Station's state may be ET_STATION_ACTIVE for a station accepting events, ET_STATION_IDLE for a statio...
Definition: et_private.h:216
ET_SELECT_FUNCPTR func
Pointer to user-defined event selection routine.
Definition: et_private.h:226
int att[ET_ATTACHMENTS_MAX]
Array in which the unique id# of an attachment is the index and the value is id# if attached and -1 o...
Definition: et_private.h:223
Structure defining a station.
Definition: et_private.h:275
int waslast
Flag = 1 if this station was last one to receive an event when using the round-robin selection method...
Definition: et_private.h:292
et_stat_config config
Station configuration.
Definition: et_private.h:300
et_stat_data data
Current state of station.
Definition: et_private.h:299
int conductor
Flag to kill conductor thread: when station deleted ET_THREAD_KILL else ET_THREAD_KEEP.
Definition: et_private.h:278
et_stat_id num
Unique id # of station, 0 for first station (GrandCentral), = 1 for next station in mapped memory,...
Definition: et_private.h:276
et_list list_out
Output list - a linked list containing events to be written.
Definition: et_private.h:302
pthread_mutex_t mutex
Pthread mutex used for keeping the linked list of used stations in order for event transfers.
Definition: et_private.h:296
struct et_fix fix
Info to repair station's lists after user crash.
Definition: et_private.h:298
et_stat_id nextparallel
If this station is in a group of parallel stations, this is a "pointer" (actually and index) to the n...
Definition: et_private.h:286
et_list list_in
Input list - a linked list containing events to read.
Definition: et_private.h:301
et_stat_id prevparallel
If this station is in a group of parallel stations, this is a "pointer" (actually an index) to the pr...
Definition: et_private.h:289
char name[ET_STATNAME_LENGTH]
Unique station name.
Definition: et_private.h:295
et_stat_id next
Integer specifying next active or idle station in station chain, (not storing this as a pointer makes...
Definition: et_private.h:280
et_stat_id prev
Previous active or idle station in station chain and for first station this is -1.
Definition: et_private.h:284
Structure containing all info necessary to configure an ET system.
Definition: et_private.h:349
int nprocesses
Max number of local processes allowed to open ET system.
Definition: et_private.h:355
uint64_t event_size
Event size in bytes.
Definition: et_private.h:350
int ntemps
Max number of temporary events allowed (<= nevents).
Definition: et_private.h:353
int groupCount
Number of event groups.
Definition: et_private.h:357
codaDotDecIpAddrs mcastaddrs
All multicast addresses to listen on (dot-decimal).
Definition: et_private.h:371
int nevents
Total # of events.
Definition: et_private.h:352
codaDotDecIpAddrs bcastaddrs
All local subnet broadcast addresses (dot-decimal).
Definition: et_private.h:370
int nattachments
Max number of attachments to stations allowed.
Definition: et_private.h:356
int port
Broad/multicast port # for UDP communication.
Definition: et_private.h:364
int tcpSendBufSize
TCP send buffer size in bytes of socket connecting to ET client.
Definition: et_private.h:366
int groups[ET_EVENT_GROUPS_MAX]
Array in which index is the group number (-1) and value is the number of events in that group (there ...
Definition: et_private.h:358
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:351
int nstations
Max number of stations allowed (including GrandCentral).
Definition: et_private.h:354
int tcpNoDelay
If 0, sockets to clients have TCP_NODELAY option off, else on.
Definition: et_private.h:368
int tcpRecvBufSize
TCP receive buffer size in bytes of socket connecting to ET client.
Definition: et_private.h:367
int serverport
Port # for ET system TCP server thread.
Definition: et_private.h:365
codaNetInfo netinfo
All local network info.
Definition: et_private.h:369
char filename[ET_FILENAME_LENGTH]
Name of the ET system file.
Definition: et_private.h:361
Structure containing all ET system information.
Definition: et_private.h:391
pthread_t tid_srv
ET TCP server thread id.
Definition: et_private.h:425
pthread_t tid_hb
System heartbeat thread id.
Definition: et_private.h:422
pthread_mutex_t stat_mutex
Pthread mutex to protect station data during changes.
Definition: et_private.h:418
pthread_t tid_mul
Id of thread spawning broad/multicast listening threads.
Definition: et_private.h:426
pthread_mutex_t statadd_mutex
Pthread mutex used to add stations one at a time.
Definition: et_private.h:419
int ntemps
Current number of temp events.
Definition: et_private.h:400
pthread_t tid_hm
System heartmonitor thread id.
Definition: et_private.h:423
int udpFd
UDP server's listening socket file descriptor.
Definition: et_private.h:405
unsigned int heartbeat
Heartbeat which periodically increments to indicate ET is alive.
Definition: et_private.h:397
void * pmap
Pointer to mapped mem in ET system's process (used for user-called routines to read/write pointers co...
Definition: et_private.h:415
pthread_t tid_as
System add station thread id.
Definition: et_private.h:424
int nprocesses
Current number of local processes which have opened system.
Definition: et_private.h:401
char host[ET_MAXHOSTNAMELEN]
Host of the ET system.
Definition: et_private.h:427
int nstations
Current number of stations idle or active.
Definition: et_private.h:399
int statDone
Flag to use with statdone condition variable.
Definition: et_private.h:407
int port
TCP server port.
Definition: et_private.h:403
int nselects
Number of selection ints per station (also control ints per event).
Definition: et_private.h:393
int asthread
ET_THREAD_KILL if killing add-station thread, else ET_THREAD_KEEP.
Definition: et_private.h:396
struct et_proc proc[ET_PROCESSES_MAX]
Array of info on processes.
Definition: et_private.h:428
pthread_mutex_t mutex
Pthread mutex to protect system data during changes.
Definition: et_private.h:417
et_sys_config config
Configuration parameters used to create ET system.
Definition: et_private.h:430
et_stat_id stat_head
Index to head of linked list of used stations (not storing this as a pointer makes for an awkward lin...
Definition: et_private.h:408
int bitInfo
Least significant bit = 1 if ET system created by 64 bit executable, and next bit = 1 if ET system is...
Definition: et_private.h:394
int hz
System clock rate in Hz.
Definition: et_private.h:398
pthread_cond_t statdone
Pthread condition variable used to signal end of station creation.
Definition: et_private.h:421
pthread_cond_t statadd
Pthread condition variable used to add new stations.
Definition: et_private.h:420
pid_t mainpid
Unix pid of ET system.
Definition: et_private.h:414
et_stat_id stat_tail
Index to tail of linked list of used stations (not storing this as a pointer makes for an awkward lin...
Definition: et_private.h:411
int statAdd
Flag to use with statadd condition variable.
Definition: et_private.h:406
struct et_attach attach[ET_ATTACHMENTS_MAX]
Array of info on attachments.
Definition: et_private.h:429
int version
Major version number of this ET software release.
Definition: et_private.h:392
int tcpFd
TCP server's listening socket file descriptor.
Definition: et_private.h:404
int nattachments
Current number of attachments to stations in system.
Definition: et_private.h:402