diff options
author | Martin Willi <martin@strongswan.org> | 2005-11-29 08:08:03 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2005-11-29 08:08:03 +0000 |
commit | df3c59d0889a337eff9f994e92a5dc165ba1729f (patch) | |
tree | 7973747444155ea669e3f2dc1177b9b2eb3fc8a1 /Source/charon/sa | |
parent | ed37dee61daf5bb272c04b79787da282abaa9447 (diff) | |
download | strongswan-df3c59d0889a337eff9f994e92a5dc165ba1729f.tar.bz2 strongswan-df3c59d0889a337eff9f994e92a5dc165ba1729f.tar.xz |
- changed allocation behavior
Diffstat (limited to 'Source/charon/sa')
-rw-r--r-- | Source/charon/sa/ike_sa.c | 4 | ||||
-rw-r--r-- | Source/charon/sa/ike_sa.h | 8 | ||||
-rw-r--r-- | Source/charon/sa/ike_sa_id.c | 3 | ||||
-rw-r--r-- | Source/charon/sa/ike_sa_id.h | 4 | ||||
-rw-r--r-- | Source/charon/sa/ike_sa_manager.c | 19 | ||||
-rw-r--r-- | Source/charon/sa/ike_sa_manager.h | 5 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_auth_requested.c | 2 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_auth_requested.h | 8 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_sa_established.c | 3 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_sa_established.h | 12 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_sa_init_requested.c | 2 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_sa_init_requested.h | 11 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_sa_init_responded.c | 3 | ||||
-rw-r--r-- | Source/charon/sa/states/ike_sa_init_responded.h | 13 | ||||
-rw-r--r-- | Source/charon/sa/states/initiator_init.h | 9 | ||||
-rw-r--r-- | Source/charon/sa/states/responder_init.h | 5 | ||||
-rw-r--r-- | Source/charon/sa/states/state.c | 2 | ||||
-rw-r--r-- | Source/charon/sa/states/state.h | 7 |
18 files changed, 76 insertions, 44 deletions
diff --git a/Source/charon/sa/ike_sa.c b/Source/charon/sa/ike_sa.c index 33a7fd388..91ab32390 100644 --- a/Source/charon/sa/ike_sa.c +++ b/Source/charon/sa/ike_sa.c @@ -1,8 +1,7 @@ /** * @file ike_sa.c * - * @brief Class ike_sa_t. An object of this type is managed by an - * ike_sa_manager_t object and represents an IKE_SA + * @brief Implementation of ike_sa_t. * */ @@ -57,7 +56,6 @@ struct private_ike_sa_t { */ protected_ike_sa_t protected; - /** * Creates a job to delete the given IKE_SA. * diff --git a/Source/charon/sa/ike_sa.h b/Source/charon/sa/ike_sa.h index 9545822fd..b4abfa48c 100644 --- a/Source/charon/sa/ike_sa.h +++ b/Source/charon/sa/ike_sa.h @@ -38,6 +38,8 @@ /** * Nonce size in bytes of all sent nonces + * + * @ingroup sa */ #define NONCE_SIZE 16 @@ -46,6 +48,8 @@ typedef struct ike_sa_t ike_sa_t; /** * @brief Class ike_sa_t. An object of this type is managed by an * ike_sa_manager_t object and represents an IKE_SA. + * + * @ingroup sa */ struct ike_sa_t { @@ -90,6 +94,8 @@ typedef struct protected_ike_sa_t protected_ike_sa_t; * * This members should only be accessed from * the varius state classes. + * + * @ingroup sa */ struct protected_ike_sa_t { @@ -239,6 +245,8 @@ struct protected_ike_sa_t { * e.g. when a IKE_SA_INIT has been finished. * * @return created ike_sa_t object + * + * @ingroup sa */ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id); diff --git a/Source/charon/sa/ike_sa_id.c b/Source/charon/sa/ike_sa_id.c index f5c93cf47..ebc721918 100644 --- a/Source/charon/sa/ike_sa_id.c +++ b/Source/charon/sa/ike_sa_id.c @@ -56,7 +56,6 @@ struct private_ike_sa_id_t { }; - /** * implements ike_sa_id_t.set_responder_spi. */ @@ -94,7 +93,7 @@ static u_int64_t get_responder_spi (private_ike_sa_id_t *this) */ static bool equals (private_ike_sa_id_t *this, private_ike_sa_id_t *other) { - if ((this == NULL)||(other == NULL)) + if (other == NULL) { return FALSE; } diff --git a/Source/charon/sa/ike_sa_id.h b/Source/charon/sa/ike_sa_id.h index 2b4b643d3..0df752496 100644 --- a/Source/charon/sa/ike_sa_id.h +++ b/Source/charon/sa/ike_sa_id.h @@ -34,6 +34,8 @@ typedef struct ike_sa_id_t ike_sa_id_t; * An IKE_SA is identified by its initiator and responder spi's. * Additionaly it contains the role of the actual running IKEv2-Daemon * for the specific IKE_SA. + * + * @ingroup sa */ struct ike_sa_id_t { @@ -131,6 +133,8 @@ struct ike_sa_id_t { * @param responder_spi responders spi * @param is_initiator TRUE if we are the original initiator * @return created ike_sa_id_t object + * + * @ingroup sa */ ike_sa_id_t * ike_sa_id_create(u_int64_t initiator_spi, u_int64_t responder_spi, bool is_initiaor); diff --git a/Source/charon/sa/ike_sa_manager.c b/Source/charon/sa/ike_sa_manager.c index 698d69315..943502dcb 100644 --- a/Source/charon/sa/ike_sa_manager.c +++ b/Source/charon/sa/ike_sa_manager.c @@ -1,7 +1,7 @@ /** * @file ike_sa_manager.c * - * @brief Central point for managing IKE-SAs (creation, locking, deleting...) + * @brief Implementation of ike_sa_mananger_t. * */ @@ -35,7 +35,7 @@ typedef struct ike_sa_entry_t ike_sa_entry_t; /** - * @brief An entry in the linked list, contains IKE_SA, locking and lookup data. + * An entry in the linked list, contains IKE_SA, locking and lookup data. */ struct ike_sa_entry_t { /** @@ -73,7 +73,7 @@ struct ike_sa_entry_t { }; /** - * @see ike_sa_entry_t.destroy + * Implements ike_sa_entry_t.destroy. */ static status_t ike_sa_entry_destroy(ike_sa_entry_t *this) { @@ -87,7 +87,7 @@ static status_t ike_sa_entry_destroy(ike_sa_entry_t *this) /** * @brief creates a new entry for the ike_sa list * - * This constructor additionaly creates a new and empty SA + * This constructor additionaly creates a new and empty SA. * * @param ike_sa_id the associated ike_sa_id_t, will be cloned * @return created entry, with ike_sa and ike_sa_id @@ -130,7 +130,7 @@ struct private_ike_sa_manager_t { /** * @brief get next spi * - * we give out SPIs incremental + * we give out SPIs incremental. * * @param this the ike_sa_manager * @return the next spi @@ -138,7 +138,7 @@ struct private_ike_sa_manager_t { u_int64_t (*get_next_spi) (private_ike_sa_manager_t *this); /** - * @brief find the ike_sa_entry in the list by SPIs + * @brief find the ike_sa_entry in the list by SPIs. * * This function simply iterates over the linked list. A hash-table * would be more efficient when storing a lot of IKE_SAs... @@ -199,7 +199,6 @@ struct private_ike_sa_manager_t { u_int64_t next_spi; }; - /** * Implements private_ike_sa_manager_t.get_entry_by_id. */ @@ -468,8 +467,7 @@ static status_t checkout(private_ike_sa_manager_t *this, ike_sa_id_t *ike_sa_id, } /** - * Implements ike_sa_manager_t-function checkin. - * @see ike_sa_manager_t.checkin. + * Implements ike_sa_manager_t.checkin. */ static status_t checkin(private_ike_sa_manager_t *this, ike_sa_t *ike_sa) { @@ -506,8 +504,7 @@ static status_t checkin(private_ike_sa_manager_t *this, ike_sa_t *ike_sa) /** - * Implements ike_sa_manager_t-function checkin_and_delete. - * @see ike_sa_manager_t.checkin_and_delete. + * Implements ike_sa_manager_t.checkin_and_delete. */ static status_t checkin_and_delete(private_ike_sa_manager_t *this, ike_sa_t *ike_sa) { diff --git a/Source/charon/sa/ike_sa_manager.h b/Source/charon/sa/ike_sa_manager.h index ae54e618a..e86cfe83c 100644 --- a/Source/charon/sa/ike_sa_manager.h +++ b/Source/charon/sa/ike_sa_manager.h @@ -38,7 +38,8 @@ typedef struct ike_sa_manager_t ike_sa_manager_t; * * @todo checking of double-checkouts from the same threads would be nice. * This could be by comparing thread-ids via pthread_self()... - * + * + * @ingroup sa */ struct ike_sa_manager_t { /** @@ -128,6 +129,8 @@ struct ike_sa_manager_t { * @brief Create a manager * * @returns the created manager + * + * @ingroup sa */ ike_sa_manager_t *ike_sa_manager_create(); diff --git a/Source/charon/sa/states/ike_auth_requested.c b/Source/charon/sa/states/ike_auth_requested.c index 28ff3a0f5..9f7d5b958 100644 --- a/Source/charon/sa/states/ike_auth_requested.c +++ b/Source/charon/sa/states/ike_auth_requested.c @@ -1,7 +1,7 @@ /** * @file ike_auth_requested.c * - * @brief State of an IKE_SA, which has requested an IKE_AUTH. + * @brief Implementation of ike_auth_requested_t. * */ diff --git a/Source/charon/sa/states/ike_auth_requested.h b/Source/charon/sa/states/ike_auth_requested.h index 2b8bc776a..c75a65ff2 100644 --- a/Source/charon/sa/states/ike_auth_requested.h +++ b/Source/charon/sa/states/ike_auth_requested.h @@ -1,7 +1,7 @@ /** * @file ike_auth_requested.h * - * @brief State of an IKE_SA, which has requested an IKE_AUTH. + * @brief Interface of ike_auth_requested_t. * */ @@ -31,7 +31,8 @@ typedef struct ike_auth_requested_t ike_auth_requested_t; /** * @brief This class represents an IKE_SA, which has requested an IKE_AUTH. - * + * + * @ingroup states */ struct ike_auth_requested_t { /** @@ -45,6 +46,9 @@ struct ike_auth_requested_t { * Constructor of class ike_auth_requested_t * * @param ike_sa assigned ike_sa object + * @return created ike_auth_requested_t object + * + * @ingroup states */ ike_auth_requested_t *ike_auth_requested_create(protected_ike_sa_t *ike_sa); diff --git a/Source/charon/sa/states/ike_sa_established.c b/Source/charon/sa/states/ike_sa_established.c index d1f9a6bd7..99e9a7291 100644 --- a/Source/charon/sa/states/ike_sa_established.c +++ b/Source/charon/sa/states/ike_sa_established.c @@ -1,7 +1,7 @@ /** * @file ike_sa_established.c * - * @brief State of an established IKE_SA. + * @brief Implementation of ike_sa_established_t. * */ @@ -29,7 +29,6 @@ typedef struct private_ike_sa_established_t private_ike_sa_established_t; /** * Private data of a ike_sa_established_t object. - * */ struct private_ike_sa_established_t { /** diff --git a/Source/charon/sa/states/ike_sa_established.h b/Source/charon/sa/states/ike_sa_established.h index 68581d155..6afc495cb 100644 --- a/Source/charon/sa/states/ike_sa_established.h +++ b/Source/charon/sa/states/ike_sa_established.h @@ -1,7 +1,7 @@ /** * @file ike_sa_established.h * - * @brief State of an established IKE_SA. + * @brief Interface of ike_sa_established_t. * */ @@ -29,9 +29,10 @@ typedef struct ike_sa_established_t ike_sa_established_t; /** - * @brief This class represents an the state of an established. + * @brief This class represents an the state of an established * IKE_SA. - * + * + * @ingroup states */ struct ike_sa_established_t { /** @@ -44,7 +45,10 @@ struct ike_sa_established_t { /** * Constructor of class ike_sa_established_t * - * @param ike_sa assigned ike_sa + * @param ike_sa assigned ike_sa + * @return created ike_sa_established_t object + * + * @ingroup states */ ike_sa_established_t *ike_sa_established_create(protected_ike_sa_t *ike_sa); diff --git a/Source/charon/sa/states/ike_sa_init_requested.c b/Source/charon/sa/states/ike_sa_init_requested.c index f301b307d..d682a769c 100644 --- a/Source/charon/sa/states/ike_sa_init_requested.c +++ b/Source/charon/sa/states/ike_sa_init_requested.c @@ -1,7 +1,7 @@ /** * @file ike_sa_init_requested.c * - * @brief State of a IKE_SA after requesting an IKE_SA_INIT + * @brief Implementation of ike_sa_init_requested_t. * */ diff --git a/Source/charon/sa/states/ike_sa_init_requested.h b/Source/charon/sa/states/ike_sa_init_requested.h index 0c1c01b67..01bef9357 100644 --- a/Source/charon/sa/states/ike_sa_init_requested.h +++ b/Source/charon/sa/states/ike_sa_init_requested.h @@ -1,7 +1,7 @@ /** * @file ike_sa_init_requested.h * - * @brief State of a IKE_SA after requesting an IKE_SA_INIT + * @brief Interface of ike_sa_init_requestet_t. * */ @@ -33,22 +33,25 @@ typedef struct ike_sa_init_requested_t ike_sa_init_requested_t; /** * @brief This class represents an IKE_SA state when requested an IKE_SA_INIT. - * + * + * @ingroup states */ struct ike_sa_init_requested_t { /** * methods of the state_t interface */ state_t state_interface; - }; /** * Constructor of class ike_sa_init_responded_t * - * @param ike_sa assigned ike_sa + * @param ike_sa assigned ike_sa * @param diffie_hellman diffie_hellman object use to retrieve shared secret * @param sent_nonce Sent nonce value + * @return created ike_sa_init_request_t object + * + * @ingroup states */ ike_sa_init_requested_t *ike_sa_init_requested_create(protected_ike_sa_t *ike_sa, u_int16_t dh_group_priority, diffie_hellman_t *diffie_hellman, chunk_t sent_nonce); diff --git a/Source/charon/sa/states/ike_sa_init_responded.c b/Source/charon/sa/states/ike_sa_init_responded.c index c4f7e2d54..8725a001a 100644 --- a/Source/charon/sa/states/ike_sa_init_responded.c +++ b/Source/charon/sa/states/ike_sa_init_responded.c @@ -87,7 +87,7 @@ static ike_sa_state_t get_state(private_ike_sa_init_responded_t *this) /** * Implements state_t.get_state */ -static status_t destroy(private_ike_sa_init_responded_t *this) +static void destroy(private_ike_sa_init_responded_t *this) { this->logger->log(this->logger, CONTROL | MORE, "Going to destroy ike_sa_init_responded_t state object"); @@ -101,7 +101,6 @@ static status_t destroy(private_ike_sa_init_responded_t *this) allocator_free(this->received_nonce.ptr); allocator_free(this); - return SUCCESS; } /* diff --git a/Source/charon/sa/states/ike_sa_init_responded.h b/Source/charon/sa/states/ike_sa_init_responded.h index 2e1fabc1d..aa07f76b9 100644 --- a/Source/charon/sa/states/ike_sa_init_responded.h +++ b/Source/charon/sa/states/ike_sa_init_responded.h @@ -29,8 +29,10 @@ typedef struct ike_sa_init_responded_t ike_sa_init_responded_t; /** - * @brief This class represents an IKE_SA state when responded to an IKE_SA_INIT request. - * + * @brief This class represents an IKE_SA state when + * responded to an IKE_SA_INIT request. + * + * @ingroup states */ struct ike_sa_init_responded_t { /** @@ -41,9 +43,12 @@ struct ike_sa_init_responded_t { }; /** - * Constructor of class ike_sa_init_responded_t + * @brief Constructor of class ike_sa_init_responded_t + * + * @param ike_sa assigned IKE_SA + * @todo Params description * - * @param ike_sa assigned IKE_SA + * @ingroup states */ ike_sa_init_responded_t *ike_sa_init_responded_create(protected_ike_sa_t *ike_sa, chunk_t shared_secret, chunk_t received_nonce, chunk_t sent_nonce); diff --git a/Source/charon/sa/states/initiator_init.h b/Source/charon/sa/states/initiator_init.h index c150eb6b1..f8c9e398b 100644 --- a/Source/charon/sa/states/initiator_init.h +++ b/Source/charon/sa/states/initiator_init.h @@ -1,7 +1,7 @@ /** * @file initiator_init.h * - * @brief Start state of a IKE_SA as initiator + * @brief Interface of initiator_init_t. * */ @@ -33,7 +33,8 @@ typedef struct initiator_init_t initiator_init_t; /** * @brief This class represents an IKE_SA state when initializing. * a connection as initiator - * + * + * @ingroup states */ struct initiator_init_t { /** @@ -52,9 +53,11 @@ struct initiator_init_t { }; /** - * Constructor of class initiator_init_t + * @brief Constructor of class initiator_init_t * * @param ike_sa assigned IKE_SA + * + * @ingroup states */ initiator_init_t *initiator_init_create(protected_ike_sa_t *ike_sa); diff --git a/Source/charon/sa/states/responder_init.h b/Source/charon/sa/states/responder_init.h index 1606579ab..8fe1c2919 100644 --- a/Source/charon/sa/states/responder_init.h +++ b/Source/charon/sa/states/responder_init.h @@ -32,7 +32,8 @@ typedef struct responder_init_t responder_init_t; /** * @brief This class represents an IKE_SA state when initializing. * a connection as responder. - * + * + * @ingroup states */ struct responder_init_t { /** @@ -48,6 +49,8 @@ struct responder_init_t { * @param ike_sa assigned IKE_SA * * @return responder_init state + * + * @ingroup states */ responder_init_t *responder_init_create(protected_ike_sa_t *ike_sa); diff --git a/Source/charon/sa/states/state.c b/Source/charon/sa/states/state.c index 661eaa39a..7e6635c23 100644 --- a/Source/charon/sa/states/state.c +++ b/Source/charon/sa/states/state.c @@ -1,7 +1,7 @@ /** * @file state.c * - * @brief Interface for a specific IKE_SA state + * @brief Interface additions to ike_sa_sate_t. * */ diff --git a/Source/charon/sa/states/state.h b/Source/charon/sa/states/state.h index 471822f88..e19253f8e 100644 --- a/Source/charon/sa/states/state.h +++ b/Source/charon/sa/states/state.h @@ -1,7 +1,7 @@ /** * @file state.h * - * @brief Interface for a specific IKE_SA state. + * @brief Interface ike_sa_sate_t. * */ @@ -33,6 +33,8 @@ typedef enum ike_sa_state_t ike_sa_state_t; /** * States in which a IKE_SA can actually be + * + * @ingroup states */ enum ike_sa_state_t { @@ -79,6 +81,8 @@ typedef struct state_t state_t; /** * @brief This interface represents an IKE_SA state + * + * @ingroup states */ struct state_t { @@ -109,5 +113,4 @@ struct state_t { void (*destroy) (state_t *this); }; - #endif /*STATE_H_*/ |