clean all pdu types
authorMazet Laurent <laurent.mazet@thalesgroup.com>
Tue, 8 Apr 2025 01:14:58 +0000 (03:14 +0200)
committerMazet Laurent <laurent.mazet@thalesgroup.com>
Tue, 8 Apr 2025 01:14:58 +0000 (03:14 +0200)
18 files changed:
channel.h [deleted file]
clear_data.c [deleted file]
clear_data.h [deleted file]
encrypted_data.h [deleted file]
key.h [deleted file]
pdu_channel.h [new file with mode: 0644]
pdu_clear_data.c [new file with mode: 0644]
pdu_clear_data.h [new file with mode: 0644]
pdu_encrypted_data.h [new file with mode: 0644]
pdu_key.h [new file with mode: 0644]
pdu_prng_param.h [new file with mode: 0644]
pdu_raw_data.c [new file with mode: 0644]
pdu_raw_data.h [new file with mode: 0644]
pdu_status.h [new file with mode: 0644]
prng_param.h [deleted file]
raw_data.c [deleted file]
raw_data.h [deleted file]
status.h [deleted file]

diff --git a/channel.h b/channel.h
deleted file mode 100644 (file)
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 <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains message definition
-
-  History          :
-  - initial version
-*/
-
-#ifndef __MESSAGE_H__
-#define __MESSAGE_H__
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-__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/clear_data.c b/clear_data.c
deleted file mode 100644 (file)
index f5840bc..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-  File name        : clear_data.c
-  Projet           : MERLIN
-  Date of creation : 2025/04/07
-  Version          : 1.0
-  Copyright        : Thales SIX
-  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains definition of clear data type
-
-  History          :
-  - initial version
-*/
-
-#include <stdint.h>
-
-#include "parse.h"
-
-#include "clear_data.h"
-
-int parse_clear_data (char *line, CLEAR_DATA_t *out)
-{
-    BEGIN_PARSE (line)
-    PARSE_INT ("CHANNEL", out->channel_id)
-    PARSE_INT ("BYPASS", out->bypass)
-    PARSE_ARRAY ("DATA", out->data)
-    END_PARSE ()
-}
-
-int format_clear_data (CLEAR_DATA_t *in, char *buffer, int maxlen)
-{
-    BEGIN_FORMAT (buffer, maxlen);
-    FORMAT_INT ("CHANNEL", out->channel_id)
-    FORMAT_INT ("BYPASS", out->bypass)
-    FORMAT_ARRAY ("DATA", out->data)
-    END_FORMAT ()
-}
-
-int serial_clear_data (CLEAR_DATA_t *in, uint8_t *buffer, int maxlen)
-{
-    BEGIN_SERIAL (buffer, maxlen);
-    SERIAL_INT (out->channel_id)
-    SERIAL_INT (out->bypass)
-    SERIAL_ARRAY (out->data)
-    END_SERIAL ()
-}
-
-/* vim: set ts=4 sw=4 si et: */
diff --git a/clear_data.h b/clear_data.h
deleted file mode 100644 (file)
index 29da2f9..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-  File name        : clear_data.h
-  Projet           : MERLIN
-  Date of creation : 2025/04/07
-  Version          : 1.0
-  Copyright        : Thales SIX
-  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains definition of clear data type
-
-  History          :
-  - initial version
-*/
-
-#ifndef __CLEAR_DATA_H__
-#define __CLEAR_DATA_H__
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-/**
-   @ingroup MESSAGES
-
-   Clear data type
-*/
-typedef struct {
-    uint8_t channelid; /**< channel index */
-    int bypass_len; /**< attached bypass message length */
-    uint8_t bypass[255]; /**< attached bypass message */
-    int data_len; /**< data length (must be aligned to 16 bytes) */
-    uint8_t data[1472]; /**< data message */
-} CLEAR_DATA_t;
-
-/**
-   @ingroup MESSAGES
-
-   Parse a string containing some clear data type fields
-
-   @param line string to analyse
-   @param out output structure
-   @return 0 on success 
-*/
-int parse_clear_data (char *line, CLEAR_DATA_t *out);
-
-/**
-   @ingroup MESSAGES
-
-   Format clear data type fields into a string
-
-   @param in input structure
-   @param buffer output string
-   @param maxlen buffer limit
-   @return 0 on success 
-*/
-int format_clear_data (CLEAR_DATA_t *in, char *buffer, int maxlen);
-
-/**
-   @ingroup MESSAGES
-
-   Serial clear data type fields into a network stream
-
-   @param in input structure
-   @param buffer network stream
-   @param maxlen buffer limit
-   @return buffer length
-*/
-int serial_clear_data (CLEAR_DATA_t *in, uint8_t *buffer, int maxlen);
-
-/**
-   @ingroup MESSAGES
-
-   Deserial clear data type fields from a network stream
-
-   @param buffer network stream
-   @param maxlen buffer limit
-   @param out output structure
-   @return 0 on success 
-*/
-int deserial_clear_data (uint8_t *buffer, int maxlen, CLEAR_DATA_t *out);
-
-__END_DECLS
-
-#endif /* __CLEAR_DATA_H__ */
-
-/* vim: set ts=4 sw=4 si et: */
diff --git a/encrypted_data.h b/encrypted_data.h
deleted file mode 100644 (file)
index 2604d44..0000000
+++ /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 <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains message definition
-
-  History          :
-  - initial version
-*/
-
-#ifndef __MESSAGE_H__
-#define __MESSAGE_H__
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-__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 (file)
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 <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains message definition
-
-  History          :
-  - initial version
-*/
-
-#ifndef __MESSAGE_H__
-#define __MESSAGE_H__
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-__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 (file)
index 0000000..6d30cb0
--- /dev/null
@@ -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 <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains message definition
+
+  History          :
+  - initial version
+*/
+
+#ifndef __MESSAGE_H__
+#define __MESSAGE_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__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/pdu_clear_data.c b/pdu_clear_data.c
new file mode 100644 (file)
index 0000000..f5840bc
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+  File name        : clear_data.c
+  Projet           : MERLIN
+  Date of creation : 2025/04/07
+  Version          : 1.0
+  Copyright        : Thales SIX
+  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains definition of clear data type
+
+  History          :
+  - initial version
+*/
+
+#include <stdint.h>
+
+#include "parse.h"
+
+#include "clear_data.h"
+
+int parse_clear_data (char *line, CLEAR_DATA_t *out)
+{
+    BEGIN_PARSE (line)
+    PARSE_INT ("CHANNEL", out->channel_id)
+    PARSE_INT ("BYPASS", out->bypass)
+    PARSE_ARRAY ("DATA", out->data)
+    END_PARSE ()
+}
+
+int format_clear_data (CLEAR_DATA_t *in, char *buffer, int maxlen)
+{
+    BEGIN_FORMAT (buffer, maxlen);
+    FORMAT_INT ("CHANNEL", out->channel_id)
+    FORMAT_INT ("BYPASS", out->bypass)
+    FORMAT_ARRAY ("DATA", out->data)
+    END_FORMAT ()
+}
+
+int serial_clear_data (CLEAR_DATA_t *in, uint8_t *buffer, int maxlen)
+{
+    BEGIN_SERIAL (buffer, maxlen);
+    SERIAL_INT (out->channel_id)
+    SERIAL_INT (out->bypass)
+    SERIAL_ARRAY (out->data)
+    END_SERIAL ()
+}
+
+/* vim: set ts=4 sw=4 si et: */
diff --git a/pdu_clear_data.h b/pdu_clear_data.h
new file mode 100644 (file)
index 0000000..29da2f9
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+  File name        : clear_data.h
+  Projet           : MERLIN
+  Date of creation : 2025/04/07
+  Version          : 1.0
+  Copyright        : Thales SIX
+  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains definition of clear data type
+
+  History          :
+  - initial version
+*/
+
+#ifndef __CLEAR_DATA_H__
+#define __CLEAR_DATA_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/**
+   @ingroup MESSAGES
+
+   Clear data type
+*/
+typedef struct {
+    uint8_t channelid; /**< channel index */
+    int bypass_len; /**< attached bypass message length */
+    uint8_t bypass[255]; /**< attached bypass message */
+    int data_len; /**< data length (must be aligned to 16 bytes) */
+    uint8_t data[1472]; /**< data message */
+} CLEAR_DATA_t;
+
+/**
+   @ingroup MESSAGES
+
+   Parse a string containing some clear data type fields
+
+   @param line string to analyse
+   @param out output structure
+   @return 0 on success 
+*/
+int parse_clear_data (char *line, CLEAR_DATA_t *out);
+
+/**
+   @ingroup MESSAGES
+
+   Format clear data type fields into a string
+
+   @param in input structure
+   @param buffer output string
+   @param maxlen buffer limit
+   @return 0 on success 
+*/
+int format_clear_data (CLEAR_DATA_t *in, char *buffer, int maxlen);
+
+/**
+   @ingroup MESSAGES
+
+   Serial clear data type fields into a network stream
+
+   @param in input structure
+   @param buffer network stream
+   @param maxlen buffer limit
+   @return buffer length
+*/
+int serial_clear_data (CLEAR_DATA_t *in, uint8_t *buffer, int maxlen);
+
+/**
+   @ingroup MESSAGES
+
+   Deserial clear data type fields from a network stream
+
+   @param buffer network stream
+   @param maxlen buffer limit
+   @param out output structure
+   @return 0 on success 
+*/
+int deserial_clear_data (uint8_t *buffer, int maxlen, CLEAR_DATA_t *out);
+
+__END_DECLS
+
+#endif /* __CLEAR_DATA_H__ */
+
+/* vim: set ts=4 sw=4 si et: */
diff --git a/pdu_encrypted_data.h b/pdu_encrypted_data.h
new file mode 100644 (file)
index 0000000..41c91ec
--- /dev/null
@@ -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 <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains message definition
+
+  History          :
+  - initial version
+*/
+
+#ifndef __MESSAGE_H__
+#define __MESSAGE_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__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 (file)
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 <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains message definition
+
+  History          :
+  - initial version
+*/
+
+#ifndef __MESSAGE_H__
+#define __MESSAGE_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__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 (file)
index 0000000..bbe9b16
--- /dev/null
@@ -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 <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains message definition
+
+  History          :
+  - initial version
+*/
+
+#ifndef __MESSAGE_H__
+#define __MESSAGE_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__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/pdu_raw_data.c b/pdu_raw_data.c
new file mode 100644 (file)
index 0000000..b9c6ec2
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+  File name        : raw_data.c
+  Projet           : MERLIN
+  Date of creation : 2025/04/07
+  Version          : 1.0
+  Copyright        : Thales SIX
+  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains definition of raw data type
+
+  History          :
+  - initial version
+*/
+
+#include <stdint.h>
+
+#include "parse.h"
+
+#include "raw_data.h"
+
+int parse_raw_data (char *line, RAW_DATA_t *out)
+{
+    BEGIN_PARSE (line)
+    PARSE_ARRAY ("DATA", out->data)
+    END_PARSE ()
+}
+
+int format_raw_data (RAW_DATA_t *in, char *buffer, int maxlen)
+{
+    BEGIN_FORMAT (buffer, maxlen)
+    FORMAT_ARRAY ("DATA", in->data)
+    END_FORMAT ()
+}
+
+int serial_raw_data (RAW_DATA_t *in, uint8_t *buffer, int maxlen)
+{
+    BEGIN_SERIAL (buffer, maxlen)
+    SERIAL_ARRAY ("DATA", in->data)
+    END_SERIAL ()
+}
+
+int deserial_raw_data (uint8_t *buffer, int maxlen, RAW_DATA_t *out)
+{
+    BEGIN_DESERIAL (buffer, maxlen)
+    DESERIAL_ARRAY ("DATA", out->data)
+    END_DESERIAL ()
+}
+
+/* vim: set ts=4 sw=4 si et: */
diff --git a/pdu_raw_data.h b/pdu_raw_data.h
new file mode 100644 (file)
index 0000000..1153888
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+  File name        : raw_data.h
+  Projet           : MERLIN
+  Date of creation : 2025/04/07
+  Version          : 1.0
+  Copyright        : Thales SIX
+  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains definition of raw data type
+
+  History          :
+  - initial version
+*/
+
+#ifndef __RAW_DATA_H__
+#define __RAW_DATA_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/**
+   @ingroup MESSAGES
+
+   Raw data type
+*/
+typedef struct {
+    int data_len; /**< data length*/
+    uint8_t data[1496]; /**< data message */
+} RAW_DATA_t;
+
+/**
+   @ingroup MESSAGES
+
+   Parse a string containing some raw data type fields
+
+   @param line string to analyse
+   @param out output structure
+   @return 0 on success 
+*/
+int parse_raw_data (char *line, RAW_DATA_t *out);
+
+/**
+   @ingroup MESSAGES
+
+   Format raw data type fields into a string
+
+   @param in input structure
+   @param buffer output string
+   @param maxlen buffer limit
+   @return 0 on success 
+*/
+int format_raw_data (RAW_DATA_t *in, char *buffer, int maxlen);
+
+/**
+   @ingroup MESSAGES
+
+   Serialize raw data type fields into a network stream
+
+   @param in input structure
+   @param buffer network stream
+   @param maxlen buffer limit
+   @return buffer length
+*/
+int serial_raw_data (RAW_DATA_t *in, uint8_t *buffer, int maxlen);
+
+/**
+   @ingroup MESSAGES
+
+   Deserial raw data type fields from a network stream
+
+   @param buffer network stream
+   @param maxlen buffer limit
+   @param out output structure
+   @return 0 on success 
+*/
+int deserial_raw_data (uint8_t *buffer, int maxlen, RAW_DATA_t *out);
+
+__END_DECLS
+
+#endif /* __RAW_DATA_H__ */
+
+/* vim: set ts=4 sw=4 si et: */
diff --git a/pdu_status.h b/pdu_status.h
new file mode 100644 (file)
index 0000000..aef2288
--- /dev/null
@@ -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 <laurent.mazet@thalesgroup.com>
+
+  Description      : This file contains message definition
+
+  History          :
+  - initial version
+*/
+
+#ifndef __MESSAGE_H__
+#define __MESSAGE_H__
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__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 (file)
index 2604d44..0000000
+++ /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 <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains message definition
-
-  History          :
-  - initial version
-*/
-
-#ifndef __MESSAGE_H__
-#define __MESSAGE_H__
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-__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/raw_data.c b/raw_data.c
deleted file mode 100644 (file)
index b9c6ec2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-  File name        : raw_data.c
-  Projet           : MERLIN
-  Date of creation : 2025/04/07
-  Version          : 1.0
-  Copyright        : Thales SIX
-  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains definition of raw data type
-
-  History          :
-  - initial version
-*/
-
-#include <stdint.h>
-
-#include "parse.h"
-
-#include "raw_data.h"
-
-int parse_raw_data (char *line, RAW_DATA_t *out)
-{
-    BEGIN_PARSE (line)
-    PARSE_ARRAY ("DATA", out->data)
-    END_PARSE ()
-}
-
-int format_raw_data (RAW_DATA_t *in, char *buffer, int maxlen)
-{
-    BEGIN_FORMAT (buffer, maxlen)
-    FORMAT_ARRAY ("DATA", in->data)
-    END_FORMAT ()
-}
-
-int serial_raw_data (RAW_DATA_t *in, uint8_t *buffer, int maxlen)
-{
-    BEGIN_SERIAL (buffer, maxlen)
-    SERIAL_ARRAY ("DATA", in->data)
-    END_SERIAL ()
-}
-
-int deserial_raw_data (uint8_t *buffer, int maxlen, RAW_DATA_t *out)
-{
-    BEGIN_DESERIAL (buffer, maxlen)
-    DESERIAL_ARRAY ("DATA", out->data)
-    END_DESERIAL ()
-}
-
-/* vim: set ts=4 sw=4 si et: */
diff --git a/raw_data.h b/raw_data.h
deleted file mode 100644 (file)
index 1153888..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-  File name        : raw_data.h
-  Projet           : MERLIN
-  Date of creation : 2025/04/07
-  Version          : 1.0
-  Copyright        : Thales SIX
-  Author           : Laurent Mazet <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains definition of raw data type
-
-  History          :
-  - initial version
-*/
-
-#ifndef __RAW_DATA_H__
-#define __RAW_DATA_H__
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-/**
-   @ingroup MESSAGES
-
-   Raw data type
-*/
-typedef struct {
-    int data_len; /**< data length*/
-    uint8_t data[1496]; /**< data message */
-} RAW_DATA_t;
-
-/**
-   @ingroup MESSAGES
-
-   Parse a string containing some raw data type fields
-
-   @param line string to analyse
-   @param out output structure
-   @return 0 on success 
-*/
-int parse_raw_data (char *line, RAW_DATA_t *out);
-
-/**
-   @ingroup MESSAGES
-
-   Format raw data type fields into a string
-
-   @param in input structure
-   @param buffer output string
-   @param maxlen buffer limit
-   @return 0 on success 
-*/
-int format_raw_data (RAW_DATA_t *in, char *buffer, int maxlen);
-
-/**
-   @ingroup MESSAGES
-
-   Serialize raw data type fields into a network stream
-
-   @param in input structure
-   @param buffer network stream
-   @param maxlen buffer limit
-   @return buffer length
-*/
-int serial_raw_data (RAW_DATA_t *in, uint8_t *buffer, int maxlen);
-
-/**
-   @ingroup MESSAGES
-
-   Deserial raw data type fields from a network stream
-
-   @param buffer network stream
-   @param maxlen buffer limit
-   @param out output structure
-   @return 0 on success 
-*/
-int deserial_raw_data (uint8_t *buffer, int maxlen, RAW_DATA_t *out);
-
-__END_DECLS
-
-#endif /* __RAW_DATA_H__ */
-
-/* vim: set ts=4 sw=4 si et: */
diff --git a/status.h b/status.h
deleted file mode 100644 (file)
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 <laurent.mazet@thalesgroup.com>
-
-  Description      : This file contains message definition
-
-  History          :
-  - initial version
-*/
-
-#ifndef __MESSAGE_H__
-#define __MESSAGE_H__
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-
-__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: */