]> Dogcows Code - chaz/thecheat/blob - cheat_net.h
The Cheat 1.1.1
[chaz/thecheat] / cheat_net.h
1
2 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 // Project: The Cheat
4 //
5 // File: cheat_net.h
6 // Created: Mon Sep 08 2003
7 //
8 // Copyright: 2003 Chaz McGarvey. All rights reserved.
9 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10
11 #ifndef _cheat_net_H
12 #define _cheat_net_H
13
14 #include <sys/socket.h>
15 #include <sys/un.h>
16 #include <netinet/in.h>
17 #include <arpa/inet.h>
18 #include <sys/time.h>
19 #include <sys/types.h>
20 #include <unistd.h>
21 #include <stdlib.h>
22
23
24 // macros
25
26 #define COPY_TO_BUFFER( to, from, size ) memcpy( to, from, size ), to += size;
27 #define COPY_FROM_BUFFER( to, from, size ) memcpy( to, from, size ), from += size;
28
29
30 struct tagPacketHeader
31 {
32 u_int32_t checksum;
33 u_int32_t function;
34 u_int32_t size;
35 };
36
37 typedef struct tagPacketHeader PacketHeader;
38
39
40 u_int32_t RandomChecksum();
41 char VerifyChecksum( u_int32_t checksum );
42 int CountBits( u_int8_t byte );
43
44 int SendBuffer( int socket, char const *buffer, int *length );
45 int ReadBuffer( int socket, char *buffer, int length );
46
47
48 #endif
49
This page took 0.029503 seconds and 4 git commands to generate.