Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge all public simix headers, and distribute them in simgrid directory
[simgrid.git] / src / gras / Transport / transport_interface.h
1 /* transport - low level communication (send/receive bunches of bytes)      */
2
3 /* module's public interface exported within GRAS, but not to end user.     */
4
5 /* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team.
6  * All rights reserved.                                                     */
7
8 /* This program is free software; you can redistribute it and/or modify it
9  * under the terms of the license (GNU LGPL) which comes with this package. */
10
11 #ifndef GRAS_TRP_INTERFACE_H
12 #define GRAS_TRP_INTERFACE_H
13
14 #include "portable.h"           /* sometimes needed for fd_set */
15 #include "simgrid/simix.h"
16 #include "xbt/queue.h"
17
18 /* Data of this module specific to each process
19  * (used by sg_process.c to cleanup the SG channel cruft)
20  */
21 typedef struct {
22   /* set headers */
23   unsigned int ID;
24   char *name;
25   unsigned int name_len;
26
27   int myport;                   /* Port on which I listen myself */
28
29   xbt_dynar_t sockets;          /* all sockets known to this process */
30
31   /* SG only elements. In RL, they are part of the OS ;) */
32
33   /* List of sockets ready to be select()ed */
34   xbt_queue_t msg_selectable_sockets;   /* regular sockets  */
35   xbt_queue_t meas_selectable_sockets;  /* measurement ones */
36
37 } s_gras_trp_procdata_t, *gras_trp_procdata_t;
38
39 /* Display the content of our socket set (debugging purpose) */
40 XBT_PUBLIC(void) gras_trp_socketset_dump(const char *name);
41
42 XBT_PUBLIC(xbt_socket_t) gras_trp_select(double timeout);
43
44 #endif                          /* GRAS_TRP_INTERFACE_H */