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"
/* TCP */
TRY(gras_trp_tcp_init(&plug));
- TRY(gras_dict_insert(_gras_trp_plugins,
- plug->name, plug, gras_trp_plugin_free));
+ TRY(gras_dict_set(_gras_trp_plugins,
+ plug->name, plug, gras_trp_plugin_free));
/* FILE */
TRY(gras_trp_file_init(&plug));
- TRY(gras_dict_insert(_gras_trp_plugins,
- plug->name, plug, gras_trp_plugin_free));
+ TRY(gras_dict_set(_gras_trp_plugins,
+ plug->name, plug, gras_trp_plugin_free));
return no_error;
}
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;
/* plugin-specific */
errcode= (* trp->socket_client)(trp,
host ? host : "localhost", port,
+ 0 /* not raw */,
sock);
if (errcode != no_error) {
free(sock);
return;
}
}
- WARNING0("Ignoring request to free an unknown socket");
+ WARN0("Ignoring request to free an unknown socket");
}
}
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;
+}