#ifndef _APP_SOCKETS_H
#define _APP_SOCKETS_H

#include 

#include "app_general.h"

typedef enum protocol_type {
        hex_dump_on_event,
        binary,
        decoded_on_event,
        http,
        extra,
        status,
        no_protocol                            /* must be the last in this list
 */
} protocol_type;

#define NR_PROTOCOLS (no_protocol)
#define NR_CLIENTS   (15)     /* max nr. of clients that are accepted   */

typedef struct socket_adm_type {
	int                fd;
	unsigned long int  ip_addr;
	protocol_type protocol;
} socket_adm_type;


void
FD_set (socket_adm_type * the_socket, int nr_sockets, fd_set * p_rfds);


void
init_protocol_sockets (socket_adm_type * protocol );

void
check_protocol_sockets (socket_adm_type * protocol,
                        socket_adm_type * client,
                        fd_set * p_rfds);
void
wr_client_table (int * current_socket);

void
check_client_sockets (socket_adm_type * client, fd_set * p_rfds);

void
send_data_to_clients (socket_adm_type * client,
                      unsigned int bin_length, unsigned char * bin_data,
                      char * textbuf, unsigned int message_id);
#endif