Browse Source

Expose stream load and network APIs with C linkage

master
evgeny 3 days ago
parent
commit
bee7bdaa70
  1. 7
      src/stream/stream_load.h
  2. 7
      src/stream/stream_network.h
  3. 7
      src/stream/stream_wire.h

7
src/stream/stream_load.h

@ -7,6 +7,10 @@
#include "stream_proto.h"
#ifdef __cplusplus
extern "C" {
#endif
#define STREAM_LOAD_PERIOD_MS 200
#define STREAM_LOAD_HISTORY 50
#define STREAM_LOAD_CONFIRM_MS 500
@ -38,4 +42,7 @@ int stream_load_add(struct stream_load *load, uint64_t packets, uint64_t bytes);
int stream_load_remove(struct stream_load *load, uint64_t packets, uint64_t bytes, int sent);
void stream_load_changed(struct stream_load *load);
int stream_load_poll(struct stream_load *load, uint64_t now_ms, uint64_t oldest_age_ms, struct stream_load_snapshot *snapshot);
#ifdef __cplusplus
}
#endif
#endif

7
src/stream/stream_network.h

@ -9,6 +9,10 @@
#include "stream_wire.h"
#include "stream_load.h"
#ifdef __cplusplus
extern "C" {
#endif
struct stream_network;
struct STREAM_RECEIVE;
enum stream_receive_state { STREAM_RECEIVE_CONNECTING, STREAM_RECEIVE_INFO, STREAM_RECEIVE_REQUESTED,
@ -47,4 +51,7 @@ void stream_network_cancel(struct stream_network *network, const struct stream_d
void stream_network_membership_changed(struct stream_network *network, uint64_t node_id, const char *channel);
void stream_network_cache_event(struct stream_network *network, const struct stream_descriptor *descriptor,
const uint8_t *wire, size_t length, int added);
#ifdef __cplusplus
}
#endif
#endif

7
src/stream/stream_wire.h

@ -6,6 +6,10 @@
#include "stream_proto.h"
#include "stream_metrics.h"
#ifdef __cplusplus
extern "C" {
#endif
#define STREAM_WIRE_VERSION 2
#define STREAM_WIRE_HEADER 52
#define STREAM_PATH_MAX 32
@ -48,4 +52,7 @@ int stream_metric_read(const uint8_t *wire, struct stream_metric_snapshot *snaps
int stream_end_sign(const struct stream_descriptor *descriptor, uint64_t last, const uint8_t key[32], uint8_t wire[STREAM_END_SIZE]);
int stream_end_verify(const struct stream_descriptor *descriptor, const uint8_t key[32], const uint8_t *wire, size_t length,
uint64_t *last);
#ifdef __cplusplus
}
#endif
#endif

Loading…
Cancel
Save