persist_write_stubs.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #include <time.h>
  2. #define WITH_BROKER
  3. #include <logging_mosq.h>
  4. #include <memory_mosq.h>
  5. #include <mosquitto_broker_internal.h>
  6. #include <net_mosq.h>
  7. #include <send_mosq.h>
  8. #include <time_mosq.h>
  9. extern uint64_t last_retained;
  10. extern char *last_sub;
  11. extern int last_qos;
  12. struct mosquitto *context__init(mosq_sock_t sock)
  13. {
  14. UNUSED(sock);
  15. return mosquitto__calloc(1, sizeof(struct mosquitto));
  16. }
  17. int log__printf(struct mosquitto *mosq, unsigned int priority, const char *fmt, ...)
  18. {
  19. UNUSED(mosq);
  20. UNUSED(priority);
  21. UNUSED(fmt);
  22. return 0;
  23. }
  24. time_t mosquitto_time(void)
  25. {
  26. return 123;
  27. }
  28. int net__socket_close(struct mosquitto *mosq)
  29. {
  30. UNUSED(mosq);
  31. return MOSQ_ERR_SUCCESS;
  32. }
  33. int send__pingreq(struct mosquitto *mosq)
  34. {
  35. UNUSED(mosq);
  36. return MOSQ_ERR_SUCCESS;
  37. }
  38. int mosquitto_acl_check(struct mosquitto *context, const char *topic, uint32_t payloadlen, void* payload, uint8_t qos, bool retain, int access)
  39. {
  40. UNUSED(context);
  41. UNUSED(topic);
  42. UNUSED(payloadlen);
  43. UNUSED(payload);
  44. UNUSED(qos);
  45. UNUSED(retain);
  46. UNUSED(access);
  47. return MOSQ_ERR_SUCCESS;
  48. }
  49. int acl__find_acls(struct mosquitto *context)
  50. {
  51. UNUSED(context);
  52. return MOSQ_ERR_SUCCESS;
  53. }
  54. int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint32_t payloadlen, const void *payload, uint8_t qos, bool retain, bool dup, const mosquitto_property *cmsg_props, const mosquitto_property *store_props, uint32_t expiry_interval)
  55. {
  56. UNUSED(mosq);
  57. UNUSED(mid);
  58. UNUSED(topic);
  59. UNUSED(payloadlen);
  60. UNUSED(payload);
  61. UNUSED(qos);
  62. UNUSED(retain);
  63. UNUSED(dup);
  64. UNUSED(cmsg_props);
  65. UNUSED(store_props);
  66. UNUSED(expiry_interval);
  67. return MOSQ_ERR_SUCCESS;
  68. }
  69. int send__pubcomp(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties)
  70. {
  71. UNUSED(mosq);
  72. UNUSED(mid);
  73. UNUSED(properties);
  74. return MOSQ_ERR_SUCCESS;
  75. }
  76. int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, const mosquitto_property *properties)
  77. {
  78. UNUSED(mosq);
  79. UNUSED(mid);
  80. UNUSED(reason_code);
  81. UNUSED(properties);
  82. return MOSQ_ERR_SUCCESS;
  83. }
  84. int send__pubrel(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties)
  85. {
  86. UNUSED(mosq);
  87. UNUSED(mid);
  88. UNUSED(properties);
  89. return MOSQ_ERR_SUCCESS;
  90. }