Commit 39a5e728 authored by Cedric Roux's avatar Cedric Roux

define stream_security_context_t as a struct to get type checking

By using a struct we may have warnings at compilation time in some
cases if the type is not used properly.

The type definition becomes a bit weird, so we need to properly
comment.

If too strange, we can revert to the classical "void" definition.
parent de7bc130
...@@ -28,10 +28,14 @@ ...@@ -28,10 +28,14 @@
#define SECU_DIRECTION_UPLINK 0 #define SECU_DIRECTION_UPLINK 0
#define SECU_DIRECTION_DOWNLINK 1 #define SECU_DIRECTION_DOWNLINK 1
/* stream_security_context_t is an opaque structure /* stream_security_context_t is an opaque structure.
* it is different for each integrity and ciphering algorithm in use * It is different for each integrity and ciphering algorithm in use.
* Defined as a struct to have compilation time type checking
* (the "context" field is never actually used).
*/ */
typedef void stream_security_context_t; typedef struct {
void *context;
} stream_security_context_t;
/* stream_security_container_t contains the current configuration /* stream_security_container_t contains the current configuration
* of integrity and ciphering. It is used by PDCP and NAS. * of integrity and ciphering. It is used by PDCP and NAS.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment