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);
/* A plugin type */
typedef struct gras_trp_plugin_ gras_trp_plugin_t;
-
-/**
- * e_gras_trp_plugin:
- *
- * Caracterize each possible transport plugin
- */
-typedef enum e_gras_trp_plugin {
- e_gras_trp_plugin_undefined = 0,
-
- e_gras_trp_plugin_tcp
-} gras_trp_plugin_type_t;
-
/* A plugin type */
struct gras_trp_plugin_ {
char *name;
gras_error_t (*socket_client)(gras_trp_plugin_t *self,
const char *host,
unsigned short port,
+ int raw,
/* OUT */ gras_socket_t *dst);
gras_error_t (*socket_server)(gras_trp_plugin_t *self,
unsigned short port,
+ int raw,
/* OUT */ gras_socket_t *dst);
gras_error_t (*socket_accept)(gras_socket_t *sock,
gras_error_t gras_trp_tcp_socket_client(gras_trp_plugin_t *self,
const char *host,
unsigned short port,
+ int raw,
/* OUT */ gras_socket_t *sock);
gras_error_t gras_trp_tcp_socket_server(gras_trp_plugin_t *self,
unsigned short port,
+ int raw,
/* OUT */ gras_socket_t *sock);
gras_error_t gras_trp_tcp_socket_accept(gras_socket_t *sock,
gras_socket_t **dst);
gras_error_t gras_trp_tcp_socket_client(gras_trp_plugin_t *self,
const char *host,
unsigned short port,
+ int raw,
/* OUT */ gras_socket_t *sock){
struct sockaddr_in addr;
struct hostent *he;
struct in_addr *haddr;
+ gras_assert0(!raw,"Raw TCP sockets not implemented yet");
+
sock->incoming = 1; /* TCP sockets are duplex'ed */
sock->sd = socket (AF_INET, SOCK_STREAM, 0);
*/
gras_error_t gras_trp_tcp_socket_server(gras_trp_plugin_t *self,
unsigned short port,
+ int raw,
/* OUT */ gras_socket_t *sock){
// int size = bufSize * 1024;
int on = 1;
struct sockaddr_in server;
- gras_trp_tcp_specific_t *data=(gras_trp_tcp_specific_t*)self -> specific;
+ gras_assert0(!raw,"Raw TCP sockets not implemented yet");
+
+ gras_trp_tcp_specific_t *data=(gras_trp_tcp_specific_t*)self -> specific;
sock->outgoing = 1; /* TCP => duplex mode */