00001
00002
00003
00004
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008
00009
00010 #ifndef MY_MYSQL_INTERFACE_HEADER_FILE_
00011 #define MY_MYSQL_INTERFACE_HEADER_FILE_
00012
00013 #include "mysql_header.h"
00014 #include "tables.h"
00015 #include "server_config.h"
00016 #include "packets_data.h"
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #define MYSQL_INTERFACE_REQUEST_SKIPED -1
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #define MYSQL_INTERFACE_CONNECTION_LOST -2
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 #define MYSQL_INTERFACE_RECONNECTION_FAILED -3
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #define MYSQL_INTERFACE_SQL_PROBLEM -4
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 #define MYSQL_INTERFACE_UNEXPECTED_ERROR -5
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 #define MYSQL_INTERFACE_NOT_FOUND -6
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152 #define MYSQL_INTERFACE_MORE_THAN_ONE -7
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163 #define MYSQL_INTERFACE_TOO_MANY_ITEMS -8
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 #define MYSQL_INTERFACE_NO_TIMESTAMP -9
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186 #define MYSQL_INTERFACE_NO_LEASE_ID -10
00187
00188
00189
00190
00191
00192
00193
00194
00195 #define MYSQL_INTERFACE_NO_IP_FOUND -11
00196
00197
00198
00199
00200
00201
00202
00203
00204 #define MYSQL_INTERFACE_MAC_ADDRESS_FOUND -12
00205
00206
00207
00208
00209
00210 #ifdef TESTS_UNITAIRES
00211
00212 int load_abonnes (struct smysql *mysql_info,
00213 struct mysql_tables *mysql_tables,
00214 struct global_config *config);
00215 int load_vlan (struct smysql *mysql_info,
00216 struct smysql *mysql_tables,
00217 struct mysql_tables *mysql_info_pool,
00218 struct global_config *config);
00219 int load_ip_lease (struct smysql *mysql_info,
00220 struct mysql_tables *mysql_tables,
00221 struct global_config *config);
00222 int load_pool (struct smysql *mysql_info,
00223 struct mysql_tables *mysql_tables,
00224 struct global_config *config);
00225 int try_reserve_ip_from_pool (struct smysql *mysql_info,
00226 struct mysql_tables *mysql_tables,
00227 struct global_config *config,
00228 unsigned long int timeout);
00229 int try_find_and_reserve_ip_from_pool (struct smysql *mysql_info,
00230 struct mysql_tables *mysql_tables,
00231 struct global_config *config,
00232 unsigned long int timeout);
00233 int send_to_radonline (struct smysql *mysql_info,
00234 struct mysql_tables *mysql_tables,
00235 char *ip,
00236 int action,
00237 struct global_config *config);
00238 int send_to_mydns (struct smysql *mysql_info,
00239 struct mysql_tables *mysql_tables,
00240 char *ip,
00241 int action,
00242 struct global_config *config);
00243
00244 #ifdef NOT_USED
00245
00246 int select_login_modem_from_logistic (struct smysql *mysql_info,
00247 char *login_modem,
00248 struct global_config *config);
00249 int delete_mac_address_from_logistic (struct smysql *mysql_info,
00250 char *mac_address,
00251 struct global_config *config);
00252
00253 #endif
00254
00255 #endif
00256
00257 int mydns_init (struct smysql *mysql_info);
00258
00259 void clear_tables (struct mysql_tables *mysql_tables);
00260 int get_ip_from_pool (struct smysql *mysql_info,
00261 struct mysql_tables *mysql_tables,
00262 struct global_config *config,
00263 unsigned int timeout,
00264 int reserve_ip);
00265 int load_context (struct smysql *mysql_info,
00266 struct smysql *mysql_info_write,
00267 struct mysql_tables *mysql_tables,
00268 struct global_config *config);
00269 int load_abonne_ip (struct smysql *mysql_info,
00270 struct mysql_tables *mysql_tables,
00271 struct global_config *config);
00272 int load_options (struct smysql *mysql_info,
00273 struct mysql_tables *mysql_tables,
00274 struct global_config *config);
00275 int find_ip_in_vlan_pool (struct smysql *mysql_info,
00276 struct mysql_tables *mysql_tables,
00277 struct global_config *config);
00278 int release_ip_from_pool (struct smysql *mysql_info,
00279 struct mysql_tables *mysql_tables,
00280 struct global_config *config);
00281 int send_to_radonline (struct smysql *mysql_info,
00282 struct mysql_tables *mysql_tables,
00283 char *ip,
00284 int action,
00285 struct global_config *config);
00286 int send_to_mydns (struct smysql *mysql_info,
00287 struct mysql_tables *mysql_tables,
00288 char *ip,
00289 int action,
00290 struct global_config *config);
00291 int load_logistic (struct smysql *mysql_info,
00292 struct mysql_tables *mysql_tables,
00293 struct global_config *config);
00294 int blackhole_abonne (struct smysql *mysql_info,
00295 struct mysql_tables *mysql_tables,
00296 struct global_config *config);
00297 int nack_flag_abonne (struct smysql *mysql_info,
00298 struct mysql_tables *mysql_tables,
00299 struct global_config *config,
00300 unsigned long int new_value);
00301 int set_flag_check_radius (struct smysql *mysql_info,
00302 struct mysql_tables *mysql_tables,
00303 struct global_config *config);
00304 int signal_unknown_mac_address (struct smysql *mysql_info,
00305 struct mysql_tables *mysql_tables,
00306 struct global_config *config);
00307 int remove_autoconf_bh (struct smysql *mysql_info,
00308 struct mysql_tables *mysql_tables,
00309 struct global_config *config);
00310
00311 #endif
00312
00313 #ifdef __cplusplus
00314 }
00315 #endif
00316