diff options
author | Robby Zambito <contact@robbyzambito.me> | 2025-04-27 16:11:12 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2025-04-30 17:04:32 -0400 |
commit | 87c9d921d45a8e953ab9e1ddbac1089143212d40 (patch) | |
tree | 97ee074fa016fa9f62b82ec52f953876840b9ef2 /include | |
parent | f212454dfb67126812b3d2b0598e665485823601 (diff) |
startiing to clean up c apic-api
Diffstat (limited to 'include')
-rw-r--r-- | include/zaprus.h | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/include/zaprus.h b/include/zaprus.h index f170c38..db2d316 100644 --- a/include/zaprus.h +++ b/include/zaprus.h @@ -11,36 +11,5 @@ int zaprus_send_relay(const char* payload, size_t len, char dest[4]); int zaprus_send_initial_connection(const char* payload, size_t len, uint16_t initial_port); -struct SaprusMessage* zaprus_connect(const char* payload, size_t len); +void* zaprus_connect(const char* payload, size_t len); -// message -#define SAPRUS_RELAY_MESSAGE_TYPE 0x003C -#define SAPRUS_FILE_TRANSFER_MESSAGE_TYPE 0x8888 -#define SAPRUS_CONNECTION_MESSAGE_TYPE 0x00E9 - -struct SaprusMessage { - uint16_t packet_type; - uint16_t payload_len; - union { - struct { - char dest[4]; - } relay; - struct { - uint16_t src_port; - uint16_t dest_port; - uint32_t seq_num; - uint32_t msg_id; - char _reserved; - char options; - } connection; - } headers; - char *payload; -}; - -// ptr should be freed by the caller. -int zaprus_message_to_bytes(struct SaprusMessage msg, char** ptr, size_t* len); - -// Return value should be destroyed with zaprus_message_deinit. -struct SaprusMessage* zaprus_message_from_bytes(const char* bytes, size_t len); - -void zaprus_message_deinit(struct SaprusMessage* msg); |