net.h (626B)
1 /* See LICENSE file for copyright and license details */ 2 3 #ifndef __RPNET_H__ 4 #define __RPNET_H__ 5 6 typedef struct net_t net_t; 7 struct net_t { 8 int fd; 9 10 char *net; 11 char *addr; 12 char *service; 13 char *options; 14 int type; 15 16 void *data[2]; 17 }; 18 19 net_t *net_new(char *desc); 20 void net_free(net_t *net); 21 22 int net_addssl(net_t *net); 23 int net_connect(net_t *net); 24 void net_close(net_t *net); 25 int net_write(net_t *net, char *buf, int len); 26 int net_writeall(net_t *net, char *buf, int len); 27 int net_printf(net_t *net, char *fmt, ...); 28 int net_read(net_t *net, char *buf, int len); 29 int net_readall(net_t *net, char *buf, int len); 30 31 #endif