4
Fork 0
CronosAgent/RingBuffer.h
2016-08-06 19:40:06 +03:00

37 lines
604 B
C

#ifndef RINGBUFFER_H
#define RINGBUFFER_H
#include <stdint.h>
#include <stddef.h>
#include <arpa/inet.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define DATA_LENGTH 256
#define BUFFER_LENGTH 8
struct BufferRecord
{
size_t length;
uint8_t data[DATA_LENGTH];
};
struct RingBuffer
{
size_t marks;
size_t delay;
size_t index;
struct BufferRecord records[BUFFER_LENGTH];
};
void PokeData(struct RingBuffer* buffer, uint32_t number, uint8_t* data, size_t length);
void ProcessBuffer(struct RingBuffer* buffer, int handle, struct sockaddr_in* address);
#ifdef __cplusplus
}
#endif
#endif