/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <errno.h>
-#include <sys/time.h> /* struct timeval */
-#include <sys/types.h>
-#include <sys/socket.h>
-
+#include "portable.h"
#include "gras/Transport/transport_private.h"
XBT_LOG_EXTERNAL_CATEGORY(transport);
XBT_LOG_DEFAULT_CATEGORY(transport);
-
-
/**
* gras_trp_select:
*
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <netinet/in.h> /* htonl/ntohl */
#include <stdlib.h>
#include <string.h> /* memset */
+#include "portable.h"
#include "xbt/misc.h"
+#include "xbt/sysdep.h"
#include "transport_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(trp_buf,transport,
***/
typedef struct {
- uint32_t size;
+ int size;
char *data;
int pos; /* for receive; not exchanged over the net */
} gras_trp_buf_t;
long int thissize;
if (data->in.size == data->in.pos) { /* out of data. Get more */
- uint32_t nextsize;
+ int nextsize;
DEBUG0("Recv the size");
TRY(super->chunk_recv(sock,(char*)&nextsize, 4));
- data->in.size = ntohl(nextsize);
+ data->in.size = (int)ntohl(nextsize);
VERB1("Recv the chunk (size=%d)",data->in.size);
TRY(super->chunk_recv(sock, data->in.data, data->in.size));
xbt_error_t
gras_trp_buf_flush(gras_socket_t sock) {
xbt_error_t errcode;
- uint32_t size;
+ int size;
gras_trp_plugin_t *super=((gras_trp_buf_plug_data_t*)sock->plugin->data)->super;
gras_trp_bufdata_t *data=sock->bufdata;
XBT_IN;
- size = htonl(data->out.size);
+ size = (int)htonl(data->out.size);
DEBUG1("Send the size (=%d)",data->out.size);
TRY(super->chunk_send(sock,(char*) &size, 4));
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
+#include "portable.h"
#include "transport_private.h"
+#if 0
+# include <errno.h>
+# include <sys/time.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <fcntl.h>
+# include <unistd.h>
+#endif
+
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(trp_file,transport,
"Pseudo-transport to write to/read from a file");
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <unistd.h> /* close() pipe() read() write() */
-#include <signal.h> /* close() pipe() read() write() */
-#include <netinet/in.h> /* sometimes required for #include <arpa/inet.h> */
-#include <netinet/tcp.h> /* TCP_NODELAY */
-#include <arpa/inet.h> /* inet_ntoa() */
-#include <netdb.h> /* getprotobyname() */
-#include <sys/time.h> /* struct timeval */
-#include <errno.h> /* errno */
-#include <sys/wait.h> /* waitpid() */
-#include <sys/socket.h> /* getpeername() socket() */
-#include <stdlib.h>
-#include <string.h> /* memset */
+#include "portable.h"
+
+#if 0
+# include <unistd.h> /* close() pipe() read() write() */
+# include <signal.h> /* close() pipe() read() write() */
+# include <netinet/in.h> /* sometimes required for #include <arpa/inet.h> */
+# include <netinet/tcp.h> /* TCP_NODELAY */
+# include <arpa/inet.h> /* inet_ntoa() */
+# include <netdb.h> /* getprotobyname() */
+# include <sys/time.h> /* struct timeval */
+# include <errno.h> /* errno */
+# include <sys/wait.h> /* waitpid() */
+# include <sys/socket.h> /* getpeername() socket() */
+# include <stdlib.h>
+# include <string.h> /* memset */
+#endif
+
#include "transport_private.h"