eventstore-client-c/tcp_package.h

28 lines
816 B
C
Raw Normal View History

2018-03-19 06:08:57 +00:00
//
// Created by nicol on 2018-03-18.
//
#ifndef ESC_TCP_PACKAGE_H
#define ESC_TCP_PACKAGE_H
#include "buffer.h"
#include "uuid.h"
struct st_tcp_package {
uint8_t command;
uint8_t flags;
esc_uuid_t correlation_id;
const char* login;
const char* password;
buffer_t data;
};
typedef struct st_tcp_package tcp_package_t;
const tcp_package_t* tcp_package_create(uint8_t command, const esc_uuid_t* correlation_id, buffer_t data);
const tcp_package_t* tcp_package_create_authenticated(uint8_t command, const esc_uuid_t* correlation_id, buffer_t data, const char* username, const char* password);
void tcp_package_free(const tcp_package_t* pkg);
buffer_t tcp_package_to_buffer(const tcp_package_t* pkg);
const tcp_package_t* tcp_package_from_buffer(buffer_t buffer);
#endif //ESC_TCP_PACKAGE_H