sysdis-project/sgca/lib/data.h

65 lines
1.4 KiB
C

/**************************
* Data-Structures *
***************************
* Designed & Developed by *
* Adrien Marquès *
* <xdrm-brackets> *
***************************
* doowap31@gmail.com *
**************************/
#ifndef _DATA_H_
#define _DATA_H_
#define TERMREQ_FBK 0x01
#define TERMREQ_CAP 0x02
#define TERMREQ_SPD 0x04
#define TERMREQ_ALT 0x08
#define TERMREQ_OFF 0x10
#define PLANE_LEN ( sizeof(char)*6+sizeof(int)*5 )
struct plane{
char code[6];
int x;
int y;
int z;
int cap;
int spd;
char online;
};
struct plane_update{
char flags;
int z;
int cap;
int spd;
char done;
};
#define TERMREQ_LEN ( sizeof(char)+PLANE_LEN )
struct term_req{
char flags;
struct plane update;
};
struct term_res{
char flags;
char n;
struct plane* data;
};
#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