/************************** * Plane * *************************** * Designed & Developed by * * Adrien Marquès * * * *************************** * doowap31@gmail.com * **************************/ #ifndef _PLANE_H_ #define _PLANE_H_ #include #include #include "lib/header.h" #include "lib/network/udp/server.h" #include "lib/network/tcp/client.h" #define ALTMAX 20000 #define ALTMIN 0 #define VITMAX 1000 #define VITMIN 200 #define PAUSE 2 struct coord { int x; int y; int z; }; struct control { int cap; int speed; }; #define PLANE_DATA_LEN (sizeof(char)*6+sizeof(int)*5) struct plane_data{ char code[6]; int x; int y; int z; int cap; int spd; }; #define REQ_CAP 0x02 #define REQ_SPD 0x04 #define REQ_ALT 0x08 struct sgca_req{ char flags; int z; int cap; int spd; }; #define BINDHDR_LEN ( sizeof(char)+sizeof(in_addr_t)+sizeof(unsigned short) ) #define BINDHEAD_UDP 0x01 // is terminal (ask for UDP socket) #define BINDHEAD_TCP 0x02 // is plane (ask for TCP socket) #define BINDHEAD_CTL 0x04 // is ctrlTerm (else: viewTerm) struct bind_header{ char flags; in_addr_t addr; unsigned short port; }; #endif