RTypes.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef RTypes_H
  2. #define RTypes_H
  3. // This file is generated from src/rtypes.rs using cbindgen
  4. #include "RTypesPrefix.h"
  5. typedef enum {
  6. /**
  7. * New CryptoAuth session, has not sent or received anything
  8. */
  9. RTypes_CryptoAuth_State_t_Init = 0,
  10. /**
  11. * Sent a hello message, waiting for reply
  12. */
  13. RTypes_CryptoAuth_State_t_SentHello = 1,
  14. /**
  15. * Received a hello message, have not yet sent a reply
  16. */
  17. RTypes_CryptoAuth_State_t_ReceivedHello = 2,
  18. /**
  19. * Received a hello message, sent a key message, waiting for the session to complete
  20. */
  21. RTypes_CryptoAuth_State_t_SentKey = 3,
  22. /**
  23. * Sent a hello message, received a key message, may or may not have sent some data traffic
  24. * but no data traffic has yet been received
  25. */
  26. RTypes_CryptoAuth_State_t_ReceivedKey = 4,
  27. /**
  28. * Received data traffic, session is in run state
  29. */
  30. RTypes_CryptoAuth_State_t_Established = 100,
  31. } RTypes_CryptoAuth_State_t;
  32. typedef struct {
  33. Iface_t *internal;
  34. Iface_t *external;
  35. } RTypes_IfWrapper_t;
  36. typedef struct {
  37. uintptr_t len;
  38. String_t **items;
  39. } RTypes_StrList_t;
  40. typedef struct {
  41. /**
  42. * Number of packets which were lost
  43. */
  44. uint64_t lost_packets;
  45. /**
  46. * Number of packets which were received but could not be validated
  47. */
  48. uint64_t received_unexpected;
  49. /**
  50. * Number of packets which were received (since last session setup)
  51. */
  52. uint64_t received_packets;
  53. /**
  54. * Number of packets which were received that were duplicates
  55. */
  56. uint64_t duplicate_packets;
  57. } RTypes_CryptoStats_t;
  58. typedef struct {
  59. RTypes_IfWrapper_t a;
  60. RTypes_StrList_t b;
  61. RTypes_CryptoAuth_State_t c;
  62. RTypes_CryptoStats_t d;
  63. } RTypes_ExportMe;
  64. #endif /* RTypes_H */