+/*
+ Given a message size and a buffer (assumed to be TP_SZFIELD_LEN or larger)
+ this will put in the size such that it is compatable with old versions
+ of RMR (that expect the message size to not be in network byte order)
+ and with new versions that do. See extract function in mt_call_si_static.c
+ for details on what ends up in the buffer.
+*/
+static inline void insert_mlen( uint32_t len, char* buf ) {
+ uint32_t* blen; // pointer into buffer where we'll add the len
+
+ blen = (uint32_t *) buf; // old systems expect an unconverted integer
+ *blen = len;
+
+ blen++;
+ *blen = htonl( len ); // new systems want a converted integer
+
+ buf[TP_SZFIELD_LEN-1] = TP_SZ_MARKER; // marker to flag this is generated by a new message
+}
+