client_plugin.h.pp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. struct st_mysql_client_plugin
  2. {
  3. int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *);
  4. };
  5. struct st_mysql;
  6. typedef struct st_plugin_vio_info
  7. {
  8. enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET,
  9. MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol;
  10. int socket;
  11. } MYSQL_PLUGIN_VIO_INFO;
  12. typedef struct st_plugin_vio
  13. {
  14. int (*read_packet)(struct st_plugin_vio *vio,
  15. unsigned char **buf);
  16. int (*write_packet)(struct st_plugin_vio *vio,
  17. const unsigned char *packet,
  18. int packet_len);
  19. void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
  20. } MYSQL_PLUGIN_VIO;
  21. struct st_mysql_client_plugin_AUTHENTICATION
  22. {
  23. int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *);
  24. int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
  25. };
  26. struct st_mysql;
  27. typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
  28. int type, const char *prompt, char *buf, int buf_len);
  29. struct st_mysql_client_plugin *
  30. mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
  31. int argc, ...);
  32. struct st_mysql_client_plugin *
  33. mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
  34. int argc, va_list args);
  35. struct st_mysql_client_plugin *
  36. mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
  37. struct st_mysql_client_plugin *
  38. mysql_client_register_plugin(struct st_mysql *mysql,
  39. struct st_mysql_client_plugin *plugin);
  40. int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
  41. const char *option, const void *value);