diff options
Diffstat (limited to 'src/common.c')
| -rw-r--r-- | src/common.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/common.c b/src/common.c index 0fef6da..74515c1 100644 --- a/src/common.c +++ b/src/common.c @@ -50,11 +50,23 @@ enum client_input { // query packets for a specific author // note: to prevent DoS, you must provide a signature by the requested author to be approved. - // the signature needs to be from a struct shaped `public_key + pub_sign_key + u16 count + u64 offset`. - // server must verify the signing key is of the author's pubkey and signing key by looking at the packet's metadata. + // the signature needs to be from a struct shaped `public_key + pub_sign_key + u16 count + u64 + // offset`. + // server must verify the signing key is of the author's pubkey and signing key by looking at + // the packet's metadata. // (input public_key, input pub_sign_key, signature, u16 count, u64 offset) // (responds with queried_author_packets) - query_packets = 0x16 + query_packets = 0x16, + + // query packets for a specific recipient + // note: to prevent DoS, you must provide a signature by the requested author to be approved. + // the signature needs to be from a struct shaped `public_key + pub_sign_key + u16 count + u64 + // offset`. + // server must verify the signing key is of the recipient's pubkey and signing key by looking at + // the packet's metadata. + // (input public_key, input pub_sign_key, signature, u16 count, u64 offset) + // (responds with queried_author_packets) + query_by_recipient = 0x17, }; enum server_reply { @@ -62,19 +74,21 @@ enum server_reply { error = 0x1, // type `struct relay_info` - audit_response = 0x17, + audit_response = 0x18, // type `struct relay_neighbor[ neighbor_count ]` - neighbors_info = 0x18, + neighbors_info = 0x19, // type `uint64_t new_offset, struct data_packet[ count ]` - firehose_reply = 0x19, + firehose_reply = 0x1a, // type `bool result_code` - push_packet_result = 0x1a, + push_packet_result = 0x1b, // type `struct data_packet` - get_packet_result = 0x1b, + get_packet_result = 0x1c, // type `bool result_code` - register_neighbor_result = 0x1c, + register_neighbor_result = 0x1d, + // type `u16 count, u64 new_offset, struct data_packet[ count ]` + queried_author_packets = 0x1e, // type `u16 count, u64 new_offset, struct data_packet[ count ]` - queried_author_packets = 0x1d + queried_recipient_packets = 0x1f, }; typedef uint8_t get_neighbors_request; |
