-/* A plugin type */
-struct gras_trp_plugin_ {
- char *name;
-
- /* dst pointers are created and initialized with default values
- before call to socket_client/server*/
- gras_error_t (*socket_client)(gras_trp_plugin_t *self,
- const char *host,
- unsigned short port,
- /* OUT */ gras_socket_t *dst);
- gras_error_t (*socket_server)(gras_trp_plugin_t *self,
- unsigned short port,
- /* OUT */ gras_socket_t *dst);
-
- gras_error_t (*socket_accept)(gras_socket_t *sock,
- /* OUT */gras_socket_t **dst);
-
-
- /* socket_close() is responsible of telling the OS that the socket is over,
- but should not free the socket itself (beside the specific part) */
- void (*socket_close)(gras_socket_t *sd);
-
- gras_error_t (*chunk_send)(gras_socket_t *sd,
- char *data,
- size_t size);
- gras_error_t (*chunk_recv)(gras_socket_t *sd,
- char *Data,
- size_t size);