A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- Reput hook for raw sockets, needed for BW experiments
[simgrid.git]
/
src
/
gras
/
Transport
/
transport.c
diff --git
a/src/gras/Transport/transport.c
b/src/gras/Transport/transport.c
index
4b5d45a
..
07b7b75
100644
(file)
--- a/
src/gras/Transport/transport.c
+++ b/
src/gras/Transport/transport.c
@@
-9,7
+9,6
@@
under the terms of the license (GNU LGPL) which comes with this package. */
#include <time.h> /* time() */
under the terms of the license (GNU LGPL) which comes with this package. */
#include <time.h> /* time() */
-//#include <errno.h>
#include "Transport/transport_private.h"
#include "Transport/transport_private.h"
@@
-41,13
+40,13
@@
gras_trp_init(void){
/* TCP */
TRY(gras_trp_tcp_init(&plug));
/* TCP */
TRY(gras_trp_tcp_init(&plug));
- TRY(gras_dict_
inser
t(_gras_trp_plugins,
-
plug->name, plug, gras_trp_plugin_free));
+ TRY(gras_dict_
se
t(_gras_trp_plugins,
+ plug->name, plug, gras_trp_plugin_free));
/* FILE */
TRY(gras_trp_file_init(&plug));
/* FILE */
TRY(gras_trp_file_init(&plug));
- TRY(gras_dict_
inser
t(_gras_trp_plugins,
-
plug->name, plug, gras_trp_plugin_free));
+ TRY(gras_dict_
se
t(_gras_trp_plugins,
+ plug->name, plug, gras_trp_plugin_free));
return no_error;
}
return no_error;
}
@@
-130,7
+129,7
@@
gras_socket_server(unsigned short port,
sock->port=port;
/* Call plugin socket creation function */
sock->port=port;
/* Call plugin socket creation function */
- errcode = trp->socket_server(trp, port, sock);
+ errcode = trp->socket_server(trp, port,
0/* not raw */,
sock);
if (errcode != no_error) {
free(sock);
return errcode;
if (errcode != no_error) {
free(sock);
return errcode;
@@
-177,6
+176,7
@@
gras_socket_client(const char *host,
/* plugin-specific */
errcode= (* trp->socket_client)(trp,
host ? host : "localhost", port,
/* plugin-specific */
errcode= (* trp->socket_client)(trp,
host ? host : "localhost", port,
+ 0 /* not raw */,
sock);
if (errcode != no_error) {
free(sock);
sock);
if (errcode != no_error) {
free(sock);
@@
-213,7
+213,7
@@
void gras_socket_close(gras_socket_t **sock) {
return;
}
}
return;
}
}
- WARN
ING
0("Ignoring request to free an unknown socket");
+ WARN0("Ignoring request to free an unknown socket");
}
}
}
}
@@
-256,6
+256,15
@@
gras_error_t
gras_trp_plugin_get_by_name(const char *name,
gras_trp_plugin_t **dst){
gras_trp_plugin_get_by_name(const char *name,
gras_trp_plugin_t **dst){
- return gras_dict_
retrieve
(_gras_trp_plugins,name,(void**)dst);
+ return gras_dict_
get
(_gras_trp_plugins,name,(void**)dst);
}
}
+int gras_socket_my_port (gras_socket_t *sock) {
+ return sock->port;
+}
+int gras_socket_peer_port(gras_socket_t *sock) {
+ return sock->peer_port;
+}
+char *gras_socket_peer_name(gras_socket_t *sock) {
+ return sock->peer_name;
+}