-static int em_send_failures = 0; // test programme can set this to emulate eagain send failures
-static int em_timeout = -1; // set by set socket option
-
-// ----------- epoll emulation ---------------------------------------------
-
-// CAUTION: sys/epoll.h must be included before this define and function will properly compile.
-#define epoll_wait em_wait
-/*
- Every other call returns 1 ready; alternate calls return 0 ready.
- Mostly for testing the timeout receive call. First call should return
- something ready and the second should return nothing ready so we can
- drive both cases.
-*/
-static int em_wait( int fd, void* events, int n, int to ) {
- static int ready = 0;
-
- ready = !ready;
- return ready;
-}
-
-
-
-/*
- Simulated v1 message for receive to return. This needs to match the RMr header
- so that we can fill in length, type and xaction id things.
-#define MSG_VER 1
-struct em_msg {
- int32_t mtype; // message type ("long" network integer)
- int32_t plen; // payload length
- int32_t rmr_ver; // our internal message version number
- unsigned char xid[32]; // space for user transaction id or somesuch
- unsigned char sid[32]; // sender ID for return to sender needs
- unsigned char src[16]; // name of the sender (source)
- unsigned char meid[32]; // managed element id.
- struct timespec ts; // timestamp ???
-};
-*/
-
-/*
- v2 message; should be able to use it for everything that is set up here as
- we don't add a payload even if setting a v1 type.
-*/
-#define ALT_MSG_VER 1 // alternate every so often
-#define MSG_VER 2 // default version to insert
-struct em_msg {
- int32_t mtype; // message type ("long" network integer)
- int32_t plen; // payload length
- int32_t rmr_ver; // our internal message version number
- unsigned char xid[32]; // space for user transaction id or somesuch
- unsigned char sid[32]; // sender ID for return to sender needs
- unsigned char src[64]; // name of the sender (source)
- unsigned char meid[32]; // managed element id.
- struct timespec ts; // timestamp ???
-
- // V2 extension
- int32_t flags; // HFL_* constants
- int32_t len0; // length of the RMr header data
- int32_t len1; // length of the tracing data
- int32_t len2; // length of data 1 (d1)
- int32_t len3; // length of data 2 (d2)
-
-};
-
-static int return_value = 0;