A library for a decentralised peer-to-peer chat over IPv6 only.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

lc6_common.h 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef LC6_COMMON_H
  2. #define LC6_COMMON_H
  3. #include <sys/param.h>
  4. #include <arpa/inet.h>
  5. #include "../inc/libchat6.h"
  6. typedef struct LC6_NODE {
  7. unsigned char *pub_key;
  8. unsigned char *priv_key;
  9. } LC6_NODE;
  10. typedef struct LC6_USER {
  11. struct LC6_USER *prev;
  12. struct LC6_USER *next;
  13. unsigned char nickname[256];
  14. unsigned char pub_key[32];
  15. unsigned char priv_key[32];
  16. unsigned char icon[32768];
  17. unsigned int status;
  18. } LC6_USER;
  19. #define LC6_CONFIG_BOOTSTRAP "bootstrap.bin"
  20. #define LC6_CONFIG_USER "user.bin"
  21. #define LC6_CONFIG_FRIENDS "friends.bin"
  22. typedef struct LC6_BOOTSTRAP {
  23. struct LC6_BOOTSTRAP *prev;
  24. struct LC6_BOOTSTRAP *next;
  25. time_t last_contact;
  26. int af;
  27. union addr {
  28. struct in_addr inet;
  29. struct in6_addr inet6;
  30. } addr;
  31. } LC6_BOOTSTRAP;
  32. typedef struct LC6_CTX {
  33. char path[MAXPATHLEN];
  34. LC6_USER *user;
  35. LC6_USER *node;
  36. LC6_USER *friends;
  37. LC6_BOOTSTRAP *bootstrap;
  38. } LC6_CTX;
  39. #endif