LIBSSDP
 All Classes Files Functions Variables Typedefs Macros
socket_helpers.h
Go to the documentation of this file.
1 
7 #ifndef __SOCKET_HELPERS_H__
8 #define __SOCKET_HELPERS_H__
9 
10 #include <sys/socket.h>
11 
12 #include "common_definitions.h"
13 
17 typedef struct socket_conf_s {
25  char *interface;
27  char *if_ip;
29  struct sockaddr_storage *sa;
31  const char *ip;
33  int port;
41  int ttl;
49 
58 int set_send_timeout(SOCKET sock, int timeout);
59 
68 int set_receive_timeout(SOCKET sock, int timeout);
69 
78 int set_reuseaddr(SOCKET sock);
79 
88 int set_reuseport(SOCKET sock);
89 
99 int set_keepalive(SOCKET sock, BOOL keepalive);
100 
109 int set_ttl(SOCKET sock, int family, int ttl);
110 
119 int disable_multicast_loopback(SOCKET sock, int family);
120 
129 int join_multicast_group(SOCKET sock, char *multicast_group,
130  char *interface_ip);
131 
141 
142 #endif /* __SOCKET_HELPERS_H__ */
SOCKET setup_socket(socket_conf_s *conf)
int set_reuseaddr(SOCKET sock)
int join_multicast_group(SOCKET sock, char *multicast_group, char *interface_ip)
struct socket_conf_s socket_conf_s
int SOCKET
int set_reuseport(SOCKET sock)
int set_keepalive(SOCKET sock, BOOL keepalive)
int set_receive_timeout(SOCKET sock, int timeout)
int set_ttl(SOCKET sock, int family, int ttl)
struct sockaddr_storage * sa
int set_send_timeout(SOCKET sock, int timeout)
int BOOL
static configuration_s conf
Definition: main.c:73
int disable_multicast_loopback(SOCKET sock, int family)
const char * ip