diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2023-08-17 16:12:44 +0200 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2023-08-23 13:09:11 +0200 |
commit | 8183983c2c1cc50e3e0c82a8ab08d5fd66e0dc86 (patch) | |
tree | 005c33c3d3df3dde7c7f01abce816fa6202daed5 /include/ouroboros/serdes-oep.h | |
parent | 868c7be8f599404a23f1d5178b1ba18379df1132 (diff) | |
download | ouroboros-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 <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include/ouroboros/serdes-oep.h')
-rw-r--r-- | include/ouroboros/serdes-oep.h | 33 |
1 files changed, 23 insertions, 10 deletions
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 |