summaryrefslogtreecommitdiff
path: root/src/socket.h
blob: 141bacb8295657628ad6d49f0f705ccec2e11415 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <gnutls/gnutls.h>

typedef struct
{
  int fd;
  gnutls_session_t session;
  int secure;
  char *hostname;
  char *ip;
  char *service;
  struct addrinfo *ptr;
  struct addrinfo *addr_info;
} socket_st;

ssize_t socket_recv (const socket_st * socket, void *buffer, int buffer_size);
ssize_t socket_send (const socket_st * socket, const void *buffer,
                     int buffer_size);
void socket_open (socket_st * hd, const char *hostname, const char *service, int udp);
void socket_connect (const socket_st * hd);
void socket_bye (socket_st * socket);

void sockets_init (void);