Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix the inclusion paths
[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 "gras/Transport/transport_interface.h"
18 #include "gras/Virtu/virtu_interface.h" /* socketset_get() */
19
20 /**
21  * s_gras_socket:
22  * 
23  * Description of a socket.
24  */
25 typedef struct gras_trp_bufdata_ gras_trp_bufdata_t;
26
27 struct s_gras_socket  {
28   gras_trp_plugin_t *plugin;
29     
30   int incoming :1; /* true if we can read from this sock */
31   int outgoing :1; /* true if we can write on this sock */
32   int accepting :1; /* true if master incoming sock in tcp */
33   int raw :1; /* true if this is an experiment socket instead of messaging */
34    
35   int  sd; 
36   int  port; /* port on this side */
37   int  peer_port; /* port on the other side */
38   char *peer_name; /* hostname of the other side */
39
40   void *data;    /* plugin specific data */
41
42   /* buffer plugin specific data. Yeah, C is not OO, so I got to trick */
43   gras_trp_bufdata_t *bufdata; 
44 };
45         
46 gras_error_t gras_trp_socket_new(int incomming,
47                                  gras_socket_t **dst);
48
49 /* The drivers */
50 typedef gras_error_t (*gras_trp_setup_t)(gras_trp_plugin_t *dst);
51
52 gras_error_t gras_trp_tcp_setup(gras_trp_plugin_t *plug);
53 gras_error_t gras_trp_file_setup(gras_trp_plugin_t *plug);
54 gras_error_t gras_trp_sg_setup(gras_trp_plugin_t *plug);
55 gras_error_t gras_trp_buf_setup(gras_trp_plugin_t *plug);
56
57 /*
58
59   I'm tired of that shit. the select in SG has to create a socket to expeditor
60   manually do deal with the weirdness of the hostdata, themselves here to deal
61   with the weird channel concept of SG and convert them back to ports.
62   
63   When introducing buffered transport (whith I want to get used in SG to debug
64   the buffering itself), we should not make the rest of the code aware of the
65   change and not specify code for this. This is bad design.
66   
67   But there is bad design all over the place, so fuck off for now, when we can
68   get rid of MSG and rely directly on SG, this crude hack can go away. But in
69   the meanwhile, I want to sleep this night (FIXME).
70   
71   Hu! You evil problem! Taste my axe!
72
73 */
74
75 gras_error_t gras_trp_buf_init_sock(gras_socket_t *sock);
76
77
78 #endif /* GRAS_TRP_PRIVATE_H */