-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvtcp_packet.h
33 lines (24 loc) · 1.24 KB
/
vtcp_packet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef VTCP_PACKET_H
#define VTCP_PACKET_H
#include "vtcp.h"
#include <tchar.h>
#include <stdio.h>
struct vtcp_packet
{
struct vtcp_pkt_ext packets[VTCP_PACKET_CACHE_COUNT];
unsigned int count;
};
unsigned int vtcp_read2bytes(const unsigned char *buffer);
void vtcp_write2bytes(unsigned char *buffer, unsigned int value);
unsigned int vtcp_read4bytes(const unsigned char *buffer);
void vtcp_write4bytes(unsigned char *buffer, unsigned int value);
void vtcp_packet_initialize(struct vtcp_packet *pp);
void vtcp_packet_uninitialize(struct vtcp_packet *pp);
struct vtcp_pkt_ext *vtcp_packet_alloc(struct vtcp_packet *pp, unsigned int sn);
struct vtcp_pkt_ext *vtcp_packet_get(struct vtcp_packet *pp, unsigned int sn);
unsigned int vtcp_packet_set_index(struct vtcp_packet *pp, unsigned int index, unsigned int sn, unsigned int count);
unsigned int vtcp_packet_free(struct vtcp_packet *pp, unsigned int sn);
unsigned int vtcp_packet_free(struct vtcp_packet *pp, unsigned int sn, unsigned int count);
unsigned int vtcp_packet_free(struct vtcp_packet *pp, unsigned int sn, uint8_t *bits, unsigned char bitssize);
unsigned int vtcp_packet_makebits(struct vtcp_packet *pp, unsigned int sn, unsigned int minimum, uint8_t *bits);
#endif