diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-09-21 15:07:11 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-09-21 15:10:28 +0200 |
commit | 2acd81bd7a1b364b02831ae5f8e46457d9d07865 (patch) | |
tree | 969429177db12b56e402ad767531189b7a41834c /src/types.h | |
parent | 65912e3e6fce703b03eafc2b4bf11a17a02bd39e (diff) | |
download | fastd-2acd81bd7a1b364b02831ae5f8e46457d9d07865.tar fastd-2acd81bd7a1b364b02831ae5f8e46457d9d07865.zip |
Nicely encapsulate different crypto algorithm implementations
Diffstat (limited to 'src/types.h')
-rw-r--r-- | src/types.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/types.h b/src/types.h index c27a99c..f079d3c 100644 --- a/src/types.h +++ b/src/types.h @@ -33,16 +33,14 @@ #ifndef _FASTD_TYPES_H_ #define _FASTD_TYPES_H_ +#include <config.h> + + typedef enum _fastd_mode { MODE_TAP, MODE_TUN, } fastd_mode; -typedef enum _fastd_alg_impl { - ALG_IMPL_DEFAULT, - ALG_IMPL_ALGIF, -} fastd_alg_impl; - typedef struct _fastd_buffer fastd_buffer; typedef union _fastd_peer_address fastd_peer_address; @@ -66,12 +64,30 @@ typedef struct _fastd_string_stack fastd_string_stack; typedef struct _fastd_resolve_return fastd_resolve_return; +#ifdef USE_CRYPTO_AES128CTR +typedef struct _fastd_crypto_aes128ctr fastd_crypto_aes128ctr; +#endif +#ifdef USE_CRYPTO_GHASH +typedef struct _fastd_crypto_ghash fastd_crypto_ghash; +#endif + -/* May be defined by the protocol/method however it likes */ +/* May be defined by the protocol/method/crypto implementations however they like */ typedef struct _fastd_protocol_config fastd_protocol_config; typedef struct _fastd_protocol_state fastd_protocol_state; typedef struct _fastd_protocol_peer_config fastd_protocol_peer_config; typedef struct _fastd_protocol_peer_state fastd_protocol_peer_state; + typedef struct _fastd_method_session_state fastd_method_session_state; +#ifdef USE_CRYPTO_AES128CTR +typedef struct _fastd_crypto_aes128ctr_context fastd_crypto_aes128ctr_context; +typedef struct _fastd_crypto_aes128ctr_state fastd_crypto_aes128ctr_state; +#endif + +#ifdef USE_CRYPTO_GHASH +typedef struct _fastd_crypto_ghash_context fastd_crypto_ghash_context; +typedef struct _fastd_crypto_ghash_state fastd_crypto_ghash_state; +#endif + #endif /* _FASTD_TYPES_H_ */ |