Impl basic ws binary proto with data and execution state manipulation

This commit is contained in:
2025-10-10 03:19:45 +03:00
parent 2ff6b1a454
commit 165a96aa3c
44 changed files with 2065 additions and 2269 deletions

11
inc/proto/handlers/auth.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef __PROTO_HANDLERS_AUTH_H__
#define __PROTO_HANDLERS_AUTH_H__
#include <stdint.h>
#include "context.h"
uint8_t handle_auth(ClientContext* cctx, ws_cli_conn_t client, const uint8_t* msg, uint64_t msgSize, int msgType);
LinkedListEntry* disconnectDueTimeout(EmulContext* emulContext, LinkedListEntry* clientEntry);
void handleOnClientAuthDone(ClientContext* ctx, EmulContext* emulContext);
#endif //ifndef __PROTO_HANDLERS_AUTH_H__

View File

@@ -0,0 +1,10 @@
#ifndef __PROTO_HANDLERS_CONTROL_H__
#define __PROTO_HANDLERS_CONTROL_H__
#include "proto/msg.h"
#include "proto/dial.h"
void handleIncomingControlMessage(BaseMessage* msg, ClientContext* ctx, EmulContext* emulContext);
#endif //ifndef __PROTO_HANDLERS_CONTROL_H__

10
inc/proto/handlers/mem.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef __PROTO_HANDLERS_MEM_H__
#define __PROTO_HANDLERS_MEM_H__
#include "proto/msg.h"
#include "proto/dial.h"
void handleIncomingMemMessage(BaseMessage* msg, ClientContext* ctx, EmulContext* emulContext);
#endif //ifndef __PROTO_HANDLERS_MEM_H__

View File

@@ -0,0 +1,12 @@
#ifndef __PROTO_HANDLERS_STREAM_H__
#define __PROTO_HANDLERS_STREAM_H__
#include "proto/msg.h"
#include "proto/dial.h"
void unregisterClientStream(EmulContext* emulContext, ClientContext* ctx, uint32_t regId);
void unregisterClientStreams(EmulContext* emulContext, ClientContext* ctx);
void handleIncomingStreamMessage(BaseMessage* msg, ClientContext* ctx, EmulContext* emulContext);
#endif //ifndef __PROTO_HANDLERS_STREAM_H__

10
inc/proto/handlers/ws.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef __PROTO_HANDLERS_WS_H__
#define __PROTO_HANDLERS_WS_H__
#include "wsServer/include/ws.h"
void onWsMessage(ws_cli_conn_t client, const unsigned char *msg, uint64_t size, int type);
void onWsClose(ws_cli_conn_t client);
void onWsOpen(ws_cli_conn_t client);
#endif //ifndef __PROTO_HANDLERS_WS_H__