Work-in-progress, untested, naive peer exchange. Intended to be disabled by default by a setting.
Some checks failed
Build Tilde Friends / Build-All (push) Failing after 5m56s
Some checks failed
Build Tilde Friends / Build-All (push) Failing after 5m56s
This commit is contained in:
25
src/ssb.h
25
src/ssb.h
@ -28,6 +28,8 @@ enum
|
||||
k_ssb_rpc_flag_new_request = 0x10,
|
||||
|
||||
k_ssb_blob_bytes_max = 5 * 1024 * 1024,
|
||||
|
||||
k_ssb_peer_exchange_expires_seconds = 60 * 60,
|
||||
};
|
||||
|
||||
/**
|
||||
@ -313,6 +315,15 @@ void tf_ssb_visit_broadcasts(tf_ssb_t* ssb,
|
||||
void (*callback)(const char* host, const struct sockaddr_in* addr, tf_ssb_broadcast_origin_t origin, tf_ssb_connection_t* tunnel, const uint8_t* pub, void* user_data),
|
||||
void* user_data);
|
||||
|
||||
/**
|
||||
** Add a broadcast entry.
|
||||
** @param ssb The SSB instance.
|
||||
** @param connection The connection string to add.
|
||||
** @param origin The origin of the broadcast entry.
|
||||
** @param expires_seconds How long the broadcast entry should last.
|
||||
*/
|
||||
void tf_ssb_add_broadcast(tf_ssb_t* ssb, const char* connection, tf_ssb_broadcast_origin_t origin, int64_t expires_seconds);
|
||||
|
||||
/**
|
||||
** Get the identities of all active connections.
|
||||
** @param ssb The SSB instance.
|
||||
@ -989,6 +1000,20 @@ bool tf_ssb_is_replicator(tf_ssb_t* ssb);
|
||||
*/
|
||||
void tf_ssb_set_is_replicator(tf_ssb_t* ssb, bool is_replicator);
|
||||
|
||||
/**
|
||||
** Get whether the running server participates in peer exchange.
|
||||
** @param ssb The SSB instance.
|
||||
** @return True if the server participates in peer exchange.
|
||||
*/
|
||||
bool tf_ssb_is_peer_exchange(tf_ssb_t* ssb);
|
||||
|
||||
/**
|
||||
** Set whether the running server participates in peer exchange.
|
||||
** @param ssb The SSB instance.
|
||||
** @param is_peer_exchange Whether to participate in peer exchange.
|
||||
*/
|
||||
void tf_ssb_set_is_peer_exchange(tf_ssb_t* ssb, bool is_peer_exchange);
|
||||
|
||||
/**
|
||||
** Get the name of the room hosted by the running server.
|
||||
** @param ssb The SSB instance.
|
||||
|
Reference in New Issue
Block a user