summaryrefslogtreecommitdiffstats
path: root/src/send.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-05-25 04:59:35 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-05-25 04:59:35 +0200
commit5e72359e9a2f4008c408acbd3fe5d389e11a15b4 (patch)
tree5f1aede16a3b1e6985d4b7a309c6999416a638a3 /src/send.c
parentf34e51a1c3b98df2b7c8c7d7eb415a33f42f2d75 (diff)
downloadfastd-5e72359e9a2f4008c408acbd3fe5d389e11a15b4.tar
fastd-5e72359e9a2f4008c408acbd3fe5d389e11a15b4.zip
Completely document fastd.h
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/send.c b/src/send.c
index 3e346ec..aec58db 100644
--- a/src/send.c
+++ b/src/send.c
@@ -168,14 +168,17 @@ static void send_type(const fastd_socket_t *sock, const fastd_peer_address_t *lo
fastd_buffer_free(buffer);
}
+/** Sends a payload packet to a peer */
void fastd_send(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer, size_t stat_size) {
send_type(sock, local_addr, remote_addr, peer, PACKET_DATA, buffer, stat_size);
}
+/** Sends a handshake packet to a peer */
void fastd_send_handshake(const fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr, fastd_peer_t *peer, fastd_buffer_t buffer) {
send_type(sock, local_addr, remote_addr, peer, PACKET_HANDSHAKE, buffer, 0);
}
+/** Encrypts and sends a payload packet to all peers */
void fastd_send_all(fastd_peer_t *source_peer, fastd_buffer_t buffer) {
size_t i;
for (i = 0; i < VECTOR_LEN(ctx.peers); i++) {