- split up in libstrong, charon, stroke, testing done

- new leak detective with malloc hook in library
  - useable, but needs improvements
- logger_manager has now a single instance per library
  - allows use of loggers from any linking prog
- a LOT of other things
This commit is contained in:
Martin Willi
2006-04-10 08:07:38 +00:00
parent 6862128151
commit 5113680f95
116 changed files with 1399 additions and 1610 deletions
+4 -5
View File
@@ -26,7 +26,6 @@
#include "event_queue.h"
#include <types.h>
#include <utils/allocator.h>
#include <utils/linked_list.h>
@@ -64,7 +63,7 @@ struct event_t{
*/
static void event_destroy(event_t *event)
{
allocator_free(event);
free(event);
}
/**
@@ -77,7 +76,7 @@ static void event_destroy(event_t *event)
*/
static event_t *event_create(timeval_t time, job_t *job)
{
event_t *this = allocator_alloc_thing(event_t);
event_t *this = malloc_thing(event_t);
this->destroy = event_destroy;
this->time = time;
@@ -326,7 +325,7 @@ static void event_queue_destroy(private_event_queue_t *this)
pthread_cond_destroy(&(this->condvar));
allocator_free(this);
free(this);
}
/*
@@ -334,7 +333,7 @@ static void event_queue_destroy(private_event_queue_t *this)
*/
event_queue_t *event_queue_create()
{
private_event_queue_t *this = allocator_alloc_thing(private_event_queue_t);
private_event_queue_t *this = malloc_thing(private_event_queue_t);
this->public.get_count = (int (*) (event_queue_t *event_queue)) get_count;
this->public.get = (job_t *(*) (event_queue_t *event_queue)) get;
+2 -3
View File
@@ -25,7 +25,6 @@
#include "job_queue.h"
#include <utils/allocator.h>
#include <utils/linked_list.h>
@@ -130,7 +129,7 @@ static void job_queue_destroy (private_job_queue_t *this)
pthread_cond_destroy(&(this->condvar));
allocator_free(this);
free(this);
}
/*
@@ -139,7 +138,7 @@ static void job_queue_destroy (private_job_queue_t *this)
*/
job_queue_t *job_queue_create()
{
private_job_queue_t *this = allocator_alloc_thing(private_job_queue_t);
private_job_queue_t *this = malloc_thing(private_job_queue_t);
this->public.get_count = (int(*)(job_queue_t*))get_count;
this->public.get = (job_t*(*)(job_queue_t*))get;
@@ -22,7 +22,6 @@
#include "delete_established_ike_sa_job.h"
#include <utils/allocator.h>
typedef struct private_delete_established_ike_sa_job_t private_delete_established_ike_sa_job_t;
@@ -64,7 +63,7 @@ static ike_sa_id_t *get_ike_sa_id(private_delete_established_ike_sa_job_t *this)
static void destroy(private_delete_established_ike_sa_job_t *this)
{
this->ike_sa_id->destroy(this->ike_sa_id);
allocator_free(this);
free(this);
}
/*
@@ -72,7 +71,7 @@ static void destroy(private_delete_established_ike_sa_job_t *this)
*/
delete_established_ike_sa_job_t *delete_established_ike_sa_job_create(ike_sa_id_t *ike_sa_id)
{
private_delete_established_ike_sa_job_t *this = allocator_alloc_thing(private_delete_established_ike_sa_job_t);
private_delete_established_ike_sa_job_t *this = malloc_thing(private_delete_established_ike_sa_job_t);
/* interface functions */
this->public.job_interface.get_type = (job_type_t (*) (job_t *)) get_type;
@@ -22,7 +22,6 @@
#include "delete_half_open_ike_sa_job.h"
#include <utils/allocator.h>
typedef struct private_delete_half_open_ike_sa_job_t private_delete_half_open_ike_sa_job_t;
@@ -64,7 +63,7 @@ static ike_sa_id_t *get_ike_sa_id(private_delete_half_open_ike_sa_job_t *this)
static void destroy(private_delete_half_open_ike_sa_job_t *this)
{
this->ike_sa_id->destroy(this->ike_sa_id);
allocator_free(this);
free(this);
}
/*
@@ -72,7 +71,7 @@ static void destroy(private_delete_half_open_ike_sa_job_t *this)
*/
delete_half_open_ike_sa_job_t *delete_half_open_ike_sa_job_create(ike_sa_id_t *ike_sa_id)
{
private_delete_half_open_ike_sa_job_t *this = allocator_alloc_thing(private_delete_half_open_ike_sa_job_t);
private_delete_half_open_ike_sa_job_t *this = malloc_thing(private_delete_half_open_ike_sa_job_t);
/* interface functions */
this->public.job_interface.get_type = (job_type_t (*) (job_t *)) get_type;
@@ -23,7 +23,6 @@
#include "incoming_packet_job.h"
#include <utils/allocator.h>
typedef struct private_incoming_packet_job_t private_incoming_packet_job_t;
@@ -68,7 +67,7 @@ static void destroy_all(private_incoming_packet_job_t *this)
{
this->packet->destroy(this->packet);
}
allocator_free(this);
free(this);
}
/**
@@ -77,7 +76,7 @@ static void destroy_all(private_incoming_packet_job_t *this)
static void destroy(job_t *job)
{
private_incoming_packet_job_t *this = (private_incoming_packet_job_t *) job;
allocator_free(this);
free(this);
}
/*
@@ -85,7 +84,7 @@ static void destroy(job_t *job)
*/
incoming_packet_job_t *incoming_packet_job_create(packet_t *packet)
{
private_incoming_packet_job_t *this = allocator_alloc_thing(private_incoming_packet_job_t);
private_incoming_packet_job_t *this = malloc_thing(private_incoming_packet_job_t);
/* interface functions */
this->public.job_interface.get_type = (job_type_t (*) (job_t *)) get_type;
@@ -25,7 +25,6 @@
#include "initiate_ike_sa_job.h"
#include <utils/allocator.h>
typedef struct private_initiate_ike_sa_job_t private_initiate_ike_sa_job_t;
@@ -68,7 +67,7 @@ static connection_t *get_connection(private_initiate_ike_sa_job_t *this)
static void destroy_all(private_initiate_ike_sa_job_t *this)
{
this->connection->destroy(this->connection);
allocator_free(this);
free(this);
}
/**
@@ -76,7 +75,7 @@ static void destroy_all(private_initiate_ike_sa_job_t *this)
*/
static void destroy(private_initiate_ike_sa_job_t *this)
{
allocator_free(this);
free(this);
}
/*
@@ -84,7 +83,7 @@ static void destroy(private_initiate_ike_sa_job_t *this)
*/
initiate_ike_sa_job_t *initiate_ike_sa_job_create(connection_t *connection)
{
private_initiate_ike_sa_job_t *this = allocator_alloc_thing(private_initiate_ike_sa_job_t);
private_initiate_ike_sa_job_t *this = malloc_thing(private_initiate_ike_sa_job_t);
/* interface functions */
this->public.job_interface.get_type = (job_type_t (*) (job_t *)) get_type;
@@ -23,7 +23,6 @@
#include "retransmit_request_job.h"
#include <utils/allocator.h>
typedef struct private_retransmit_request_job_t private_retransmit_request_job_t;
@@ -101,7 +100,7 @@ static u_int32_t get_message_id(private_retransmit_request_job_t *this)
static void destroy(private_retransmit_request_job_t *this)
{
this->ike_sa_id->destroy(this->ike_sa_id);
allocator_free(this);
free(this);
}
/*
@@ -109,7 +108,7 @@ static void destroy(private_retransmit_request_job_t *this)
*/
retransmit_request_job_t *retransmit_request_job_create(u_int32_t message_id,ike_sa_id_t *ike_sa_id)
{
private_retransmit_request_job_t *this = allocator_alloc_thing(private_retransmit_request_job_t);
private_retransmit_request_job_t *this = malloc_thing(private_retransmit_request_job_t);
/* interface functions */
this->public.job_interface.get_type = (job_type_t (*) (job_t *)) get_type;
+2 -3
View File
@@ -24,7 +24,6 @@
#include "send_queue.h"
#include <utils/allocator.h>
#include <utils/linked_list.h>
@@ -130,7 +129,7 @@ static void destroy (private_send_queue_t *this)
pthread_cond_destroy(&(this->condvar));
allocator_free(this);
free(this);
}
/*
@@ -139,7 +138,7 @@ static void destroy (private_send_queue_t *this)
*/
send_queue_t *send_queue_create()
{
private_send_queue_t *this = allocator_alloc_thing(private_send_queue_t);
private_send_queue_t *this = malloc_thing(private_send_queue_t);
this->public.get_count = (int(*)(send_queue_t*)) get_count;
this->public.get = (packet_t*(*)(send_queue_t*)) get;