1 | #ifndef MYSQL_AUTH_DIALOG_CLIENT_INCLUDED |
2 | /* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab |
3 | |
4 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by |
6 | the Free Software Foundation; version 2 of the License. |
7 | |
8 | This program is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | GNU General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU General Public License |
14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ |
16 | |
17 | /** |
18 | @file |
19 | |
20 | Definitions needed to use Dialog client authentication plugin |
21 | */ |
22 | |
23 | struct st_mysql; |
24 | |
25 | #define MYSQL_AUTH_DIALOG_CLIENT_INCLUDED |
26 | |
27 | /** |
28 | type of the mysql_authentication_dialog_ask function |
29 | |
30 | @param mysql mysql |
31 | @param type type of the input |
32 | 1 - ordinary string input |
33 | 2 - password string |
34 | @param prompt prompt |
35 | @param buf a buffer to store the use input |
36 | @param buf_len the length of the buffer |
37 | |
38 | @retval a pointer to the user input string. |
39 | It may be equal to 'buf' or to 'mysql->password'. |
40 | In all other cases it is assumed to be an allocated |
41 | string, and the "dialog" plugin will free() it. |
42 | */ |
43 | typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql, |
44 | int type, const char *prompt, char *buf, int buf_len); |
45 | |
46 | /** |
47 | first byte of the question string is the question "type". |
48 | It can be an "ordinary" or a "password" question. |
49 | The last bit set marks a last question in the authentication exchange. |
50 | */ |
51 | #define ORDINARY_QUESTION "\2" |
52 | #define LAST_QUESTION "\3" |
53 | #define PASSWORD_QUESTION "\4" |
54 | #define LAST_PASSWORD "\5" |
55 | |
56 | #endif |
57 | |