Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
- Reput hook for raw sockets, needed for BW experiments
[simgrid.git] / src / gras / Transport / transport_plugin_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                                        /* OUT */ gras_socket_t **dst);
30 gras_error_t gras_trp_sg_socket_server(unsigned short port,
31                                        int raw, 
32                                        /* OUT */ gras_socket_t **dst);
33 void         gras_trp_sg_socket_close(gras_socket_t **sd);
34 gras_error_t gras_trp_sg_select(double timeOut,
35                                 gras_socket_t **sd);
36
37 gras_error_t gras_trp_sg_bloc_send(gras_socket_t *sd,
38                                    void *data,
39                                    size_t size,
40                                    double timeOut);
41
42 gras_error_t gras_trp_sg_bloc_recv(gras_socket_t *sd,
43                                    void *data,
44                                    size_t size,
45                                    double timeOut);
46 gras_error_t gras_trp_sg_flush(gras_socket_t *sd);
47
48 /***
49  *** Specific plugin part
50  ***/
51 typedef struct {
52   int dummy;
53 } gras_trp_sg_specific_t;
54
55 /***
56  *** Specific socket part
57  ***/
58
59 /***
60  *** Code
61  ***/
62
63 gras_error_t
64 gras_trp_sg_init(gras_trp_plugin_t **dst) {
65
66   gras_trp_sg_specific_t *specific = malloc(sizeof(gras_trp_sg_specific_t));
67   if (!specific)
68     RAISE_MALLOC;
69
70   return no_error;
71 }
72
73 void
74 gras_trp_sg_exit(gras_trp_plugin_t *plugin) {
75   gras_trp_sg_specific_t *specific = (gras_trp_sg_specific_t*)plugin->specific;
76   free(specific);
77 }
78
79 gras_error_t gras_trp_sg_socket_client(const char *host,
80                                        unsigned short port,
81                                        int raw, 
82                                        /* OUT */ gras_socket_t **dst){
83   RAISE_UNIMPLEMENTED;
84 }
85
86 gras_error_t gras_trp_sg_socket_server(unsigned short port,
87                                        int raw, 
88                                        /* OUT */ gras_socket_t **dst){
89   RAISE_UNIMPLEMENTED;
90 }
91
92 void gras_trp_sg_socket_close(gras_socket_t **sd){
93   ERROR1("%s not implemented",__FUNCTION__);
94   abort();
95 }
96
97 gras_error_t gras_trp_sg_select(double timeOut,
98                                 gras_socket_t **sd){
99   RAISE_UNIMPLEMENTED;
100 }
101   
102 gras_error_t gras_trp_sg_bloc_send(gras_socket_t *sd,
103                                    void *data,
104                                    size_t size,
105                                    double timeOut){
106   RAISE_UNIMPLEMENTED;
107 }
108
109 gras_error_t gras_trp_sg_bloc_recv(gras_socket_t *sd,
110                                    void *data,
111                                    size_t size,
112                                    double timeOut){
113   RAISE_UNIMPLEMENTED;
114 }
115
116 gras_error_t gras_trp_sg_flush(gras_socket_t *sd){
117   RAISE_UNIMPLEMENTED;
118 }
119