Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Initial revision
[simgrid.git] / src / gras / gs / connection.h
1 /* gs_connection.h */
2 #ifndef GS_CONNECTION_H
3 #define GS_CONNECTION_H
4
5 /* used structs */
6 struct s_gs_connection;
7 struct s_gs_net_driver;
8 struct s_gs_type_bag;
9
10 enum e_gs_connection_direction {
11         e_gs_connection_direction_unknown = 0,
12         e_gs_connection_direction_outgoing,
13         e_gs_connection_direction_incoming
14 };
15
16 struct s_gs_connection_ops {
17
18         void
19         (*_init)        (struct s_gs_connection *p_connection,
20                          void                   *arg);
21
22         void
23         (*_exit)        (struct s_gs_connection *p_connection);
24
25         void
26         (*write)        (struct s_gs_connection *p_connection,
27                          void                   *ptr,
28                          long int                length);
29
30         void
31         (*read)         (struct s_gs_connection *p_connection,
32                          void                   *ptr,
33                          long int                length);
34
35         void
36         (*flush)        (struct s_gs_connection *p_connection);
37 };
38
39 struct s_gs_connection {
40         struct s_gs_connection_ops      *connection_ops;
41         struct s_gs_net_driver          *p_net_driver;
42         enum e_gs_connection_direction   direction;
43         void                            *specific;
44 };
45
46
47 #endif /* GS_CONNECTION_H */