/**
* Name of the fifo to use for IPC with the other dummy process.
*/
-#define FIFO_FILE1 "/tmp/test-transport/api-wlan-p1/WLAN_FIFO_in"
+#define FIFO_FILE1 GNUNET_DISK_mktemp("test-transport/api-wlan-p1/") "WLAN_FIFO_in"
/**
* Name of the fifo to use for IPC with the other dummy process.
*/
-#define FIFO_FILE2 "/tmp/test-transport/api-wlan-p1/WLAN_FIFO_out"
+#define FIFO_FILE2 GNUNET_DISK_mktemp("test-transport/api-wlan-p1/") "WLAN_FIFO_out"
/**
* Maximum size of a message allowed in either direction
* type to the output forward and copy it to the buffer for stdout.
*
* @param cls the 'struct SendBuffer' to copy the converted message to
- * @param client unused
* @param hdr inbound message from the FIFO
+ * @return #GNUNET_OK on success,
+ * #GNUNET_NO to stop further processing (no error)
+ * #GNUNET_SYSERR to stop further processing with error
*/
static int
-stdin_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
+stdin_send (void *cls,
+ const struct GNUNET_MessageHeader *hdr)
{
struct SendBuffer *write_pout = cls;
const struct GNUNET_TRANSPORT_WLAN_RadiotapSendMessage *in;
* We read a full message from stdin. Copy it to our send buffer.
*
* @param cls the 'struct SendBuffer' to copy to
- * @param client unused
* @param hdr the message we received to copy to the buffer
+ * @return #GNUNET_OK on success,
+ * #GNUNET_NO to stop further processing (no error)
+ * #GNUNET_SYSERR to stop further processing with error
*/
static int
-file_in_send (void *cls, void *client, const struct GNUNET_MessageHeader *hdr)
+file_in_send (void *cls,
+ const struct GNUNET_MessageHeader *hdr)
{
struct SendBuffer *write_std = cls;
uint16_t sendsize;
fd_set wfds;
struct timeval tv;
int retval;
- struct GNUNET_SERVER_MessageStreamTokenizer *stdin_mst = NULL;
- struct GNUNET_SERVER_MessageStreamTokenizer *file_in_mst = NULL;
+ struct GNUNET_MessageStreamTokenizer *stdin_mst = NULL;
+ struct GNUNET_MessageStreamTokenizer *file_in_mst = NULL;
struct GNUNET_TRANSPORT_WLAN_MacAddress macaddr;
int first;
write_std.pos = 0;
write_pout.size = 0;
write_pout.pos = 0;
- stdin_mst = GNUNET_SERVER_mst_create (&stdin_send, &write_pout);
- file_in_mst = GNUNET_SERVER_mst_create (&file_in_send, &write_std);
+ stdin_mst = GNUNET_MST_create (&stdin_send, &write_pout);
+ file_in_mst = GNUNET_MST_create (&file_in_send, &write_std);
/* Send 'random' mac address */
macaddr.mac[0] = 0x13;
}
else if (0 < readsize)
{
- GNUNET_SERVER_mst_receive (stdin_mst, NULL, readbuf, readsize,
- GNUNET_NO, GNUNET_NO);
+ GNUNET_MST_from_buffer (stdin_mst,
+ readbuf, readsize,
+ GNUNET_NO, GNUNET_NO);
}
else
}
else if (0 < readsize)
{
- GNUNET_SERVER_mst_receive (file_in_mst, NULL, readbuf, readsize,
- GNUNET_NO, GNUNET_NO);
+ GNUNET_MST_from_buffer (file_in_mst,
+ readbuf, readsize,
+ GNUNET_NO, GNUNET_NO);
}
else
{
end:
/* clean up */
if (NULL != stdin_mst)
- GNUNET_SERVER_mst_destroy (stdin_mst);
+ GNUNET_MST_destroy (stdin_mst);
if (NULL != file_in_mst)
- GNUNET_SERVER_mst_destroy (file_in_mst);
+ GNUNET_MST_destroy (file_in_mst);
if (NULL != fpout)
fclose (fpout);