6 enum Type { PUT, FIND, DEL, QUIT };
7 enum Result { OK, NOT_FOUND, EXISTS };
9 unsigned char type: 2; // 2 bits para tipo
10 unsigned char end: 1; // 1 bit para marca de FIN
11 unsigned char client_id: 5; // 5 bits para id de cliente
12 unsigned char len; // 255 máximo
16 Protocol(unsigned type, unsigned end, unsigned client_id, unsigned len):
17 type(type), end(end), client_id(client_id), len(len) {}
21 #endif // _PROTOCOL_H_
23 // vim: set et sw=4 sts=4 :