dccutil.h 2.1 KB

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