]> Dogcows Code - chaz/thecheat/blob - cheat_net.h
The Cheat 1.1.2
[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 #import <Chaz/Chaz.h>
15
16 #include <sys/socket.h>
17 #include <sys/un.h>
18 #include <netinet/in.h>
19 #include <arpa/inet.h>
20 #include <sys/time.h>
21 #include <sys/types.h>
22 #include <unistd.h>
23 #include <stdlib.h>
24
25
26 // macros
27
28 #define COPY_TO_BUFFER( to, from, size ) memcpy( to, from, size ), (char *)to += size;
29 #define COPY_FROM_BUFFER( to, from, size ) memcpy( to, from, size ), (char *)from += size;
30
31
32 struct tagPacketHeader
33 {
34 u_int32_t checksum;
35 u_int32_t function;
36 u_int32_t size;
37 };
38
39 typedef struct tagPacketHeader PacketHeader;
40
41
42 u_int32_t RandomChecksum();
43 char VerifyChecksum( u_int32_t checksum );
44 int CountBits( u_int8_t byte );
45
46 int SendBuffer( int socket, char const *buffer, int *length );
47 int ReadBuffer( int socket, char *buffer, int length );
48
49
50 #endif
51
This page took 0.037371 seconds and 4 git commands to generate.