20 #ifndef __et_private_h
21 #define __et_private_h
30 #include "etCommonNetwork.h"
46 #define ET_VERSION_MINOR 4
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
67 #define ET_MON_SEC 120
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
374 #define ET_BIT64_MASK 0x1
376 #define ET_KILL_MASK 0x2
378 #define ET_GET_BIT64(x) ((x) & ET_BIT64_MASK)
380 #define ET_GET_KILL(x) ((x) & ET_KILL_MASK)
382 #define ET_SET_BIT64(x) ((x) | ET_BIT64_MASK)
384 #define ET_SET_KILL(x) ((x) | ET_KILL_MASK)
389 typedef struct et_system_t {
395 unsigned int heartbeat;
413 pthread_mutex_t mutex;
414 pthread_mutex_t stat_mutex;
415 pthread_mutex_t statadd_mutex;
416 pthread_cond_t statadd;
417 pthread_cond_t statdone;
580 #define ET_NET_EV_GET_L 0
581 #define ET_NET_EVS_GET_L 1
582 #define ET_NET_EV_PUT_L 2
583 #define ET_NET_EVS_PUT_L 3
584 #define ET_NET_EV_NEW_L 4
585 #define ET_NET_EVS_NEW_L 5
586 #define ET_NET_EV_DUMP_L 6
587 #define ET_NET_EVS_DUMP_L 7
588 #define ET_NET_EVS_NEW_GRP_L 8
591 #define ET_NET_EV_GET 20
592 #define ET_NET_EVS_GET 21
593 #define ET_NET_EV_PUT 22
594 #define ET_NET_EVS_PUT 23
595 #define ET_NET_EV_NEW 24
596 #define ET_NET_EVS_NEW 25
597 #define ET_NET_EV_DUMP 26
598 #define ET_NET_EVS_DUMP 27
599 #define ET_NET_EVS_NEW_GRP 28
601 #define ET_NET_EVS_NEW_GRP_JAVA 29
603 #define ET_NET_ALIVE 40
604 #define ET_NET_WAIT 41
605 #define ET_NET_CLOSE 42
606 #define ET_NET_FCLOSE 43
607 #define ET_NET_WAKE_ATT 44
608 #define ET_NET_WAKE_ALL 45
609 #define ET_NET_KILL 46
611 #define ET_NET_STAT_ATT 60
612 #define ET_NET_STAT_DET 61
613 #define ET_NET_STAT_CRAT 62
614 #define ET_NET_STAT_RM 63
615 #define ET_NET_STAT_SPOS 64
616 #define ET_NET_STAT_GPOS 65
618 #define ET_NET_STAT_ISAT 80
619 #define ET_NET_STAT_EX 81
620 #define ET_NET_STAT_SSW 82
621 #define ET_NET_STAT_GSW 83
622 #define ET_NET_STAT_LIB 84
623 #define ET_NET_STAT_FUNC 85
624 #define ET_NET_STAT_CLASS 86
626 #define ET_NET_STAT_GATTS 100
627 #define ET_NET_STAT_STATUS 101
628 #define ET_NET_STAT_INCNT 102
629 #define ET_NET_STAT_OUTCNT 103
630 #define ET_NET_STAT_GBLOCK 104
631 #define ET_NET_STAT_GUSER 105
632 #define ET_NET_STAT_GRESTORE 106
633 #define ET_NET_STAT_GPRE 107
634 #define ET_NET_STAT_GCUE 108
635 #define ET_NET_STAT_GSELECT 109
637 #define ET_NET_STAT_SBLOCK 115
638 #define ET_NET_STAT_SUSER 116
639 #define ET_NET_STAT_SRESTORE 117
640 #define ET_NET_STAT_SPRE 118
641 #define ET_NET_STAT_SCUE 119
643 #define ET_NET_ATT_PUT 130
644 #define ET_NET_ATT_GET 131
645 #define ET_NET_ATT_DUMP 132
646 #define ET_NET_ATT_MAKE 133
648 #define ET_NET_SYS_TMP 150
649 #define ET_NET_SYS_TMPMAX 151
650 #define ET_NET_SYS_STAT 152
651 #define ET_NET_SYS_STATMAX 153
652 #define ET_NET_SYS_PROC 154
653 #define ET_NET_SYS_PROCMAX 155
654 #define ET_NET_SYS_ATT 156
655 #define ET_NET_SYS_ATTMAX 157
656 #define ET_NET_SYS_HBEAT 158
657 #define ET_NET_SYS_PID 159
658 #define ET_NET_SYS_GRP 160
660 #define ET_NET_SYS_DATA 170
661 #define ET_NET_SYS_HIST 171
662 #define ET_NET_SYS_GRPS 172
666 typedef struct et_netthread_t {
691 struct timespec timeout_from;
692 struct timespec timeout_to;
703 #define ET_P2EVENT(etid, place) ((et_event *)((et_event *)(etid->events) + (place)))
708 #define ET_PEVENT2USR(p, offset) ((et_event *)((char *)(p) + (offset)))
710 #define ET_PEVENT2ET(p, offset) ((et_event *)((char *)(p) - (offset)))
713 #define ET_PSTAT2USR(p, offset) ((et_station *)((char *)(p) + (offset)))
715 #define ET_PSTAT2ET(p, offset) ((et_station *)((char *)(p) - (offset)))
718 #define ET_PDATA2USR(p, offset) ((void *)((char *)(p) + (offset)))
720 #define ET_PDATA2ET(p, offset) ((void *)((char *)(p) - (offset)))
726 #define ET_64BIT_UINT(hi,lo) (((uint64_t)(hi) << 32) | ((uint64_t)(lo) & 0x00000000FFFFFFFF))
730 #define ET_64BIT_INT(hi,lo) (((int64_t)(hi) << 32) | ((int64_t)(lo) & 0x00000000FFFFFFFF))
734 #define ET_64BIT_P(hi,lo) ((void *)(((uint64_t)(hi) << 32) | ((uint64_t)(lo) & 0x00000000FFFFFFFF)))
737 #define ET_HIGHINT(i) ((uint32_t)(((uint64_t)(i) >> 32) & 0x00000000FFFFFFFF))
740 #define ET_LOWINT(i) ((uint32_t)((uint64_t)(i) & 0x00000000FFFFFFFF))
798 int _mode,
et_att_id att,
struct timespec *time);
800 et_att_id att,
struct timespec *time,
int num,
int *nread);
802 et_att_id att,
struct timespec *time,
int num,
int group,
int *nread);
814 extern int et_mem_create(
const char *name,
size_t memsize,
void **pmemory,
size_t *totalSize);
816 uint32_t headerByteSize, uint64_t eventByteSize,
817 uint64_t headerPosition, uint64_t dataPosition,
818 uint64_t totalByteSize, uint64_t usedByteSize);
822 extern int et_mem_size(
const char *name,
size_t *totalsize,
size_t *usedsize);
826 extern int et_temp_remove(
const char *name,
void *pmem,
size_t size);
830 int mode,
struct timespec *deltatime,
size_t size);
832 int mode,
struct timespec *deltatime,
size_t size,
int num,
int *nread);
834 int mode,
struct timespec *deltatime,
835 size_t size,
int num,
int group,
int *nread);
837 int wait,
struct timespec *deltatime);
839 int wait,
struct timespec *deltatime,
int num,
int *nread);
856 int position,
int parallelposition);
863 int parallelposition);
865 int *parallelposition);
924 int mode,
struct timespec *deltatime,
size_t size);
926 int mode,
struct timespec *deltatime,
size_t size,
int num,
int *nread);
928 int mode,
struct timespec *deltatime,
929 size_t size,
int num,
int group,
int *nread);
931 int mode,
struct timespec *deltatime);
933 int mode,
struct timespec *deltatime,
int num,
int *nread);
956 extern int et_findserver(
const char *etname,
char *ethost,
int *port,
971 extern void et_logmsg (
char *sev,
char *fmt, ...);
int tcpNoDelay
If 0, sockets to system have TCP_NODELAY option off, else on.
Definition: et_private.h:468
int etr_system_getgroupcount(et_sys_id id, int *groupCnt)
Definition: et_remote.c:1557
char host[ET_MAXHOSTNAMELEN]
Host running process that owns attachment.
Definition: et_private.h:341
uint32_t headerByteSize
Total size of a single event's "header" or metadata structure in bytes.
Definition: et_private.h:558
codaDotDecIpAddrs bcastaddrs
All local subnet broadcast addresses (dot-decimal).
Definition: et_private.h:368
et_stat_config config
Station configuration.
Definition: et_private.h:300
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
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 et_look(et_sys_id *id, const char *filename)
uint64_t events_out
Number of events actually taken out.
Definition: et_private.h:236
int(* ET_SWAP_FUNCPTR)(et_event *, et_event *, int, int)
Used to define a data-swapping function.
Definition: et.h:347
int cast
ET_BROADCAST for users to discover host & port # of ET system server by broadcasting, ET_MULTICAST for users to discover host & port # of ET system server by multicasting, ET_BROADANDMULTICAST for users to discover host & port # of ET system server by both broad and multicasting, or ET_DIRECT when users specify host & TCP port # of ET system.
Definition: et_private.h:445
int ttl
Multicast ttl value (number of router hops permitted).
Definition: et_private.h:452
int cnt
Number of events in list.
Definition: et_private.h:232
int port
Port number for ET TCP server.
Definition: et_private.h:529
int init
ET_STRUCT_OK if structure properly initialized, else ET_STRUCT_NEW.
Definition: et_private.h:177
int etr_attach_geteventsdump(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1632
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:498
int etr_station_getoutputcount(et_sys_id id, et_stat_id stat_id, int *cnt)
Definition: et_remote.c:1274
int etr_station_getselect(et_sys_id id, et_stat_id stat_id, int *select)
Definition: et_remote.c:1314
int etr_events_put(et_sys_id id, et_att_id att, et_event *evs[], int num)
Definition: et_remote.c:2938
int et_stat_id
ET station id.
Definition: et.h:355
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
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)
Structure containing all info necessary to configure an ET system.
Definition: et_private.h:347
uint32_t * addrs
Array of 32bit net byte ordered addresses (1 for each addr).
Definition: et_private.h:576
char localAddr[ET_IPADDRSTRLEN]
Local dot-decimal address of socket connection to ET.
Definition: et_private.h:531
char ** bcastaddrs
Array of all broadcast addresses (dot-decimal string) of host.
Definition: et_private.h:578
int etr_station_getprescale(et_sys_id id, et_stat_id stat_id, int *prescale)
Definition: et_remote.c:1334
pthread_mutex_t mutex
Pthread mutex for thread-safe remote communications.
Definition: et_private.h:541
#define ET_EVENT_GROUPS_MAX
Default max number of groups events are divided into.
Definition: et.h:60
#define ET_FUNCNAME_LENGTH
Max length of user's event selection func name + 1.
Definition: et.h:94
int etn_event_dump(et_sys_id id, et_att_id att, et_event *ev)
struct et_open_config_t et_open_config
Structure holding all configuration parameters used to open an ET system.
void et_init_event(et_event *pe)
int et_findserver(const char *etname, char *ethost, int *port, uint32_t *inetaddr, et_open_config *config, et_response **allETinfo, int debug)
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:521
int etr_alive(et_sys_id id)
Definition: et_remote.c:463
int etn_events_dump(et_sys_id id, et_att_id att, et_event *evs[], int num)
struct et_list_t et_list
Structure defining a station's input or output list of events.
int etr_station_isattached(et_sys_id id, et_stat_id stat_id, et_att_id att)
Definition: et_remote.c:899
int etl_alive(et_sys_id id)
int castType
ET_BROADCAST or ET_MULTICAST (what this is a response to).
Definition: et_private.h:571
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:493
Structure containing local process info.
Definition: et_private.h:307
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
int etr_system_getstations(et_sys_id id, int *stations)
Definition: et_remote.c:1477
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 block_mode
ET_STATION_BLOCKING for accepting every event which meets its condition, or ET_STATION_NONBLOCKING fo...
Definition: et_private.h:190
#define ET_STATNAME_LENGTH
Max length of station name + 1.
Definition: et.h:95
et_att_id num
Unique index # of this attachment.
Definition: et_private.h:325
#define ET_ATTACHMENTS_MAX
Maximum number of attachments allowed on the system.
Definition: et_private.h:108
void et_flush_events(et_id *id, et_att_id att, et_stat_id stat_id)
uint64_t eventsin
Value of et_list->events_in at start of dump.
Definition: et_private.h:250
void * et_openconfig
ET open configuration.
Definition: et.h:353
struct timespec timeout
Max time to wait for ET system to appear if wait = ET_OPEN_WAIT.
Definition: et_private.h:469
void * et_statconfig
ET station configuration.
Definition: et.h:351
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 etn_event_new(et_sys_id id, et_att_id att, et_event **ev, int mode, struct timespec *deltatime, size_t size)
int groupCount
Number of event groups.
Definition: et_private.h:355
struct et_sys_config_t et_sys_config
Structure containing all info necessary to configure an ET system.
uint64_t eventByteSize
Total size of a single event's data memory in bytes.
Definition: et_private.h:560
int nevents
Total # of events.
Definition: et_private.h:350
char * data
Pointer to start of event data in shared memory.
Definition: et_private.h:539
int et_status
ET_PROC_ETDEAD if ET system is dead, or ET_PROC_ETOK if ET system is OK.
Definition: et_private.h:314
void et_mem_unlock(et_id *id)
Structure containing info stored at front of shared or mapped memory.
Definition: et_private.h:550
et_event * lastevent
pointer to last event in linked list.
Definition: et_private.h:238
int etr_station_getinputcount(et_sys_id id, et_stat_id stat_id, int *cnt)
Definition: et_remote.c:1264
uint32_t byteOrder
Should be 0x01020304, if not, byte order is reversed from local order.
Definition: et_private.h:551
int et_repair_gc(et_id *id)
int et_mem_size(const char *name, size_t *totalsize, size_t *usedsize)
char ** ipaddrs
Array of all IP addresses (dot-decimal string) of host.
Definition: et_private.h:577
int etr_system_getheartbeat(et_sys_id id, int *heartbeat)
Definition: et_remote.c:1537
void et_init_event_(et_event *pe)
#define ET_IPADDRSTRLEN
Max string length of dotted-decimal ip address.
Definition: et_private.h:55
int etr_station_remove(et_sys_id id, et_stat_id stat_id)
Definition: et_remote.c:671
int start
Is 1 at start of write and 0 at end.
Definition: et_private.h:251
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:470
int etn_event_get(et_sys_id id, et_att_id att, et_event **ev, int mode, struct timespec *deltatime)
struct et_fixout out
Structure to fix station output list.
Definition: et_private.h:270
int etn_alive(et_sys_id id)
uint64_t esize
Size in bytes of events in ET system.
Definition: et_private.h:516
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 et_unlook(et_sys_id id)
uint64_t events_in
Number of events actually put in.
Definition: et_private.h:235
int nattachments
Max number of attachments to stations allowed.
Definition: et_private.h:354
void et_memWrite_lock(et_id *id)
int etr_station_setrestore(et_sys_id id, et_stat_id stat_id, int restore)
Definition: et_remote.c:1394
int etr_kill(et_sys_id id)
Definition: et_remote.c:438
int et_proc_id
ET process id.
Definition: et.h:356
uint32_t majorVersion
Major version number of this ET software release.
Definition: et_private.h:555
int closed
Has et_close been called? 1 = yes, 0 = no.
Definition: et_private.h:491
int status
ET_PROC_OPEN if open or connected to ET system, or ET_PROC_CLOSED if closed/unconnected.
Definition: et_private.h:312
int etn_open(et_sys_id *id, const char *filename, et_openconfig openconfig)
struct et_stat_data_t et_stat_data
Structure to hold the current state of a station.
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)
int etr_station_detach(et_sys_id id, et_att_id att)
Definition: et_remote.c:786
int etr_system_gettemps(et_sys_id id, int *temps)
Definition: et_remote.c:1457
int etn_kill(et_sys_id id)
int et_station_ndump(et_id *id, et_event *pe[], int num)
int etr_wait_for_alive(et_sys_id id)
Definition: et_remote.c:502
int etr_station_attach(et_sys_id id, et_stat_id stat_id, et_att_id *att)
Definition: et_remote.c:703
pthread_mutex_t mutex
Pthread mutex which protects linked list when reading & writing.
Definition: et_private.h:239
pthread_cond_t cread
Pthread condition variable to notify reader that events are here.
Definition: et_private.h:240
int etr_close(et_sys_id id)
Definition: et_remote.c:390
#define ET_PROCESSES_MAX
Maximum number of local processes allowed to open the system.
Definition: et_private.h:109
int etr_system_getprocsmax(et_sys_id id, int *procsmax)
Definition: et_remote.c:1507
int et_llist_read(et_list *pl, et_event **pe)
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:527
Structure holding all configuration parameters used to open an ET system.
Definition: et_private.h:441
int port
ET system's TCP server port.
Definition: et_private.h:570
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_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
int etr_wakeup_all(et_sys_id id, et_stat_id stat_id)
Definition: et_remote.c:552
int etr_station_setprescale(et_sys_id id, et_stat_id stat_id, int prescale)
Definition: et_remote.c:1402
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)
pid_t pid
Unix process id.
Definition: et_private.h:317
struct et_id_t et_id
Structure defining an ET system user id (one needed for each system in use) which contains pointers t...
uint64_t headerPosition
Number of bytes past beginning of shared memory that the headers are stored.
Definition: et_private.h:561
int et_station_write(et_id *id, et_stat_id stat_id, et_event *pe)
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:760
int et_station_nwrite(et_id *id, et_stat_id stat_id, et_event *pe[], int num)
uint64_t events_dump
Number of events dumped back into GrandCentral's input list (recycles).
Definition: et_private.h:338
void et_llist_unlock(et_list *pl)
et_proc_id num
Unique index # of this process.
Definition: et_private.h:308
int et_repair_station(et_id *id, et_stat_id stat_id)
unsigned int heartbeat
Heartbeat periodically incremented to tell ET system it's alive.
Definition: et_private.h:316
int group
Default event group for calls to et_event_new and et_events_new.
Definition: et_private.h:508
char canon[ET_MAXHOSTNAMELEN]
Canonical name of sending host.
Definition: et_private.h:574
int etn_close(et_sys_id id)
int alive
Is system alive? 1 = yes, 0 = no.
Definition: et_private.h:490
Struct to fix station's input and output linked lists after crash.
Definition: et_private.h:268
int et_mem_create(const char *name, size_t memsize, void **pmemory, size_t *totalSize)
int sleep
ET_ATT_SLEEP if attachment is remote and sleeping when getting events (sleep is simulated by multiple...
Definition: et_private.h:332
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:349
void et_station_lock(et_system *sys)
void et_init_station(et_station *ps)
int pid_create
Process id of process that created the station.
Definition: et_private.h:221
struct et_response_t * next
Next response in linked list.
Definition: et_private.h:579
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_forcedclose(et_sys_id id)
struct et_system_t et_system
Structure containing all ET system information.
struct et_mem_t et_mem
Structure containing info stored at front of shared or mapped memory.
int etr_station_getblock(et_sys_id id, et_stat_id stat_id, int *block)
Definition: et_remote.c:1284
Structure for fixing station output list.
Definition: et_private.h:260
int etr_station_getfunction(et_sys_id id, et_stat_id stat_id, char *function)
Definition: et_remote.c:1156
Structure defining a station's input or output list of events.
Definition: et_private.h:231
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:514
void et_memRead_lock(et_id *id)
int etr_station_getrestore(et_sys_id id, et_stat_id stat_id, int *restore)
Definition: et_remote.c:1304
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:453
int etl_open(et_sys_id *id, const char *filename, et_openconfig openconfig)
int serverport
Port number for ET system's TCP server thread.
Definition: et_private.h:460
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
struct et_netthread_t et_netthread
Struct for passing data from system to network threads.
int etr_open(et_sys_id *id, const char *et_filename, et_openconfig openconfig)
Definition: et_remote.c:37
int etr_station_setcue(et_sys_id id, et_stat_id stat_id, int cue)
Definition: et_remote.c:1410
int etr_attach_geteventsmake(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1644
uint64_t usedSize
Desired size of shared memory given as arg to et_mem_create .
Definition: et_private.h:564
char interface[ET_IPADDRSTRLEN]
Dot-decimal IP address specifying the network interface.
Definition: et_private.h:475
uint64_t event_size
Event size in bytes.
Definition: et_private.h:348
char castIP[ET_IPADDRSTRLEN]
Original broad/multicast IP addr.
Definition: et_private.h:575
int etn_events_put(et_sys_id id, et_att_id att, et_event *evs[], int num)
int etn_event_put(et_sys_id id, et_att_id att, et_event *ev)
int nprocesses
Max number of local processes allowed to open ET system.
Definition: et_private.h:353
int addrCount
Number of addresses.
Definition: et_private.h:572
void et_init_stats_station(et_station *ps)
int race
Flag used to eliminate race conditions.
Definition: et_private.h:497
int etr_event_get(et_sys_id id, et_att_id att, et_event **ev, int mode, struct timespec *deltatime)
Definition: et_remote.c:2397
codaDotDecIpAddrs mcastaddrs
All multicast addresses (dot-decimal).
Definition: et_private.h:478
uint64_t events_put
Number of events put into station output list.
Definition: et_private.h:336
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:552
et_event * events
Pointer to start of et_event structures in shared memory.
Definition: et_private.h:538
pthread_t hmon_thd_id
Heart monitor pthread id.
Definition: et_private.h:319
int etr_station_exists(et_sys_id id, et_stat_id *stat_id, const char *stat_name)
Definition: et_remote.c:931
void * et_temp_attach(const char *name, size_t size)
int etr_events_get(et_sys_id id, et_att_id att, et_event *evs[], int mode, struct timespec *deltatime, int num, int *nread)
Definition: et_remote.c:2593
int prescale
For blocking stations only, accept only every Nth normally accepted event.
Definition: et_private.h:193
et_station * stats
Pointer to start of et_station structures in shared memory.
Definition: et_private.h:536
int status
ET_ATT_UNUSED is attachment unused or ET_ATT_ACTIVE if active.
Definition: et_private.h:328
int ntemps
Max number of temporary events allowed (<= nevents).
Definition: et_private.h:351
codaNetInfo netinfo
All local network info.
Definition: et_private.h:367
int endian
Endianness of client's node ET_ENDIAN_BIG or ET_ENDIAN_LITTLE.
Definition: et_private.h:525
void et_init_histogram(et_id *id)
int nevents
Total number of events in ET system.
Definition: et_private.h:507
int cnt
Value of et_list->cnt at start of read/write.
Definition: et_private.h:252
void * pmap
Pointer to start of shared (mapped) memory.
Definition: et_private.h:534
int etr_attach_geteventsget(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1620
int etr_station_getattachments(et_sys_id id, et_stat_id stat_id, int *numatts)
Definition: et_remote.c:1244
int etr_station_getcue(et_sys_id id, et_stat_id stat_id, int *cue)
Definition: et_remote.c:1324
void et_transfer_lock(et_station *ps)
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:487
Structure defining an ET system user id (one needed for each system in use) which contains pointers t...
Definition: et_private.h:486
void et_llist_lock(et_list *pl)
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
int etl_close(et_sys_id id)
char name[ET_STATNAME_LENGTH]
Unique station name.
Definition: et_private.h:295
int tcpRecvBufSize
TCP receive buffer size in bytes of socket connecting to ET TCP server.
Definition: et_private.h:467
int start
Is 1 at start of write and 0 at end.
Definition: et_private.h:261
int(* ET_SELECT_FUNCPTR)(void *, et_stat_id, et_event *)
Defines event selection function.
Definition: et_private.h:172
int tcpSendBufSize
TCP send buffer size in bytes of socket connecting to ET TCP server.
Definition: et_private.h:466
codaDotDecIpAddrs mcastaddrs
All multicast addresses to listen on (dot-decimal).
Definition: et_private.h:369
int lang
Language this ET system was written in: ET_LANG_C, ET_LANG_CPP, or ET_LANG_JAVA.
Definition: et_private.h:488
et_list list_in
Input list - a linked list containing events to read.
Definition: et_private.h:301
int blocked
ET_ATT_BLOCKED if blocked waiting to read events, else ET_ATT_UNBLOCKED.
Definition: et_private.h:329
int etl_kill(et_sys_id id)
int version
Major version number of this ET software release.
Definition: et_private.h:509
et_proc_id proc
Unique index # of process owning this attachment.
Definition: et_private.h:326
int policy
Policy to determine which responding ET system to a broad/ulticast will be chosen as the official res...
Definition: et_private.h:461
int et_att_id
ET attachment id.
Definition: et.h:357
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)
void et_init_stats_att(et_system *sys, et_att_id id)
et_stat_id prev
Previous active or idle station in station chain and for first station this is -1.
Definition: et_private.h:284
ET_SWAP_FUNCPTR func
Pointer to function which takes a pointer to an event as an argument, swaps the data, and returns ET_ERROR if there's a problem & ET_OK if not.
Definition: et_private.h:703
int lasthigh
Place in list of last high priority event.
Definition: et_private.h:233
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 * histogram
Pointer to histogram data in shared memory.
Definition: et_private.h:537
Structure for fixing station input list.
Definition: et_private.h:248
int wait
ET_OPEN_WAIT if user wants to wait for ET system to appear, else ET_OPEN_NOWAIT.
Definition: et_private.h:443
int et_mutex_locked(pthread_mutex_t *pmutex)
et_stat_data data
Current state of station.
Definition: et_private.h:299
int et_mem_attach(const char *name, void **pmemory, et_mem *pInfo)
int etr_event_dump(et_sys_id id, et_att_id att, et_event *ev)
Definition: et_remote.c:3104
uint32_t numSelectInts
Number of station selection integers per event.
Definition: et_private.h:557
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
void et_init_stats_all(et_id *id)
int nselects
Number of selection ints per station (or control ints per event).
Definition: et_private.h:510
int etr_events_dump(et_sys_id id, et_att_id att, et_event *evs[], int num)
Definition: et_remote.c:3148
int cue
For nonblocking stations only, max number of events accepted into input list.
Definition: et_private.h:195
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
void et_station_unlock(et_system *sys)
int quit
ET_ATT_QUIT to force return from ET API routine, else ET_ATT_CONTINUE if everything OK...
Definition: et_private.h:330
int tcpNoDelay
If 0, sockets to clients have TCP_NODELAY option off, else on.
Definition: et_private.h:366
int etr_system_getprocs(et_sys_id id, int *procs)
Definition: et_remote.c:1497
struct et_station_t et_station
Structure defining a station.
int sockfd
File descriptor of client's TCP socket connection to ET server.
Definition: et_private.h:524
Structure for holding an ET system's single response to ET client's broad/multicast.
Definition: et_private.h:569
void et_init_process(et_system *sys, et_proc_id id)
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:875
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 etn_wait_for_alive(et_sys_id id)
int serverport
Port # for ET system TCP server thread.
Definition: et_private.h:363
Structure containing attachment info.
Definition: et_private.h:324
int et_temp_remove(const char *name, void *pmem, size_t size)
int tcpRecvBufSize
TCP receive buffer size in bytes of socket connecting to ET client.
Definition: et_private.h:365
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:442
et_station * grandcentral
Pointer to grandcentral station in shared memory.
Definition: et_private.h:540
int etr_wakeup_attachment(et_sys_id id, et_att_id att)
Definition: et_remote.c:530
struct et_response_t et_response
Structure for holding an ET system's single response to ET client's broad/multicast.
void et_transfer_unlock(et_station *ps)
struct et_stat_config_t et_stat_config
Structure to hold parameters used to configure a station.
int et_mem_remove(const char *name, void *pmem)
int num
Number of events intended to read/write.
Definition: et_private.h:263
int etr_system_getstationsmax(et_sys_id id, int *stationsmax)
Definition: et_remote.c:1487
codaIpList * bcastaddrs
Linked list of all local subnet broadcast addresses (dot-decimal).
Definition: et_private.h:477
char interface[ET_IPADDRSTRLEN]
Dot-decimal IP address of outgoing network interface.
Definition: et_private.h:342
int et_responds(const char *etname)
int etr_station_getposition(et_sys_id id, et_stat_id stat_id, int *position, int *parallelposition)
Definition: et_remote.c:853
int cnt
Value of et_list->cnt at start of read/write.
Definition: et_private.h:262
#define ET_STATION_SELECT_INTS
Number of control integers associated with each station.
Definition: et.h:69
int tcpSendBufSize
TCP send buffer size in bytes of socket connecting to ET client.
Definition: et_private.h:364
int etr_station_setuser(et_sys_id id, et_stat_id stat_id, int user)
Definition: et_remote.c:1386
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
uint64_t dataPosition
Number of bytes past beginning of shared memory that the data are stored.
Definition: et_private.h:562
int conductor
Flag to kill conductor thread: when station deleted ET_THREAD_KILL else ET_THREAD_KEEP.
Definition: et_private.h:278
int select[ET_STATION_SELECT_INTS]
Array of ints for use in event selection.
Definition: et_private.h:205
#define ET_MAXHOSTNAMELEN
Max length of a host name including the terminating char.
Definition: et_private.h:58
void et_init_stats_allatts(et_system *sys)
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
void et_logmsg(char *sev, char *fmt,...)
Definition: et_common.c:35
int et_wait_for_system(et_sys_id id, struct timespec *timeout, const char *etname)
void et_init_stats_allstations(et_id *id)
int et_llist_write_gc(et_id *id, et_event **pe, int num)
int nstations
Max number of stations allowed (including GrandCentral).
Definition: et_private.h:352
ET_SELECT_FUNCPTR func
Pointer to user-defined event selection routine.
Definition: et_private.h:226
int etr_station_getlib(et_sys_id id, et_stat_id stat_id, char *lib)
Definition: et_remote.c:1062
int et_station_dump(et_id *id, et_event *pe)
void * lib_handle
Handle for the opened shared library of a user-defined event selection routine.
Definition: et_private.h:225
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 etr_station_setposition(et_sys_id id, et_stat_id stat_id, int position, int parallelposition)
Definition: et_remote.c:818
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
#define ET_FILENAME_LENGTH
Max length of ET system file name + 1.
Definition: et.h:93
int port
Broad/multicast port # for UDP communication.
Definition: et_private.h:362
int chunk_to
Number of new events to get from the "to" ET system at one time.
Definition: et_private.h:700
int et_llist_write(et_id *id, et_list *pl, et_event **pe, int num)
int etr_station_getselectwords(et_sys_id id, et_stat_id stat_id, int select[])
Definition: et_remote.c:1022
void et_init_attachment(et_system *sys, et_att_id id)
int udpport
Port number for broadcast, multicast & direct UDP communication.
Definition: et_private.h:459
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
pthread_rwlock_t sharedMemlock
Pthread read-write lock for preventing access of unmapped memory after calling et_close.
Definition: et_private.h:543
int debug
Level of desired printed debug output which may be ET_DEBUG_NONE, ET_DEBUG_SEVERE, ET_DEBUG_ERROR, ET_DEBUG_WARN, or ET_DEBUG_INFO.
Definition: et_private.h:504
int nattachments
Number of attachments to an ET system in this process.
Definition: et_private.h:311
int et_restore_events(et_id *id, et_att_id att, et_stat_id stat_id)
int etr_station_setblock(et_sys_id id, et_stat_id stat_id, int block)
Definition: et_remote.c:1378
int debug_default
Default debug output level which may be ET_DEBUG_NONE, ET_DEBUG_SEVERE, ET_DEBUG_ERROR, ET_DEBUG_WARN, or ET_DEBUG_INFO.
Definition: et_private.h:456
et_list list_out
Output list - a linked list containing events to be written.
Definition: et_private.h:302
int etr_station_getstatus(et_sys_id id, et_stat_id stat_id, int *status)
Definition: et_remote.c:1254
pid_t pid
Unix process id# of process that owns attachment.
Definition: et_private.h:340
char fname[ET_FUNCNAME_LENGTH]
Name of user-defined event selection routine (for C-based ET system).
Definition: et_private.h:206
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
pthread_t hbeat_thd_id
Heartbeat pthread id .
Definition: et_private.h:318
et_system * sys
Pointer to et_system structure in shared memory.
Definition: et_private.h:535
int nattachments
Number of attachments to this station.
Definition: et_private.h:222
void et_system_lock(et_system *sys)
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:697
et_event * first
Value of et_list->firstevent at start of read (NULL if no damage).
Definition: et_private.h:249
void * et_netserver(void *arg)
void et_init_llist(et_list *pl)
char filename[ET_FILENAME_LENGTH]
Name of the ET system file.
Definition: et_private.h:359
int et_station_read(et_id *id, et_stat_id stat_id, et_event **pe, int _mode, et_att_id att, struct timespec *time)
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:356
void et_system_unlock(et_system *sys)
void * et_cast_thread(void *arg)
Structure defining a station.
Definition: et_private.h:275
void et_transfer_unlock_all(et_id *id)
Structure to define configuration parameters used to bridge ET systems (transfer events between 2 sys...
Definition: et_private.h:693
struct et_bridge_config_t et_bridge_config
Structure to define configuration parameters used to bridge ET systems (transfer events between 2 sys...
int mode_from
ET_SLEEP, ET_TIMED, or ET_ASYNC for getting events from the "from" ET system.
Definition: et_private.h:695
This structure defines an Event which exists in shared memory, holds data, and gets passed from stati...
Definition: et.h:305
int etr_forcedclose(et_sys_id id)
Definition: et_remote.c:414
char ethost[ET_MAXHOSTNAMELEN]
Host of the ET system.
Definition: et_private.h:530
int etr_system_getpid(et_sys_id id, int *pid)
Definition: et_remote.c:1547
void et_tcp_lock(et_id *id)
codaIpAddr * netinfo
Linked list of structs containing all network info.
Definition: et_private.h:476
int etl_forcedclose(et_sys_id id)
Structure containing all ET system information.
Definition: et_private.h:399
char uname[ET_MAXHOSTNAMELEN]
Uname of sending host.
Definition: et_private.h:573
int share
ET_MUTEX_SHARE if operating system can share mutexes between local processes, or ET_MUTEX_NOSHARE for...
Definition: et_private.h:511
et_event * firstevent
Pointer to first event in linked list.
Definition: et_private.h:237
int etr_system_gettempsmax(et_sys_id id, int *tempsmax)
Definition: et_remote.c:1467
uint64_t totalSize
Total size of shared (mapped) memory (must be allocated in pages).
Definition: et_private.h:563
int etr_attach_geteventsput(et_sys_id id, et_att_id att_id, uint64_t *events)
Definition: et_remote.c:1608
Structure to hold parameters used to configure a station.
Definition: et_private.h:176
uint64_t events_get
Number of events obtained from station input list.
Definition: et_private.h:337
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:517
struct et_fixin in
Structure to fix station input list.
Definition: et_private.h:269
int et_mem_unmap(const char *name, void *pmem)
int etr_event_put(et_sys_id id, et_att_id att, et_event *ev)
Definition: et_remote.c:2848
struct et_fix fix
Info to repair station's lists after user crash.
Definition: et_private.h:298
void et_transfer_lock_all(et_id *id)
int num
Number of events intended to read/write.
Definition: et_private.h:253
uint64_t events_try
Number of events attempted to be put in (before prescale).
Definition: et_private.h:234
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
int etl_wait_for_alive(et_sys_id id)
int etr_station_setselectwords(et_sys_id id, et_stat_id stat_id, int select[])
Definition: et_remote.c:987
int bit64
1 if the ET system is a 64 bit executable, else 0.
Definition: et_private.h:492
int chunk_from
Number of events to get from the "from" ET system at one time.
Definition: et_private.h:699
void et_id_destroy(et_sys_id id)
void * et_temp_create(const char *name, size_t size)
Structure to hold the current state of a station.
Definition: et_private.h:215
int etr_station_getclass(et_sys_id id, et_stat_id stat_id, char *classs)
Definition: et_remote.c:1109
uint64_t events_make
Number of new events requested.
Definition: et_private.h:339
int systemendian
Endianness of ET system's node ET_ENDIAN_BIG or ET_ENDIAN_LITTLE.
Definition: et_private.h:526
int et_id_init(et_sys_id *id)
int etr_system_getattachments(et_sys_id id, int *atts)
Definition: et_remote.c:1517
int etr_system_getattsmax(et_sys_id id, int *attsmax)
Definition: et_remote.c:1527
void et_tcp_unlock(et_id *id)
int etr_station_getuser(et_sys_id id, et_stat_id stat_id, int *user)
Definition: et_remote.c:1294
int init
ET_STRUCT_OK if structure initialized, else ET_STRUCT_NEW.
Definition: et_private.h:694
uint32_t minorVersion
Minor version number of this ET software release.
Definition: et_private.h:556
et_stat_id stat
Unique index # of station we're attached to.
Definition: et_private.h:327
void * et_sys_id
ET system id.
Definition: et.h:350
int etn_events_get(et_sys_id id, et_att_id att, et_event *evs[], int mode, struct timespec *deltatime, int num, int *nread)