- code cleanup in network and config
- moved packet_t members to private, added getter and setters
This commit is contained in:
@@ -216,7 +216,6 @@ struct private_configuration_manager_t {
|
||||
/**
|
||||
* Adds a new IKE_SA configuration.
|
||||
*
|
||||
*
|
||||
* @param this calling object
|
||||
* @param name name for the configuration
|
||||
* @param init_config init_config_t object
|
||||
@@ -227,7 +226,6 @@ struct private_configuration_manager_t {
|
||||
/**
|
||||
* Adds a new preshared secret.
|
||||
*
|
||||
*
|
||||
* @param this calling object
|
||||
* @param type type of identification
|
||||
* @param id_string identification as string
|
||||
@@ -238,7 +236,6 @@ struct private_configuration_manager_t {
|
||||
/**
|
||||
* Adds a new rsa private key.
|
||||
*
|
||||
*
|
||||
* @param this calling object
|
||||
* @param type type of identification
|
||||
* @param id_string identification as string
|
||||
@@ -250,7 +247,6 @@ struct private_configuration_manager_t {
|
||||
/**
|
||||
* Adds a new rsa public key.
|
||||
*
|
||||
*
|
||||
* @param this calling object
|
||||
* @param type type of identification
|
||||
* @param id_string identification as string
|
||||
|
||||
@@ -38,8 +38,9 @@ typedef struct configuration_manager_t configuration_manager_t;
|
||||
* @b Constructors:
|
||||
* - configuration_manager_create()
|
||||
*
|
||||
* @ingroup config
|
||||
* @todo Build a (file) backend for the configuration manager.
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
struct configuration_manager_t {
|
||||
|
||||
@@ -150,13 +151,13 @@ struct configuration_manager_t {
|
||||
* The returned preshared secret MUST NOT be destroyed cause it's managed by
|
||||
* this configuration_manager_t object.
|
||||
*
|
||||
* @param this calling object
|
||||
* @param identification identification_t object identifiying the ID.
|
||||
* @param[out] preshared_secret the preshared secret will be written there.
|
||||
* @param this calling object
|
||||
* @param identification identification_t object identifiying the ID.
|
||||
* @param[out] preshared_secret the preshared secret will be written there.
|
||||
*
|
||||
* @return
|
||||
* - NOT_FOUND if no preshared secrets for specific ID could be found
|
||||
* - SUCCESS
|
||||
* - NOT_FOUND if no preshared secrets for specific ID could be found
|
||||
* - SUCCESS
|
||||
*/
|
||||
status_t (*get_shared_secret) (configuration_manager_t *this, identification_t *identification, chunk_t *preshared_secret);
|
||||
|
||||
@@ -166,13 +167,13 @@ struct configuration_manager_t {
|
||||
* The returned rsa_public_key_t object MUST NOT be destroyed cause it's managed by
|
||||
* this configuration_manager_t object.
|
||||
*
|
||||
* @param this calling object
|
||||
* @param identification identification_t object identifiying the ID.
|
||||
* @param[out] public_key the public key will be written there
|
||||
* @param this calling object
|
||||
* @param identification identification_t object identifiying the ID.
|
||||
* @param[out] public_key the public key will be written there
|
||||
*
|
||||
* @return
|
||||
* - NOT_FOUND if no key is configured for specific id
|
||||
* - SUCCESS
|
||||
* - NOT_FOUND if no key is configured for specific id
|
||||
* - SUCCESS
|
||||
*/
|
||||
status_t (*get_rsa_public_key) (configuration_manager_t *this, identification_t *identification, rsa_public_key_t **public_key);
|
||||
|
||||
@@ -182,22 +183,20 @@ struct configuration_manager_t {
|
||||
* The returned rsa_private_key_t object MUST NOT be destroyed cause it's managed by
|
||||
* this configuration_manager_t object.
|
||||
*
|
||||
* @param this calling object
|
||||
* @param identification identification_t object identifiying the ID.
|
||||
* @param[out] private_key the private key will be written there
|
||||
* @param this calling object
|
||||
* @param identification identification_t object identifiying the ID.
|
||||
* @param[out] private_key the private key will be written there
|
||||
*
|
||||
* @return
|
||||
* - NOT_FOUND if no key is configured for specific id
|
||||
* - SUCCESS
|
||||
* - NOT_FOUND if no key is configured for specific id
|
||||
* - SUCCESS
|
||||
*/
|
||||
status_t (*get_rsa_private_key) (configuration_manager_t *this, identification_t *identification, rsa_private_key_t **private_key);
|
||||
|
||||
/**
|
||||
* Destroys a configuration_manager_t object.
|
||||
* @brief Destroys a configuration_manager_t object.
|
||||
*
|
||||
* @param this calling object
|
||||
* @return
|
||||
* - SUCCESS
|
||||
* @param this calling object
|
||||
*/
|
||||
void (*destroy) (configuration_manager_t *this);
|
||||
};
|
||||
@@ -208,8 +207,8 @@ struct configuration_manager_t {
|
||||
* @param first_retransmit_timeout first retransmit timeout in milliseconds
|
||||
* @param max_retransmit_count max number of tries to retransmitted a requests (0 for infinite)
|
||||
* @param half_open_ike_sa_timeout timeout after that a half open IKE_SA gets deleted
|
||||
* @return
|
||||
* - pointer to created configuration_manager_t object
|
||||
* @return configuration_manager_t object
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
configuration_manager_t *configuration_manager_create(u_int32_t first_retransmit_timeout,u_int32_t max_retransmit_count, u_int32_t half_open_ike_sa_timeout);
|
||||
|
||||
@@ -42,7 +42,7 @@ typedef struct ike_proposal_t ike_proposal_t;
|
||||
struct ike_proposal_t {
|
||||
/**
|
||||
* Encryption algorithm.
|
||||
* */
|
||||
*/
|
||||
encryption_algorithm_t encryption_algorithm;
|
||||
|
||||
/**
|
||||
@@ -177,7 +177,7 @@ struct init_config_t {
|
||||
status_t (*select_proposal) (init_config_t *this, ike_proposal_t *proposals, size_t proposal_count, ike_proposal_t *selected_proposal);
|
||||
|
||||
/**
|
||||
* Destroys a init_config_t object.
|
||||
* @brief Destroys a init_config_t object.
|
||||
*
|
||||
* @param this calling object
|
||||
*/
|
||||
@@ -185,9 +185,9 @@ struct init_config_t {
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a init_config_t object.
|
||||
* @brief Creates a init_config_t object.
|
||||
*
|
||||
* @return - pointer to created init_config_t object.
|
||||
* @return init_config_t object.
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
|
||||
@@ -270,7 +270,7 @@ struct sa_config_t {
|
||||
* @param auth_method Method of authentication
|
||||
* @param ike_sa_lifetime lifetime of this IKE_SA in milliseconds. IKE_SA will be deleted
|
||||
* after this lifetime!
|
||||
* @return created sa_config_t
|
||||
* @return sa_config_t object
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
typedef enum ts_type_t ts_type_t;
|
||||
|
||||
/**
|
||||
* Traffic selector Types.
|
||||
* Traffic selector types.
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
@@ -65,6 +65,10 @@ typedef struct traffic_selector_t traffic_selector_t;
|
||||
* A traffic selector defines an range of addresses
|
||||
* and a range of ports.
|
||||
*
|
||||
* @b Constructors:
|
||||
* - traffic_selector_create_from_bytes()
|
||||
* - traffic_selector_create_from_string()
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
struct traffic_selector_t {
|
||||
@@ -158,8 +162,7 @@ struct traffic_selector_t {
|
||||
/**
|
||||
* @brief Destroys the ts object
|
||||
*
|
||||
*
|
||||
* @param this calling object
|
||||
* @param this calling object
|
||||
*/
|
||||
void (*destroy) (traffic_selector_t *this);
|
||||
};
|
||||
@@ -174,8 +177,8 @@ struct traffic_selector_t {
|
||||
* @param to_addr end of address range as string
|
||||
* @param to_port port number in host order
|
||||
* @return
|
||||
* - created traffic_selector_t
|
||||
* - NULL if invalid address strings
|
||||
* - traffic_selector_t object
|
||||
* - NULL if invalid address strings/protocol
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
@@ -195,9 +198,9 @@ traffic_selector_t *traffic_selector_create_from_string(u_int8_t protocol, ts_ty
|
||||
* @param to_addr end of address range as string, network
|
||||
* @param to_port port number, host order
|
||||
* @return
|
||||
* - created traffic_selector_t
|
||||
* - NULL if invalid address strings
|
||||
*
|
||||
* - traffic_selector_t object
|
||||
* - NULL if invalid address input/protocol
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
traffic_selector_t *traffic_selector_create_from_bytes(u_int8_t protocol, ts_type_t type, chunk_t from_address, int16_t from_port, chunk_t to_address, u_int16_t to_port);
|
||||
|
||||
Reference in New Issue
Block a user