00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _LIMIT_SERVER_PROTOCOL_H_INCLUDED_
00022 #define _LIMIT_SERVER_PROTOCOL_H_INCLUDED_
00023
00027 enum limit_server_protocol_types
00028 {
00029 limit_server_protocol_check,
00030 limit_server_protocol_update,
00031 limit_server_protocol_send_diff,
00032 limit_server_protocol_register,
00033 limit_server_update_add_dest,
00034 limit_server_update_diff,
00035 limit_server_update_dest_diff,
00036 limit_server_update_dest_host_diff,
00037 limit_server_update_set_dest_specyfic_config,
00038 limit_server_update_dest_host_send_diff,
00040 limit_server_request_uid,
00041 limit_server_answer_uid
00042 };
00043
00047 struct limit_server_update_add_dest_s
00048 {
00049 uint32_t length;
00050 char proto;
00051 uint32_t change_count;
00052 struct dest_entry
00053 {
00054 uint32_t length;
00055 char dest[255];
00056
00057 char check_mode;
00058 unsigned char zone_index;
00059 int ttl;
00061
00062 long long traffic_month;
00063 long long traffic_day;
00064 long long traffic_quarter;
00065
00066
00067 long long hosting_traffic_month;
00068 long long hosting_traffic_day;
00069 long long hosting_traffic_quarter;
00070
00071 char ban;
00072 char allow;
00073 } __attribute__((__packed__));
00074
00075
00076
00077 } __attribute__((__packed__));
00078 typedef struct limit_server_update_add_dest_s limit_server_update_add_dest_t;
00079
00085 struct limit_server_update_diff_s
00086 {
00087 uint32_t length;
00088 char proto;
00089 uint32_t diff_count;
00090 uint32_t dest_length;
00091 char dest[255];
00092 struct diff_entry
00093 {
00094
00095
00096 long long traffic_month;
00097 long long traffic_day;
00098 long long traffic_quarter;
00099 union {
00100 time_t timestamp;
00101 long long place_holder;
00102 };
00103 uint32_t length;
00104
00105 } __attribute__((__packed__));
00106
00107
00108
00109 } __attribute__((__packed__));
00110 typedef struct limit_server_update_diff_s limit_server_update_diff_t;
00111
00118 struct limit_server_check_s
00119 {
00120 uint32_t length;
00121 char proto;
00122 uint32_t XUID_len;
00123 char XUID[255];
00124
00125 } __attribute__((__packed__));
00126 typedef struct limit_server_check_s limit_server_check_t;
00127
00131 struct limit_server_update_s
00132 {
00133 uint32_t length;
00134 char proto;
00135 uint32_t XUID_len;
00136 char XUID[255];
00137 long long diff;
00138 } __attribute__((__packed__));
00139 typedef struct limit_server_update_s limit_server_update_t;
00140
00144 struct limit_server_send_diff_s
00145 {
00146 uint32_t length;
00147 char proto;
00148 } __attribute__((__packed__));
00149 typedef struct limit_server_send_diff_s limit_server_send_diff_t;
00150
00154 struct limit_server_register_s
00155 {
00156 uint32_t length;
00157 char proto;
00158 uint32_t host_length;
00159 char host[255];
00160 uint32_t port;
00161 } __attribute__((__packed__));
00162 typedef struct limit_server_register_s limit_server_register_t;
00163
00167 struct limit_server_update_set_dest_specyfic_config_s
00168 {
00169 uint32_t length;
00170 char proto;
00171 uint32_t info_count;
00172 uint32_t dest_length;
00173 char dest[255];
00174 struct info_entry
00175 {
00176
00177
00178 unsigned char zone_index;
00179 long long traffic_month;
00180 long long traffic_day;
00181 long long traffic_quarter;
00182 char ban;
00183 char allow;
00184 uint32_t length;
00185
00186 } __attribute__((__packed__));
00187 } __attribute__((__packed__));
00188 typedef struct limit_server_update_set_dest_specyfic_config_s limit_server_update_set_dest_specyfic_config_t;
00189
00193 struct limit_server_update_dest_host_diff_s
00194 {
00195 uint32_t length;
00196 char proto;
00197 uint32_t dest_length;
00198 char dest[255];
00199 long long traffic_month;
00200 long long traffic_day;
00201 long long traffic_quarter;
00202 } __attribute__((__packed__));
00203 typedef struct limit_server_update_dest_host_diff_s limit_server_update_dest_host_diff_t;
00204
00208 struct limit_server_update_dest_host_send_diff_s
00209 {
00210 uint32_t length;
00211 char proto;
00212 uint32_t dest_length;
00213 char dest[255];
00214 long long traffic_month;
00215 long long traffic_day;
00216 long long traffic_quarter;
00217 } __attribute__((__packed__));
00218 typedef struct limit_server_update_dest_host_send_diff_s limit_server_update_dest_host_send_diff_t;
00219
00220
00224 struct limit_server_request_uid_s
00225 {
00226 uint32_t length;
00227 char proto;
00228 uint32_t dest_length;
00229 char dest[255];
00230 uint32_t uid_length;
00231 char uid[255];
00232 } __attribute__((__packed__));
00233 typedef struct limit_server_request_uid_s limit_server_request_uid_t;
00234
00235
00239 struct limit_server_answer_uid_s
00240 {
00241 uint32_t length;
00242 char proto;
00243 uint32_t dest_length;
00244 char dest[255];
00245 uint32_t uid_length;
00246 char uid[255];
00247 long long traffic_month;
00248 long long traffic_day;
00249 long long traffic_quarter;
00250 } __attribute__((__packed__));
00251 typedef struct limit_server_answer_uid_s limit_server_answer_uid_t;
00252 #endif