Menu

#3 Reorganize C headers

open
nobody
None
5
2013-02-14
2013-01-12
aFeLiOn
No

Hi

Currently, all declaration of functions that used in the library is presented in the header ssl.h as it also includes tls.h. Therefore, it likely causes naming conflict in the application which uses this library.

For example, when I tried to integrate axtls with ssmtp, I got this error:
md5auth/hmac_md5.h:5:6: error: conflicting types for ‘hmac_md5’

Additionally, unnecessary header files are needed along with the release, they are config.h, os_int.h, crypto.h, crypto_misc.h...

It would be easier for user if those headers are separated into exported and internal ones.
For instance, the ssl.h does not include any internal header files and only has:

typedef struct _SSL SSL;
typedef struct _SSL_CTX SSL_CTX;

EXP_FUNC SSL_CTX * STDCALL ssl_ctx_new(uint32_t options, int num_sessions);
...

While tls.h should only be included in axtls source codes (*.c)
Please consider this issue.

Cheers

Discussion

  • aFeLiOn

    aFeLiOn - 2013-01-14

    I've added a patch that remove "tls1.h" from "ssl.h".

     
  • aFeLiOn

    aFeLiOn - 2013-01-14

    I've added a patch that removes "tls1.h" from "ssl.h".

     
  • aFeLiOn

    aFeLiOn - 2013-01-16

    I was wrong thinking that config.h can be removed in ssl.h, therfore I've added it in globals.h.

    However, I wish you will add a prefix AXTLS to config names, such as CONFIG_AXTLS_SSL_SERVER_ONLY to eliminate conflict as I'm gonna integrate this library into uClinux build system which already has a lot of CONFIG_*