Hi all
I met a 'little' problem concerning multiple includes of the same header file:
Let's say I have the four files
- user.c
- user.h
- capture.c
- capture.h
The file 'user.h' holds the struct definition:
Code:
struct user
{
char *name;
int *ports;
AES_KEY dkey; //Encryption key of the user
AES_KEY ekey; //Decryption key of the user
struct user *right;
struct user *left;
};
The file 'capture.h' holds the struct definition:
Code:
struct knock_request
{
char *username;
char *s_ip;
time_t timestamp;
AES_KEY dkey; //Key to decrypt the data
char *s_address;
char *knock_data;
};
Now as I use 'AES_KEY' within the two structs, I have to include <openssl/aes.h> in the two header files, otherwise I get warnings when compiling?...So far that would be OK, there are no multiple includes of the same file till here.
But let's assume that the file "capture.c" needs both "user.h" and "capture.h" included? I would have the file <openssl/aes.h> included two times. How should I avoid that? Is there some 'standard' way? Like using a void pointer to point to the actual encryption/decryption keys?
Regards
Rafael