auth_dialog_client.h 2.0 KB

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