gdb-server/include/client.h

27 lines
722 B
C

#ifndef RDBSERVER_CLIENT_H_
#define RDBSERVER_CLIENT_H_
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
#define RDB_CLIENT_BUFLEN 8096
typedef struct RdbClient {
int connfd;
char full_buf[RDB_CLIENT_BUFLEN];
size_t len;
char chk;
bool should_ack;
} RdbClient;
void rdb_client_init(RdbClient *self, int connfd);
void rdb_client_begin_packet(RdbClient *self);
bool rdb_client_write_str(RdbClient *self, const char *str);
bool rdb_client_write_str_hex(RdbClient *self, const char *str);
bool rdb_client_write_i8_hex(RdbClient *self, uint8_t value);
bool rdb_client_write_i32_hex(RdbClient *self, uint32_t value);
int rdb_client_send_packet(RdbClient *self);
#endif