17 #ifndef KAATCP_COMMON_H_
18 #define KAATCP_COMMON_H_
24 #include <platform/defaults.h>
26 #define KAATCP_PROTOCOL_NAME_MAX_SIZE 10
28 #define FIRST_BIT 0x80
29 #define MAX_MESSAGE_TYPE_LENGTH 0x0F
30 #define MAX_MESSAGE_LENGTH 0x0FFFFFFF
31 #define PROTOCOL_VERSION 0x01
33 #define KAA_SYNC_HEADER_LENGTH 12
34 #define KAA_SYNC_ZIPPED_BIT 0x02
35 #define KAA_SYNC_ENCRYPTED_BIT 0x04
36 #define KAA_SYNC_REQUEST_BIT 0x01
37 #define KAA_SYNC_SYNC_BIT 0x10
38 #define KAA_SYNC_BOOTSTRAP_BIT 0x20
40 #define KAA_BOOTSTRAP_RSA_PKSC8 0x01
41 #define KAA_BOOTSTRAP_CHANNEL_HTTP 0x01
42 #define KAA_BOOTSTRAP_CHANNEL_HTTPLP 0x02
43 #define KAA_BOOTSTRAP_CHANNEL_KAATCP 0x03
45 #define KAA_CONNECT_FLAGS 0x02
46 #define KAA_CONNECT_HEADER_LENGTH 18
48 #define KAA_CONNECT_KEY_AES_RSA 0x11
49 #define KAA_CONNECT_SIGNATURE_SHA1 0x01
51 #define KAA_TCP_NAME "Kaatcp"
52 #define KAA_TCP_NAME_LENGTH 6
54 #define KAA_PING_MESSAGE_SIZE 2
55 #define KAA_DISCONNECT_MESSAGE_SIZE 4
uint8_t connect_flags
Definition: kaatcp_common.h:82
uint16_t return_code
Definition: kaatcp_common.h:114
Definition: kaatcp_common.h:62
Definition: kaatcp_common.h:120
Definition: kaatcp_common.h:106
Definition: kaatcp_common.h:73
Definition: kaatcp_common.h:105
uint8_t signature_flags
Definition: kaatcp_common.h:87
kaatcp_connack_code_t
Definition: kaatcp_common.h:102
uint16_t reason
Definition: kaatcp_common.h:125
uint8_t session_key_flags
Definition: kaatcp_common.h:86
Definition: kaatcp_common.h:118
size_t sync_request_size
Definition: kaatcp_common.h:140
Definition: kaatcp_common.h:71
Definition: kaatcp_common.h:113
Definition: kaatcp_common.h:124
kaatcp_error_t
Definition: kaatcp_common.h:57
Definition: kaatcp_common.h:76
uint16_t protocol_name_length
Definition: kaatcp_common.h:77
Definition: kaatcp_common.h:72
size_t signature_size
Definition: kaatcp_common.h:94
Definition: kaatcp_common.h:70
kaatcp_kaasync_header_t sync_header
Definition: kaatcp_common.h:138
Definition: kaatcp_common.h:59
Definition: kaatcp_common.h:104
Definition: kaatcp_common.h:137
char * sync_request
Definition: kaatcp_common.h:141
Definition: kaatcp_common.h:67
Definition: kaatcp_common.h:103
Definition: kaatcp_common.h:107
kaatcp_message_type_t
Definition: kaatcp_common.h:66
kaatcp_disconnect_reason_t
Definition: kaatcp_common.h:117
Definition: kaatcp_common.h:60
size_t sync_request_size
Definition: kaatcp_common.h:97
Definition: kaatcp_common.h:61
char * sync_request
Definition: kaatcp_common.h:98
Definition: kaatcp_common.h:63
#define KAATCP_PROTOCOL_NAME_MAX_SIZE
Definition: kaatcp_common.h:26
Definition: kaatcp_common.h:58
uint16_t keep_alive
Definition: kaatcp_common.h:89
size_t session_key_size
Definition: kaatcp_common.h:91
Definition: kaatcp_common.h:68
Definition: kaatcp_common.h:69
char * session_key
Definition: kaatcp_common.h:92
uint8_t protocol_version
Definition: kaatcp_common.h:80
Definition: kaatcp_common.h:110
Definition: kaatcp_common.h:109
Definition: kaatcp_common.h:121
char * signature
Definition: kaatcp_common.h:95
Definition: kaatcp_common.h:108
uint32_t next_ptorocol_id
Definition: kaatcp_common.h:84
Definition: kaatcp_common.h:119