summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2023-08-17 16:12:44 +0200
committerSander Vrijders <[email protected]>2023-08-23 13:09:11 +0200
commit8183983c2c1cc50e3e0c82a8ab08d5fd66e0dc86 (patch)
tree005c33c3d3df3dde7c7f01abce816fa6202daed5 /include
parent868c7be8f599404a23f1d5178b1ba18379df1132 (diff)
downloadouroboros-8183983c2c1cc50e3e0c82a8ab08d5fd66e0dc86.tar.gz
ouroboros-8183983c2c1cc50e3e0c82a8ab08d5fd66e0dc86.zip
ipcpd: Add IDs to enrollment
The enrollment messages now have a 64-bit ID to easier track enrollments in the logs in larger scale tests. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/protobuf.h10
-rw-r--r--include/ouroboros/serdes-oep.h33
2 files changed, 28 insertions, 15 deletions
diff --git a/include/ouroboros/protobuf.h b/include/ouroboros/protobuf.h
index edcbe4f0..bb802148 100644
--- a/include/ouroboros/protobuf.h
+++ b/include/ouroboros/protobuf.h
@@ -84,16 +84,16 @@ struct qos_spec qos_spec_msg_to_s(const qosspec_msg_t * msg);
/* Enrollment */
-enroll_req_msg_t * enroll_req_s_to_msg(void);
+enroll_req_msg_t * enroll_req_s_to_msg(const struct enroll_req * s);
-int enroll_req_msg_to_s(const enroll_req_msg_t * msg);
+struct enroll_req enroll_req_msg_to_s(const enroll_req_msg_t * msg);
enroll_resp_msg_t * enroll_resp_s_to_msg(const struct enroll_resp * s);
-struct enroll_resp enroll_resp_msg_to_s(enroll_resp_msg_t * msg);
+struct enroll_resp enroll_resp_msg_to_s(const enroll_resp_msg_t * msg);
-enroll_ack_msg_t * enroll_ack_s_to_msg(const int response);
+enroll_ack_msg_t * enroll_ack_s_to_msg(const struct enroll_ack * s);
-int enroll_ack_msg_to_s(const enroll_ack_msg_t * msg);
+struct enroll_ack enroll_ack_msg_to_s(const enroll_ack_msg_t * msg);
#endif /* OUROBOROS_PROTOBUF_H */ \ No newline at end of file
diff --git a/include/ouroboros/serdes-oep.h b/include/ouroboros/serdes-oep.h
index c503b31a..4409b047 100644
--- a/include/ouroboros/serdes-oep.h
+++ b/include/ouroboros/serdes-oep.h
@@ -30,18 +30,31 @@
/* Enrollment */
-/* no structs yet for req and ack. TODO: authentication. */
+#define ENROLL_ID_LEN 8
+
+struct enroll_req {
+ /* TODO: Authentication */
+ uint8_t id[ENROLL_ID_LEN];
+};
struct enroll_resp {
- struct timespec t;
- int response;
- struct ipcp_config conf;
+ uint8_t id[ENROLL_ID_LEN];
+ struct timespec t;
+ int response;
+ struct ipcp_config conf;
+};
+
+struct enroll_ack {
+ uint8_t id[ENROLL_ID_LEN];
+ int result;
};
-ssize_t enroll_req_ser(buffer_t buf);
+ssize_t enroll_req_ser(const struct enroll_req * req,
+ buffer_t buf);
-int enroll_req_des(const buffer_t buf);
+int enroll_req_des(struct enroll_req * req,
+ const buffer_t buf);
ssize_t enroll_resp_ser(const struct enroll_resp * resp,
buffer_t buf);
@@ -49,10 +62,10 @@ ssize_t enroll_resp_ser(const struct enroll_resp * resp,
int enroll_resp_des(struct enroll_resp * resp,
buffer_t buf);
-ssize_t enroll_ack_ser(const int response,
- buffer_t buf);
+ssize_t enroll_ack_ser(const struct enroll_ack * ack,
+ buffer_t buf);
-int enroll_ack_des(int * response,
- const buffer_t buf);
+int enroll_ack_des(struct enroll_ack * ack,
+ const buffer_t buf);
#endif /* OUROBOROS_LIB_SERDES_OEP_H*/ \ No newline at end of file