#ifndef BLUETYPES_H #define BLUETYPES_H #include #include #include #include #include #ifdef _WIN32 #define socket_t SOCKET #else #define socket_t int #endif typedef struct client { socket_t sock; struct sockaddr_in SockAddr; struct hostent *pHost; int port; } sClient; /* IP HEADER +---------------------------------+--------------------------------+ |Version | IHL | TOS | Total Length | | 4 bits | 4 bits | 8 bits | 16 bits | +--------+--------+---------------+------+-------------------------+ | Identification |Flags | Fragment Offset | | 16 bits |3 bits| 13 bits | +-----------------+---------------+------+-------------------------+ | Time to Live | Protocol | Header Checksum | | 8 bits | 8 bits | 16 bits | +-----------------+---------------+--------------------------------+ | Source Address | | 32 bits | +------------------------------------------------------------------+ | Destination Address | | 32 bits | +------------------------------------------------+-----------------+ | Options Padding | // Optional +------------------------------------------------+-----------------+ http://de.wikipedia.org/wiki/IP-Paket */ typedef struct ip_hdr { unsigned char ipVerIhl; // version + IHL => 1 Bytes (combined size of both) unsigned char ipTos; // TOS => 1 Bytes unsigned short ipTotalLength; // Total length => 2 Bytes unsigned short ipId; // Identification => 2 Bytes unsigned short ipOffset; // Fragment Offset => 2 Bytes unsigned char ipTtl; // Time to live => 1 Bytes unsigned char ipProtocol; // Protocol => 1 Bytes unsigned short ipChecksum; // Header checksum => 2 Bytes unsigned long ipSrcAddr; // Source address => 4 Bytes unsigned long ipDestAddr; // Destination address => 4 Bytes // = 20 Bytes }sIpHeader; typedef struct port { unsigned short SrcPort; unsigned short DstPort; } sTcpUdpPorts; #endif