~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle_com.h

  • Committer: Monty Taylor
  • Date: 2008-09-15 00:46:33 UTC
  • mfrom: (383.1.55 client-split)
  • Revision ID: monty@inaugust.com-20080915004633-fmjw27fi41cxs35w
Merged from client-split.

Show diffs side-by-side

added added

removed removed

Lines of Context:
416
416
extern "C" {
417
417
#endif
418
418
 
419
 
bool    my_net_init(NET *net, Vio* vio);
420
 
void    my_net_local_init(NET *net);
421
 
void    net_end(NET *net);
422
 
void    net_clear(NET *net, bool clear_buffer);
423
 
bool    net_realloc(NET *net, size_t length);
424
 
bool    net_flush(NET *net);
425
 
bool    my_net_write(NET *net,const unsigned char *packet, size_t len);
426
 
bool    net_write_command(NET *net,unsigned char command,
427
 
                          const unsigned char *header, size_t head_len,
428
 
                          const unsigned char *packet, size_t len);
429
 
int32_t net_real_write(NET *net,const unsigned char *packet, size_t len);
430
 
uint32_t my_net_read(NET *net);
 
419
  bool my_net_init(NET *net, Vio* vio);
 
420
  void my_net_local_init(NET *net);
 
421
  void net_end(NET *net);
 
422
  void net_clear(NET *net, bool clear_buffer);
 
423
  bool net_realloc(NET *net, size_t length);
 
424
  bool net_flush(NET *net);
 
425
  bool my_net_write(NET *net,const unsigned char *packet, size_t len);
 
426
  bool net_write_command(NET *net,unsigned char command,
 
427
                         const unsigned char *header, size_t head_len,
 
428
                         const unsigned char *packet, size_t len);
 
429
  int32_t net_real_write(NET *net,const unsigned char *packet, size_t len);
 
430
  uint32_t my_net_read(NET *net);
 
431
  void net_close(NET *net);
 
432
  bool net_init_sock(NET * net, int sock, int flags);
 
433
  bool net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
 
434
  void net_keepalive(NET *net, bool flag);
 
435
  int net_get_sd(NET *net);
 
436
  bool net_should_close(NET *net);
 
437
  bool net_more_data(NET *net);
431
438
 
432
439
 
433
440
/** @TODO global.h is actually not needed here... only stdint and protocol.h */
434
441
#ifdef DRIZZLE_SERVER_GLOBAL_H
435
 
void my_net_set_write_timeout(NET *net, uint timeout);
436
 
void my_net_set_read_timeout(NET *net, uint timeout);
 
442
  void my_net_set_write_timeout(NET *net, uint timeout);
 
443
  void my_net_set_read_timeout(NET *net, uint timeout);
437
444
#endif
438
445
 
439
 
struct rand_struct {
440
 
  unsigned long seed1,seed2,max_value;
441
 
  double max_value_dbl;
442
 
};
 
446
  struct rand_struct {
 
447
    unsigned long seed1,seed2,max_value;
 
448
    double max_value_dbl;
 
449
  };
443
450
 
444
451
#ifdef __cplusplus
445
452
}
493
500
  implemented in sql/password.c
494
501
*/
495
502
 
496
 
void randominit(struct rand_struct *, uint32_t seed1, uint32_t seed2);
497
 
double my_rnd(struct rand_struct *);
498
 
void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
499
 
 
500
 
void hash_password(uint32_t *to, const char *password, uint32_t password_len);
501
 
 
502
 
void make_scrambled_password(char *to, const char *password);
503
 
void scramble(char *to, const char *message, const char *password);
504
 
bool check_scramble(const char *reply, const char *message,
505
 
                       const unsigned char *hash_stage2);
506
 
void get_salt_from_password(unsigned char *res, const char *password);
507
 
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
508
 
char *octet2hex(char *to, const char *str, unsigned int len);
 
503
  void randominit(struct rand_struct *, uint32_t seed1, uint32_t seed2);
 
504
  double my_rnd(struct rand_struct *);
 
505
  void create_random_string(char *to, unsigned int length,
 
506
                            struct rand_struct *rand_st);
 
507
 
 
508
  void hash_password(uint32_t *to, const char *password, uint32_t password_len);
 
509
 
 
510
  void make_scrambled_password(char *to, const char *password);
 
511
  void scramble(char *to, const char *message, const char *password);
 
512
  bool check_scramble(const char *reply, const char *message,
 
513
                      const unsigned char *hash_stage2);
 
514
  void get_salt_from_password(unsigned char *res, const char *password);
 
515
  void make_password_from_salt(char *to, const unsigned char *hash_stage2);
 
516
  char *octet2hex(char *to, const char *str, unsigned int len);
509
517
 
510
518
/* end of password.c */
511
519
 
512
 
char *get_tty_password(const char *opt_message);
513
 
const char *drizzle_errno_to_sqlstate(unsigned int drizzle_errno);
 
520
  char *get_tty_password(const char *opt_message);
 
521
  const char *drizzle_errno_to_sqlstate(unsigned int drizzle_errno);
514
522
 
515
523
/** @TODO Is it necessary to include all of drizzled/global.h here? */
516
524
#ifdef DRIZZLE_SERVER_GLOBAL_H
517
 
uint32_t net_field_length(uchar **packet);
518
 
uint64_t net_field_length_ll(uchar **packet);
519
 
uchar *net_store_length(uchar *pkg, uint64_t length);
 
525
  uint32_t net_field_length(uchar **packet);
 
526
  uint64_t net_field_length_ll(uchar **packet);
 
527
  uchar *net_store_length(uchar *pkg, uint64_t length);
520
528
#endif
521
529
 
522
530
#ifdef __cplusplus