#include <sys/types.h>
#include <sys/socket.h>
+#include <sys/prctl.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include <poll.h>
#include <sys/mman.h>
#include "libwebsockets.h"
-/* #define DEBUG */
+/* #define DEBUG */
#ifdef DEBUG
#define LWS_INITIAL_HDR_ALLOC 256
#define LWS_ADDITIONAL_HDR_ALLOC 64
#define MAX_USER_RX_BUFFER 512
-
+#define MAX_BROADCAST_PAYLOAD 1024
+#define LWS_MAX_PROTOCOLS 10
enum lws_connection_states {
WSI_STATE_HTTP,
int token_len;
};
+struct libwebsocket_context {
+ struct libwebsocket *wsi[MAX_CLIENTS + 1];
+ struct pollfd fds[MAX_CLIENTS + 1];
+ int fds_count;
+#ifdef LWS_OPENSSL_SUPPORT
+ int use_ssl;
+#endif
+ int count_protocols;
+};
+
/*
* This is totally opaque to code using the library. It's exported as a
extern void
libwebsockets_md5(const unsigned char *input, int ilen, unsigned char *output);
+
+extern int
+libwebsocket_parse(struct libwebsocket *wsi, unsigned char c);
+
+extern int
+libwebsocket_interpret_incoming_packet(struct libwebsocket *wsi,
+ unsigned char *buf, size_t len);