From ef99ae52ad0f0c81dfa94383094d15add3b07961 Mon Sep 17 00:00:00 2001 From: Mazet Laurent Date: Tue, 8 Apr 2025 03:14:58 +0200 Subject: [PATCH] clean all pdu types --- channel.h | 104 ------------------------------- encrypted_data.h | 104 ------------------------------- key.h | 104 ------------------------------- pdu_channel.h | 37 +++++++++++ clear_data.c => pdu_clear_data.c | 0 clear_data.h => pdu_clear_data.h | 0 pdu_encrypted_data.h | 41 ++++++++++++ pdu_key.h | 37 +++++++++++ pdu_prng_param.h | 38 +++++++++++ raw_data.c => pdu_raw_data.c | 0 raw_data.h => pdu_raw_data.h | 0 pdu_status.h | 36 +++++++++++ prng_param.h | 104 ------------------------------- status.h | 104 ------------------------------- 14 files changed, 189 insertions(+), 520 deletions(-) delete mode 100644 channel.h delete mode 100644 encrypted_data.h delete mode 100644 key.h create mode 100644 pdu_channel.h rename clear_data.c => pdu_clear_data.c (100%) rename clear_data.h => pdu_clear_data.h (100%) create mode 100644 pdu_encrypted_data.h create mode 100644 pdu_key.h create mode 100644 pdu_prng_param.h rename raw_data.c => pdu_raw_data.c (100%) rename raw_data.h => pdu_raw_data.h (100%) create mode 100644 pdu_status.h delete mode 100644 prng_param.h delete mode 100644 status.h diff --git a/channel.h b/channel.h deleted file mode 100644 index 2604d44..0000000 --- a/channel.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - File name : message.h - Projet : MERLIN - Date of creation : 2025/04/03 - Version : 1.0 - Copyright : Thales SIX - Author : Laurent Mazet - - Description : This file contains message definition - - History : - - initial version -*/ - -#ifndef __MESSAGE_H__ -#define __MESSAGE_H__ - -#include -#include - -__BEGIN_DECLS - -/** - @ingroup MESSAGE - - Clear data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ -} CLEAR_DATA_t; - -/** - @ingroup MESSAGE - - Encrypted data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ - uint8_t iv[12]; /**< initial vector */ -} ENCRYPTED_DATA_t; - -/** - @ingroup MESSAGE - - PRNG parameter type -*/ -typedef struct { - uint8_t prng_id; /**< algorithm index */ - uint16_t seq_len; /**< requested PRNG sequence length */ - uint8_t seed_len; /**< data length (must be aligned to 16 bytes) */ -} PRNG_PARAM_t; - -/** - @ingroup MESSAGE - - Key type -*/ -typedef struct { - uint16_t key_len; /**< key length */ - uint8_t key[1495]; /**< raw key */ -} KEY_t; - -/** - @ingroup MESSAGE - - Channel type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t key_id; /**< key index */ -} CHANNEL_t; - -/** - @ingroup MESSAGE - - Status type -*/ -typedef struct { - uint8_t status; /**< status */ -} STATUS_t; - -/** - @ingroup MESSAGE - - Raw data type -*/ -typedef struct { - uint16_t data_len; /**< payload length */ - uint8_t data[1495]; /**< raw payload */ -} RAW_DATA_t; - -__END_DECLS - -#endif /* __MESSAGE_H__ */ - -/* vim: set ts=4 sw=4 si et: */ diff --git a/encrypted_data.h b/encrypted_data.h deleted file mode 100644 index 2604d44..0000000 --- a/encrypted_data.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - File name : message.h - Projet : MERLIN - Date of creation : 2025/04/03 - Version : 1.0 - Copyright : Thales SIX - Author : Laurent Mazet - - Description : This file contains message definition - - History : - - initial version -*/ - -#ifndef __MESSAGE_H__ -#define __MESSAGE_H__ - -#include -#include - -__BEGIN_DECLS - -/** - @ingroup MESSAGE - - Clear data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ -} CLEAR_DATA_t; - -/** - @ingroup MESSAGE - - Encrypted data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ - uint8_t iv[12]; /**< initial vector */ -} ENCRYPTED_DATA_t; - -/** - @ingroup MESSAGE - - PRNG parameter type -*/ -typedef struct { - uint8_t prng_id; /**< algorithm index */ - uint16_t seq_len; /**< requested PRNG sequence length */ - uint8_t seed_len; /**< data length (must be aligned to 16 bytes) */ -} PRNG_PARAM_t; - -/** - @ingroup MESSAGE - - Key type -*/ -typedef struct { - uint16_t key_len; /**< key length */ - uint8_t key[1495]; /**< raw key */ -} KEY_t; - -/** - @ingroup MESSAGE - - Channel type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t key_id; /**< key index */ -} CHANNEL_t; - -/** - @ingroup MESSAGE - - Status type -*/ -typedef struct { - uint8_t status; /**< status */ -} STATUS_t; - -/** - @ingroup MESSAGE - - Raw data type -*/ -typedef struct { - uint16_t data_len; /**< payload length */ - uint8_t data[1495]; /**< raw payload */ -} RAW_DATA_t; - -__END_DECLS - -#endif /* __MESSAGE_H__ */ - -/* vim: set ts=4 sw=4 si et: */ diff --git a/key.h b/key.h deleted file mode 100644 index 2604d44..0000000 --- a/key.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - File name : message.h - Projet : MERLIN - Date of creation : 2025/04/03 - Version : 1.0 - Copyright : Thales SIX - Author : Laurent Mazet - - Description : This file contains message definition - - History : - - initial version -*/ - -#ifndef __MESSAGE_H__ -#define __MESSAGE_H__ - -#include -#include - -__BEGIN_DECLS - -/** - @ingroup MESSAGE - - Clear data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ -} CLEAR_DATA_t; - -/** - @ingroup MESSAGE - - Encrypted data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ - uint8_t iv[12]; /**< initial vector */ -} ENCRYPTED_DATA_t; - -/** - @ingroup MESSAGE - - PRNG parameter type -*/ -typedef struct { - uint8_t prng_id; /**< algorithm index */ - uint16_t seq_len; /**< requested PRNG sequence length */ - uint8_t seed_len; /**< data length (must be aligned to 16 bytes) */ -} PRNG_PARAM_t; - -/** - @ingroup MESSAGE - - Key type -*/ -typedef struct { - uint16_t key_len; /**< key length */ - uint8_t key[1495]; /**< raw key */ -} KEY_t; - -/** - @ingroup MESSAGE - - Channel type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t key_id; /**< key index */ -} CHANNEL_t; - -/** - @ingroup MESSAGE - - Status type -*/ -typedef struct { - uint8_t status; /**< status */ -} STATUS_t; - -/** - @ingroup MESSAGE - - Raw data type -*/ -typedef struct { - uint16_t data_len; /**< payload length */ - uint8_t data[1495]; /**< raw payload */ -} RAW_DATA_t; - -__END_DECLS - -#endif /* __MESSAGE_H__ */ - -/* vim: set ts=4 sw=4 si et: */ diff --git a/pdu_channel.h b/pdu_channel.h new file mode 100644 index 0000000..6d30cb0 --- /dev/null +++ b/pdu_channel.h @@ -0,0 +1,37 @@ +/* + File name : message.h + Projet : MERLIN + Date of creation : 2025/04/03 + Version : 1.0 + Copyright : Thales SIX + Author : Laurent Mazet + + Description : This file contains message definition + + History : + - initial version +*/ + +#ifndef __MESSAGE_H__ +#define __MESSAGE_H__ + +#include +#include + +__BEGIN_DECLS + +/** + @ingroup MESSAGE + + Channel type +*/ +typedef struct { + uint8_t channel_id; /**< channel index */ + uint8_t key_id; /**< key index */ +} CHANNEL_t; + +__END_DECLS + +#endif /* __MESSAGE_H__ */ + +/* vim: set ts=4 sw=4 si et: */ diff --git a/clear_data.c b/pdu_clear_data.c similarity index 100% rename from clear_data.c rename to pdu_clear_data.c diff --git a/clear_data.h b/pdu_clear_data.h similarity index 100% rename from clear_data.h rename to pdu_clear_data.h diff --git a/pdu_encrypted_data.h b/pdu_encrypted_data.h new file mode 100644 index 0000000..41c91ec --- /dev/null +++ b/pdu_encrypted_data.h @@ -0,0 +1,41 @@ +/* + File name : message.h + Projet : MERLIN + Date of creation : 2025/04/03 + Version : 1.0 + Copyright : Thales SIX + Author : Laurent Mazet + + Description : This file contains message definition + + History : + - initial version +*/ + +#ifndef __MESSAGE_H__ +#define __MESSAGE_H__ + +#include +#include + +__BEGIN_DECLS + +/** + @ingroup MESSAGE + + Encrypted data type +*/ +typedef struct { + uint8_t channel_id; /**< channel index */ + uint8_t bypass_len; /**< attached bypass message length */ + uint8_t bypass_msg[255]; /**< attached bypass message */ + uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ + uint8_t data[1472]; /**< data message */ + uint8_t iv[12]; /**< initial vector */ +} ENCRYPTED_DATA_t; + +__END_DECLS + +#endif /* __MESSAGE_H__ */ + +/* vim: set ts=4 sw=4 si et: */ diff --git a/pdu_key.h b/pdu_key.h new file mode 100644 index 0000000..ad58f9c --- /dev/null +++ b/pdu_key.h @@ -0,0 +1,37 @@ +/* + File name : message.h + Projet : MERLIN + Date of creation : 2025/04/03 + Version : 1.0 + Copyright : Thales SIX + Author : Laurent Mazet + + Description : This file contains message definition + + History : + - initial version +*/ + +#ifndef __MESSAGE_H__ +#define __MESSAGE_H__ + +#include +#include + +__BEGIN_DECLS + +/** + @ingroup MESSAGE + + Key type +*/ +typedef struct { + uint16_t key_len; /**< key length */ + uint8_t key[1495]; /**< raw key */ +} KEY_t; + +__END_DECLS + +#endif /* __MESSAGE_H__ */ + +/* vim: set ts=4 sw=4 si et: */ diff --git a/pdu_prng_param.h b/pdu_prng_param.h new file mode 100644 index 0000000..bbe9b16 --- /dev/null +++ b/pdu_prng_param.h @@ -0,0 +1,38 @@ +/* + File name : message.h + Projet : MERLIN + Date of creation : 2025/04/03 + Version : 1.0 + Copyright : Thales SIX + Author : Laurent Mazet + + Description : This file contains message definition + + History : + - initial version +*/ + +#ifndef __MESSAGE_H__ +#define __MESSAGE_H__ + +#include +#include + +__BEGIN_DECLS + +/** + @ingroup MESSAGE + + PRNG parameter type +*/ +typedef struct { + uint8_t prng_id; /**< algorithm index */ + uint16_t seq_len; /**< requested PRNG sequence length */ + uint8_t seed_len; /**< data length (must be aligned to 16 bytes) */ +} PRNG_PARAM_t; + +__END_DECLS + +#endif /* __MESSAGE_H__ */ + +/* vim: set ts=4 sw=4 si et: */ diff --git a/raw_data.c b/pdu_raw_data.c similarity index 100% rename from raw_data.c rename to pdu_raw_data.c diff --git a/raw_data.h b/pdu_raw_data.h similarity index 100% rename from raw_data.h rename to pdu_raw_data.h diff --git a/pdu_status.h b/pdu_status.h new file mode 100644 index 0000000..aef2288 --- /dev/null +++ b/pdu_status.h @@ -0,0 +1,36 @@ +/* + File name : message.h + Projet : MERLIN + Date of creation : 2025/04/03 + Version : 1.0 + Copyright : Thales SIX + Author : Laurent Mazet + + Description : This file contains message definition + + History : + - initial version +*/ + +#ifndef __MESSAGE_H__ +#define __MESSAGE_H__ + +#include +#include + +__BEGIN_DECLS + +/** + @ingroup MESSAGE + + Status type +*/ +typedef struct { + uint8_t status; /**< status */ +} STATUS_t; + +__END_DECLS + +#endif /* __MESSAGE_H__ */ + +/* vim: set ts=4 sw=4 si et: */ diff --git a/prng_param.h b/prng_param.h deleted file mode 100644 index 2604d44..0000000 --- a/prng_param.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - File name : message.h - Projet : MERLIN - Date of creation : 2025/04/03 - Version : 1.0 - Copyright : Thales SIX - Author : Laurent Mazet - - Description : This file contains message definition - - History : - - initial version -*/ - -#ifndef __MESSAGE_H__ -#define __MESSAGE_H__ - -#include -#include - -__BEGIN_DECLS - -/** - @ingroup MESSAGE - - Clear data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ -} CLEAR_DATA_t; - -/** - @ingroup MESSAGE - - Encrypted data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ - uint8_t iv[12]; /**< initial vector */ -} ENCRYPTED_DATA_t; - -/** - @ingroup MESSAGE - - PRNG parameter type -*/ -typedef struct { - uint8_t prng_id; /**< algorithm index */ - uint16_t seq_len; /**< requested PRNG sequence length */ - uint8_t seed_len; /**< data length (must be aligned to 16 bytes) */ -} PRNG_PARAM_t; - -/** - @ingroup MESSAGE - - Key type -*/ -typedef struct { - uint16_t key_len; /**< key length */ - uint8_t key[1495]; /**< raw key */ -} KEY_t; - -/** - @ingroup MESSAGE - - Channel type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t key_id; /**< key index */ -} CHANNEL_t; - -/** - @ingroup MESSAGE - - Status type -*/ -typedef struct { - uint8_t status; /**< status */ -} STATUS_t; - -/** - @ingroup MESSAGE - - Raw data type -*/ -typedef struct { - uint16_t data_len; /**< payload length */ - uint8_t data[1495]; /**< raw payload */ -} RAW_DATA_t; - -__END_DECLS - -#endif /* __MESSAGE_H__ */ - -/* vim: set ts=4 sw=4 si et: */ diff --git a/status.h b/status.h deleted file mode 100644 index 2604d44..0000000 --- a/status.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - File name : message.h - Projet : MERLIN - Date of creation : 2025/04/03 - Version : 1.0 - Copyright : Thales SIX - Author : Laurent Mazet - - Description : This file contains message definition - - History : - - initial version -*/ - -#ifndef __MESSAGE_H__ -#define __MESSAGE_H__ - -#include -#include - -__BEGIN_DECLS - -/** - @ingroup MESSAGE - - Clear data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ -} CLEAR_DATA_t; - -/** - @ingroup MESSAGE - - Encrypted data type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t bypass_len; /**< attached bypass message length */ - uint8_t bypass_msg[255]; /**< attached bypass message */ - uint8_t data_len; /**< data length (must be aligned to 16 bytes) */ - uint8_t data[1472]; /**< data message */ - uint8_t iv[12]; /**< initial vector */ -} ENCRYPTED_DATA_t; - -/** - @ingroup MESSAGE - - PRNG parameter type -*/ -typedef struct { - uint8_t prng_id; /**< algorithm index */ - uint16_t seq_len; /**< requested PRNG sequence length */ - uint8_t seed_len; /**< data length (must be aligned to 16 bytes) */ -} PRNG_PARAM_t; - -/** - @ingroup MESSAGE - - Key type -*/ -typedef struct { - uint16_t key_len; /**< key length */ - uint8_t key[1495]; /**< raw key */ -} KEY_t; - -/** - @ingroup MESSAGE - - Channel type -*/ -typedef struct { - uint8_t channel_id; /**< channel index */ - uint8_t key_id; /**< key index */ -} CHANNEL_t; - -/** - @ingroup MESSAGE - - Status type -*/ -typedef struct { - uint8_t status; /**< status */ -} STATUS_t; - -/** - @ingroup MESSAGE - - Raw data type -*/ -typedef struct { - uint16_t data_len; /**< payload length */ - uint8_t data[1495]; /**< raw payload */ -} RAW_DATA_t; - -__END_DECLS - -#endif /* __MESSAGE_H__ */ - -/* vim: set ts=4 sw=4 si et: */ -- 2.30.2