X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/75ffa801579aeb214b8d95290b76c96a605a2422..ebd3066b86ef358bce0557c175febcd8ed6fdefc:/include/transport.h diff --git a/include/transport.h b/include/transport.h index ffe6e6e4c7..b2b83f0525 100644 --- a/include/transport.h +++ b/include/transport.h @@ -1,9 +1,8 @@ /* $Id$ */ -/* trp (transport) - send/receive a bunch of bytes */ +/* transport - low level communication (send/receive bunches of bytes) */ -/* This file implements the public interface of this module, exported to the*/ -/* other modules of GRAS, but not to the end user. */ +/* module's public interface exported to end user. */ /* Authors: Martin Quinson */ /* Copyright (C) 2004 Martin Quinson. */ @@ -14,20 +13,25 @@ #ifndef GRAS_TRANSPORT_H #define GRAS_TRANSPORT_H -/* each plugin implements the socket the way it wants */ -typedef void gras_trp_sock_t; - -/* A plugin type */ -typedef struct gras_trp_plugin_ gras_trp_plugin_t; - -/* Module, and get plugin by name */ -gras_error_t gras_trp_init(void); - -void gras_trp_exit(void); - -gras_error_t gras_trp_plugin_get_by_name(const char *name, - gras_trp_plugin_t **dst); - - - +typedef struct s_gras_socket gras_socket_t; + +gras_error_t gras_socket_client(const char *host, + unsigned short port, + /* OUT */ gras_socket_t **dst); +gras_error_t gras_socket_server(unsigned short port, + /* OUT */ gras_socket_t **dst); +void gras_socket_close(gras_socket_t *sd); + +/* get information about socket */ +int gras_socket_my_port (gras_socket_t *sock); +int gras_socket_peer_port(gras_socket_t *sock); +char *gras_socket_peer_name(gras_socket_t *sock); + +/* debuging functions */ +gras_error_t gras_socket_client_from_file(const char*path, + /* OUT */ gras_socket_t **dst); +gras_error_t gras_socket_server_from_file(const char*path, + /* OUT */ gras_socket_t **dst); + + #endif /* GRAS_TRANSPORT_H */