--- /dev/null
+/* $Id$ */
+
+/* bloc_transport - send/receive a bunch of bytes */
+
+/* Authors: Martin Quinson */
+/* Copyright (C) 2004 Martin Quinson. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "gras_private.h"
+#include "transport.h"
+
+GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(transport,GRAS);
+
+
+gras_error_t
+gras_trp_init(void){
+ RAISE_UNIMPLEMENTED;
+}
+
+void
+gras_trp_exit(void){
+
+ ERROR1("%s not implemented",__FUNCTION__);
+ abort();
+}
+
+gras_error_t
+gras_trp_plugin_get_by_name(const char *name,
+ gras_trp_plugin_t **dst){
+
+ RAISE_UNIMPLEMENTED;
+}
--- /dev/null
+/* $Id$ */
+
+/* trp (transport) - send/receive a bunch of bytes */
+
+/* This file implements the public interface of this module, exported to the*/
+/* other modules of GRAS, but not to the end user. */
+
+/* Authors: Martin Quinson */
+/* Copyright (C) 2004 Martin Quinson. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef GRAS_TRP_PRIVATE_H
+#define GRAS_TRP_PRIVATE_H
+
+#include "gras_private.h"
+/* A low-level socket type (each plugin implements it the way it prefers */
+//typedef void gras_trp_sock_t;
+
+/* A plugin type */
+struct gras_trp_plugin_ {
+ const char *name;
+
+ gras_error_t (*init)(void);
+ void (*exit)(gras_trp_plugin_t *);
+
+ gras_error_t (*socket_client_open)(const char *host,
+ unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst);
+ gras_error_t (*socket_server_open)(unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst);
+ void (*socket_close)(gras_trp_sock_t **sd);
+
+ gras_error_t (*select)(double timeOut,
+ gras_trp_sock_t **sd);
+
+ gras_error_t (*bloc_send)(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut);
+ gras_error_t (*bloc_recv)(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut);
+ gras_error_t (*flush)(gras_trp_sock_t *sd);
+
+ void *specific;
+};
+
+/**********************************************************************
+ * Internal stuff to the module. Other modules shouldn't fool with it *
+ **********************************************************************/
+
+/* TCP driver */
+gras_error_t gras_trp_tcp_init(void);
+void gras_trp_tcp_exit(gras_trp_plugin_t *plugin);
+gras_error_t gras_trp_tcp_socket_client(const char *host,
+ unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst);
+gras_error_t gras_trp_tcp_socket_server(unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst);
+void gras_trp_tcp_socket_close(gras_trp_sock_t **sd);
+gras_error_t gras_trp_tcp_select(double timeOut,
+ gras_trp_sock_t **sd);
+
+gras_error_t gras_trp_tcp_bloc_send(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut);
+
+gras_error_t gras_trp_tcp_bloc_recv(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut);
+gras_error_t gras_trp_tcp_flush(gras_trp_sock_t *sd);
+
+/* SG driver */
+gras_error_t gras_trp_sg_init(void);
+void gras_trp_sg_exit(gras_trp_plugin_t *plugin);
+gras_error_t gras_trp_sg_socket_client(const char *host,
+ unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst);
+gras_error_t gras_trp_sg_socket_server(unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst);
+void gras_trp_sg_socket_close(gras_trp_sock_t **sd);
+gras_error_t gras_trp_sg_select(double timeOut,
+ gras_trp_sock_t **sd);
+
+gras_error_t gras_trp_sg_bloc_send(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut);
+
+gras_error_t gras_trp_sg_bloc_recv(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut);
+gras_error_t gras_trp_sg_flush(gras_trp_sock_t *sd);
+
+
+
+#endif /* GRAS_TRP_PRIVATE_H */
--- /dev/null
+/* $Id$ */
+
+/* file trp (transport) - send/receive a bunch of bytes in SG realm */
+
+/* Authors: Martin Quinson */
+/* Copyright (C) 2004 Martin Quinson. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "gras_private.h"
+#include "transport_private.h"
+
+GRAS_LOG_EXTERNAL_CATEGORY(transport);
+GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_sg,transport);
+
+typedef struct {
+ int dummy;
+} gras_trp_sg_specific_t;
+
+gras_error_t
+gras_trp_sg_init(void) {
+
+ gras_trp_sg_specific_t *specific = malloc(sizeof(gras_trp_sg_specific_t));
+ if (!specific)
+ RAISE_MALLOC;
+
+ return no_error;
+}
+
+void
+gras_trp_sg_exit(gras_trp_plugin_t *plugin) {
+ gras_trp_sg_specific_t *specific = (gras_trp_sg_specific_t*)plugin->specific;
+ free(specific);
+}
+
+gras_error_t gras_trp_sg_socket_client(const char *host,
+ unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_sg_socket_server(unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst){
+ RAISE_UNIMPLEMENTED;
+}
+
+void gras_trp_sg_socket_close(gras_trp_sock_t **sd){
+ ERROR1("%s not implemented",__FUNCTION__);
+ abort();
+}
+
+gras_error_t gras_trp_sg_select(double timeOut,
+ gras_trp_sock_t **sd){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_sg_bloc_send(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_sg_bloc_recv(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_sg_flush(gras_trp_sock_t *sd){
+ RAISE_UNIMPLEMENTED;
+}
+
--- /dev/null
+/* $Id$ */
+
+/* tcp trp (transport) - send/receive a bunch of bytes from a tcp socket */
+
+/* Authors: Martin Quinson */
+/* Copyright (C) 2004 Martin Quinson. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "gras_private.h"
+#include "transport_private.h"
+
+GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(trp_tcp,transport);
+
+typedef struct {
+ int dummy;
+} gras_trp_tcp_specific_t;
+
+gras_error_t
+gras_trp_tcp_init(void) {
+
+ gras_trp_tcp_specific_t *specific = malloc(sizeof(gras_trp_tcp_specific_t));
+ if (!specific)
+ RAISE_MALLOC;
+
+ return no_error;
+}
+
+void
+gras_trp_tcp_exit(gras_trp_plugin_t *plugin) {
+ gras_trp_tcp_specific_t *specific = (gras_trp_tcp_specific_t*)plugin->specific;
+ free(specific);
+}
+
+gras_error_t gras_trp_tcp_socket_client(const char *host,
+ unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_tcp_socket_server(unsigned short port,
+ int raw,
+ unsigned int bufSize,
+ /* OUT */ gras_trp_sock_t **dst){
+ RAISE_UNIMPLEMENTED;
+}
+
+void gras_trp_tcp_socket_close(gras_trp_sock_t **sd){
+ ERROR1("%s not implemented",__FUNCTION__);
+ abort();
+}
+
+gras_error_t gras_trp_tcp_select(double timeOut,
+ gras_trp_sock_t **sd){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_tcp_bloc_send(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_tcp_bloc_recv(gras_trp_sock_t *sd,
+ void *data,
+ size_t size,
+ double timeOut){
+ RAISE_UNIMPLEMENTED;
+}
+
+gras_error_t gras_trp_tcp_flush(gras_trp_sock_t *sd){
+ RAISE_UNIMPLEMENTED;
+}
+