GlobalConfig.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* vim: set expandtab ts=4 sw=4: */
  2. /*
  3. * You may redistribute this program and/or modify it under the terms of
  4. * the GNU General Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #ifndef GlobalConfig_H
  16. #define GlobalConfig_H
  17. #include "benc/String.h"
  18. #include "memory/Allocator.h"
  19. #include "util/Linker.h"
  20. Linker_require("util/GlobalConfig.c");
  21. /**
  22. * Cjdns is mostly a very well structured project, there is not a lot of
  23. * communication between modules. However there are a couple of things
  24. * which are concerns of a number of very different modules. For example
  25. * the name of the TUN device which you have configured is important to
  26. * the UDP interface because it doesn't want to broadcast messages down
  27. * that interface, also it's interesting to the IpTunnel because the
  28. * IpTunnel needs to make routes to the TUN device.
  29. *
  30. * This file is for those things which for very good reason, simply need
  31. * to violate the architecture of cjdns and communicate between far away
  32. * modules. Things which make sense to be in here might include peers'
  33. * IP addresses. Please don't use this to break the architecture when it
  34. * is not strictly needed.
  35. */
  36. struct GlobalConfig {
  37. int unused;
  38. };
  39. String* GlobalConfig_getTunName(struct GlobalConfig* conf);
  40. void GlobalConfig_setTunName(struct GlobalConfig* conf, String* name);
  41. struct GlobalConfig* GlobalConfig_new(struct Allocator* alloc);
  42. #endif