Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sockets is now part of the process data
[simgrid.git] / src / gras / Transport / transport_private.h
1 /* $Id$ */
2
3 /* transport - low level communication (send/receive bunches of bytes)      */
4
5 /* module's private interface masked even to other parts of GRAS.           */
6
7 /* Authors: Martin Quinson                                                  */
8 /* Copyright (C) 2004 Martin Quinson.                                       */
9
10 /* This program is free software; you can redistribute it and/or modify it
11    under the terms of the license (GNU LGPL) which comes with this package. */
12
13 #ifndef GRAS_TRP_PRIVATE_H
14 #define GRAS_TRP_PRIVATE_H
15
16 #include "gras_private.h"
17 #include "Transport/transport_interface.h"
18
19 /**
20  * s_gras_socket:
21  * 
22  * Description of a socket.
23  */
24
25 struct s_gras_socket  {
26   gras_trp_plugin_t *plugin;
27     
28   int incoming :1; /* true if we can read from this sock */
29   int outgoing :1; /* true if we can write on this sock */
30   int accepting :1; /* true if master incoming sock in tcp */
31   int raw :1; /* true if this is an experiment socket instead of messaging */
32    
33   int  sd; 
34   int  port; /* port on this side */
35   int  peer_port; /* port on the other side */
36   char *peer_name; /* hostname of the other side */
37
38   void *data; /* plugin specific data */
39 };
40         
41 gras_error_t gras_trp_socket_new(int incomming,
42                                  gras_socket_t **dst);
43
44 /* The drivers */
45 typedef gras_error_t (*gras_trp_setup_t)(gras_trp_plugin_t *dst);
46
47 gras_error_t gras_trp_tcp_setup(gras_trp_plugin_t *plug);
48 gras_error_t gras_trp_file_setup(gras_trp_plugin_t *plug);
49 gras_error_t gras_trp_sg_setup(gras_trp_plugin_t *plug);
50
51 #endif /* GRAS_TRP_PRIVATE_H */