Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
J'en ai marre de faire des messages detailles. 'Current state' ;)
[simgrid.git] / src / gras / Transport / transport_sg.c
1 /* $Id$ */
2
3 /* file trp (transport) - send/receive a bunch of bytes in SG realm         */
4
5 /* Note that this is only used to debug other parts of GRAS since message   */
6 /*  exchange in SG realm is implemented directly without mimicing real life */
7 /*  This would be terribly unefficient.                                     */
8
9 /* Authors: Martin Quinson                                                  */
10 /* Copyright (C) 2004 Martin Quinson.                                       */
11
12 /* This program is free software; you can redistribute it and/or modify it
13    under the terms of the license (GNU LGPL) which comes with this package. */
14
15 #include "gras_private.h"
16 #include "transport_private.h"
17
18 GRAS_LOG_EXTERNAL_CATEGORY(transport);
19 GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_sg,transport);
20
21
22 /***
23  *** Prototypes 
24  ***/
25 void         gras_trp_sg_exit(gras_trp_plugin_t *plugin);
26 gras_error_t gras_trp_sg_socket_client(const char *host,
27                                        unsigned short port,
28                                        int raw, 
29                                        unsigned int bufSize, 
30                                        /* OUT */ gras_socket_t **dst);
31 gras_error_t gras_trp_sg_socket_server(unsigned short port,
32                                        int raw, 
33                                        unsigned int bufSize, 
34                                        /* OUT */ gras_socket_t **dst);
35 void         gras_trp_sg_socket_close(gras_trp_sock_t **sd);
36 gras_error_t gras_trp_sg_select(double timeOut,
37                                 gras_socket_t **sd);
38
39 gras_error_t gras_trp_sg_bloc_send(gras_socket_t *sd,
40                                    void *data,
41                                    size_t size,
42                                    double timeOut);
43
44 gras_error_t gras_trp_sg_bloc_recv(gras_socket_t *sd,
45                                    void *data,
46                                    size_t size,
47                                    double timeOut);
48 gras_error_t gras_trp_sg_flush(gras_socket_t *sd);
49
50 /***
51  *** Specific plugin part
52  ***/
53 typedef struct {
54   int dummy;
55 } gras_trp_sg_specific_t;
56
57 /***
58  *** Specific socket part
59  ***/
60
61 /***
62  *** Code
63  ***/
64
65 gras_error_t
66 gras_trp_sg_init(void) {
67
68   gras_trp_sg_specific_t *specific = malloc(sizeof(gras_trp_sg_specific_t));
69   if (!specific)
70     RAISE_MALLOC;
71
72   return no_error;
73 }
74
75 void
76 gras_trp_sg_exit(gras_trp_plugin_t *plugin) {
77   gras_trp_sg_specific_t *specific = (gras_trp_sg_specific_t*)plugin->specific;
78   free(specific);
79 }
80
81 gras_error_t gras_trp_sg_socket_client(const char *host,
82                                        unsigned short port,
83                                        int raw, 
84                                        unsigned int bufSize, 
85                                        /* OUT */ gras_trp_sock_t **dst){
86   RAISE_UNIMPLEMENTED;
87 }
88
89 gras_error_t gras_trp_sg_socket_server(unsigned short port,
90                                        int raw, 
91                                        unsigned int bufSize, 
92                                        /* OUT */ gras_trp_sock_t **dst){
93   RAISE_UNIMPLEMENTED;
94 }
95
96 void gras_trp_sg_socket_close(gras_trp_sock_t **sd){
97   ERROR1("%s not implemented",__FUNCTION__);
98   abort();
99 }
100
101 gras_error_t gras_trp_sg_select(double timeOut,
102                                 gras_trp_sock_t **sd){
103   RAISE_UNIMPLEMENTED;
104 }
105   
106 gras_error_t gras_trp_sg_bloc_send(gras_trp_sock_t *sd,
107                                    void *data,
108                                    size_t size,
109                                    double timeOut){
110   RAISE_UNIMPLEMENTED;
111 }
112
113 gras_error_t gras_trp_sg_bloc_recv(gras_trp_sock_t *sd,
114                                    void *data,
115                                    size_t size,
116                                    double timeOut){
117   RAISE_UNIMPLEMENTED;
118 }
119
120 gras_error_t gras_trp_sg_flush(gras_trp_sock_t *sd){
121   RAISE_UNIMPLEMENTED;
122 }
123