#ifndef __SERVER_H
#define __SERVER_H
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include "ring.h"

typedef struct server_connection server_connection;
struct server_connection {
  int s;
  ring_buffer *rx,*tx;
  void *inst_data;
  struct server_connection *next;
};
typedef int (*server_fe)(server_connection *,void *);
int server(server_fe,void *,server_connection **,unsigned,void *);
server_connection *new_server_connection(int s,void *inst_data,int rxlen,int txlen);
#endif
/*
  Author: Michael Schmidt (michael@embeddedARM.com)
 */
