1
0

settings.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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[33];
  9. char hash[49];
  10. char packname[65];
  11. char shellhash[65];
  12. char bdhash[65];
  13. char owners[513];
  14. char hubs[513];
  15. char owneremail[385];
  16. char salt1[33];
  17. char salt2[17];
  18. char dcc_prefix[17];
  19. /* -- DYNAMIC -- */
  20. char bots[1025];
  21. char uid[17];
  22. char autouname[17]; /* should we just auto update any changed in uname output? */
  23. char pscloak[17]; /* should the bots bother trying to cloak `ps`? */
  24. char autocron[17]; /* should the bot auto crontab itself? */
  25. char watcher[17]; /* spawn a watcher pid to block ptrace? */
  26. char uname[113];
  27. char username[49]; /* shell username */
  28. char datadir[1025];
  29. char homedir[1025]; /* homedir */
  30. char binpath[1025]; /* path to binary, ie: ~/ */
  31. char binname[113]; /* binary name, ie: .sshrc */
  32. char portmin[17]; /* for hubs, the reserved port range for incoming connections */
  33. char portmax[17]; /* for hubs, the reserved port range for incoming connections */
  34. /* -- PADDING -- */
  35. char padding[8];
  36. } settings_t;
  37. #define SIZE_PACK sizeof(settings.hash) + sizeof(settings.packname) + sizeof(settings.shellhash) + \
  38. sizeof(settings.bdhash) + sizeof(settings.owners) + sizeof(settings.hubs) + sizeof(settings.owneremail) + \
  39. sizeof(settings.salt1) + sizeof(settings.salt2) + sizeof(settings.dcc_prefix)
  40. #define SIZE_CONF sizeof(settings.bots) + sizeof(settings.uid) + sizeof(settings.autouname) + \
  41. sizeof(settings.pscloak) + sizeof(settings.autocron) + sizeof(settings.watcher) + sizeof(settings.uname) + \
  42. sizeof(settings.username) + sizeof(settings.homedir) + sizeof(settings.binpath) + sizeof(settings.binname) + \
  43. sizeof(settings.portmin) + sizeof(settings.portmin) + sizeof(settings.datadir)
  44. #define SIZE_PAD sizeof(settings.padding)
  45. #define SIZE_SETTINGS sizeof(settings_t)
  46. extern settings_t settings;
  47. #endif /* !_SETTINGS_H */