dccutil.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef _DCCUTIL_H
  2. #define _DCCUTIL_H
  3. #include "common.h"
  4. #include "dcc.h"
  5. #include "auth.h"
  6. #define dprintf dprintf_eggdrop
  7. /* Public structure for the listening port map */
  8. struct portmap {
  9. port_t realport;
  10. port_t mappedto;
  11. struct portmap *next;
  12. };
  13. namespace bd {
  14. class Stream;
  15. }
  16. /* Fake idx's for dprintf - these should be ridiculously large +ve nums
  17. */
  18. #define DP_STDOUT 0x7FF1
  19. //#define DP_LOG 0x7FF2
  20. #define DP_DEBUG 0x7FF2
  21. #define DP_SERVER 0x7FF3
  22. #define DP_HELP 0x7FF4
  23. #define DP_STDERR 0x7FF5
  24. #define DP_MODE 0x7FF6
  25. #define DP_MODE_NEXT 0x7FF7
  26. #define DP_SERVER_NEXT 0x7FF8
  27. #define DP_HELP_NEXT 0x7FF9
  28. #define DP_DUMP 0x8000
  29. #define DP_CACHE 0x8001
  30. void init_dcc(void);
  31. void dumplots(int, const char *, const char *);
  32. void dprintf(int, const char *, ...) __attribute__((format(printf, 2, 3)));
  33. void chatout(const char *, ...) __attribute__((format(printf, 1, 2)));
  34. void chanout_but(int, int, const char *, ...) __attribute__((format(printf, 3, 4)));
  35. void dcc_chatter(int);
  36. void lostdcc(int);
  37. void makepass(char *);
  38. void tell_dcc(int);
  39. void not_away(int);
  40. void set_away(int, char *);
  41. void dcc_remove_lost(void);
  42. void flush_lines(int, struct chat_info *);
  43. struct dcc_t *find_idx(int);
  44. int new_dcc(struct dcc_table *, int);
  45. void del_dcc(int);
  46. char *add_cr(char *);
  47. void changeover_dcc(int, struct dcc_table *, int);
  48. void do_boot(int, const char *, const char *);
  49. int detect_dcc_flood(time_t *, struct chat_info *, int);
  50. void identd_open(const char * = NULL, const char * = NULL, int identd = 1);
  51. void identd_close();
  52. int listen_all(port_t, bool, bool);
  53. bool valid_idx(int);
  54. int dcc_read(bd::Stream&);
  55. void dcc_write(bd::Stream&, int);
  56. int check_cmd_pass(const char *, char *);
  57. int has_cmd_pass(const char *);
  58. void set_cmd_pass(char *, int);
  59. void cmdpass_free(struct cmd_pass *);
  60. extern int max_dcc;
  61. extern interval_t connect_timeout;
  62. #endif /* !_DCCUTIL_H */