- logger in utils

- allocator in utils
- tests.c -> testcases/testcases.c
This commit is contained in:
Martin Willi
2005-11-11 13:52:11 +00:00
parent b85d20d117
commit 8887824292
64 changed files with 113 additions and 96 deletions
+3 -2
View File
@@ -24,10 +24,11 @@
#include <stdlib.h> #include <stdlib.h>
#include "allocator.h"
#include "types.h"
#include "configuration.h" #include "configuration.h"
#include "types.h"
#include "utils/allocator.h"
/** /**
* Private data of an configuration_t object * Private data of an configuration_t object
*/ */
@@ -28,9 +28,9 @@
#include <stdlib.h> #include <stdlib.h>
#include "types.h" #include "../types.h"
#include "encodings.h" #include "encodings.h"
#include "encodings/ike_header.h" #include "ike_header.h"
extern payload_info_t ike_header_info; extern payload_info_t ike_header_info;
@@ -29,8 +29,8 @@
#ifndef ENCODINGS_H_ #ifndef ENCODINGS_H_
#define ENCODINGS_H_ #define ENCODINGS_H_
#include "types.h" #include "../types.h"
#include "definitions.h" #include "../definitions.h"
/** /**
+1 -1
View File
@@ -24,7 +24,7 @@
/* offsetof macro */ /* offsetof macro */
#include <stddef.h> #include <stddef.h>
#include "../encodings.h" #include "sencodings.h"
#include "ike_header.h" #include "ike_header.h"
/** /**
+1
View File
@@ -25,6 +25,7 @@
#ifndef IKE_HEADER_H_ #ifndef IKE_HEADER_H_
#define IKE_HEADER_H_ #define IKE_HEADER_H_
#include "../types.h"
/** /**
* Data structure to hold the data of an IKEv2-Header * Data structure to hold the data of an IKEv2-Header
+4 -2
View File
@@ -25,10 +25,12 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <stdio.h> #include <stdio.h>
#include "allocator.h"
#include "types.h"
#include "generator.h" #include "generator.h"
#include "types.h"
#include "utils/allocator.h"
typedef struct private_generator_context_s private_generator_context_t; typedef struct private_generator_context_s private_generator_context_t;
+1 -1
View File
@@ -24,7 +24,7 @@
#define GENERATOR_H_ #define GENERATOR_H_
#include "types.h" #include "types.h"
#include "encodings.h" #include "encodings/encodings.h"
/** /**
* Generating is done in a data buffer. * Generating is done in a data buffer.
+2 -2
View File
@@ -23,11 +23,11 @@
#ifndef GLOBALS_H_ #ifndef GLOBALS_H_
#define GLOBALS_H_ #define GLOBALS_H_
#include "socket.h"
#include "queues/send_queue.h" #include "queues/send_queue.h"
#include "queues/job_queue.h" #include "queues/job_queue.h"
#include "queues/event_queue.h" #include "queues/event_queue.h"
#include "socket.h" #include "utils/logger_manager.h"
#include "logger_manager.h"
extern send_queue_t *global_send_queue; extern send_queue_t *global_send_queue;
+4 -3
View File
@@ -21,11 +21,12 @@
* for more details. * for more details.
*/ */
#include "allocator.h"
#include "types.h"
#include "utils/linked_list.h"
#include "ike_sa.h" #include "ike_sa.h"
#include "types.h"
#include "utils/allocator.h"
#include "utils/linked_list.h"
/** /**
* States in which a IKE_SA can actually be * States in which a IKE_SA can actually be
+3 -2
View File
@@ -23,10 +23,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "allocator.h"
#include "types.h"
#include "ike_sa_id.h" #include "ike_sa_id.h"
#include "types.h"
#include "utils/allocator.h"
/** /**
* Private data of an ike_sa_id object * Private data of an ike_sa_id object
*/ */
+3 -2
View File
@@ -23,10 +23,11 @@
#include <pthread.h> #include <pthread.h>
#include <string.h> #include <string.h>
#include "allocator.h"
#include "ike_sa_manager.h" #include "ike_sa_manager.h"
#include "utils/linked_list.h"
#include "ike_sa_id.h" #include "ike_sa_id.h"
#include "utils/allocator.h"
#include "utils/linked_list.h"
/** /**
* @brief An entry in the linked list, contains IKE_SA, locking and lookup data. * @brief An entry in the linked list, contains IKE_SA, locking and lookup data.
+2 -1
View File
@@ -22,9 +22,10 @@
#include <stdlib.h> #include <stdlib.h>
#include "allocator.h"
#include "job.h" #include "job.h"
#include "utils/allocator.h"
/** /**
* @brief implements function destroy of job_t * @brief implements function destroy of job_t
*/ */
+2 -2
View File
@@ -24,11 +24,11 @@
#include "message.h" #include "message.h"
#include "allocator.h"
#include "types.h" #include "types.h"
#include "ike_sa_id.h" #include "ike_sa_id.h"
#include "utils/linked_list.h" #include "utils/linked_list.h"
#include "encodings.h" #include "utils/allocator.h"
#include "encodings/encodings.h"
/** /**
* Entry for a payload in the internal used linked list * Entry for a payload in the internal used linked list
+3 -1
View File
@@ -20,9 +20,11 @@
* for more details. * for more details.
*/ */
#include "allocator.h"
#include "packet.h" #include "packet.h"
#include "utils/allocator.h"
/** /**
* Private data of an packet_t object * Private data of an packet_t object
+5 -4
View File
@@ -23,12 +23,13 @@
#include <stdlib.h> #include <stdlib.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "allocator.h" #include "parser.h"
#include "types.h"
#include "definitions.h" #include "definitions.h"
#include "globals.h" #include "globals.h"
#include "types.h" #include "utils/allocator.h"
#include "parser.h" #include "utils/logger.h"
#include "logger.h"
/** /**
* @private data stored in a context * @private data stored in a context
+1 -1
View File
@@ -24,7 +24,7 @@
#define PARSER_H_ #define PARSER_H_
#include "types.h" #include "types.h"
#include "encodings.h" #include "encodings/encodings.h"
/** /**
* @brief The parser context stores state information for a parsing session. * @brief The parser context stores state information for a parsing session.
+1 -1
View File
@@ -25,8 +25,8 @@
#include "event_queue.h" #include "event_queue.h"
#include "../allocator.h"
#include "../types.h" #include "../types.h"
#include "../utils/allocator.h"
#include "../utils/linked_list.h" #include "../utils/linked_list.h"
+1 -1
View File
@@ -25,7 +25,7 @@
#include "job_queue.h" #include "job_queue.h"
#include "../allocator.h" #include "../utils/allocator.h"
#include "../utils/linked_list.h" #include "../utils/linked_list.h"
/** /**
+1 -1
View File
@@ -24,7 +24,7 @@
#include "send_queue.h" #include "send_queue.h"
#include "../allocator.h" #include "../utils/allocator.h"
#include "../utils/linked_list.h" #include "../utils/linked_list.h"
/** /**
+1 -1
View File
@@ -25,12 +25,12 @@
#include "receiver.h" #include "receiver.h"
#include "allocator.h"
#include "socket.h" #include "socket.h"
#include "packet.h" #include "packet.h"
#include "job.h" #include "job.h"
#include "queues/job_queue.h" #include "queues/job_queue.h"
#include "globals.h" #include "globals.h"
#include "utils/allocator.h"
/** /**
* Private data of a receiver object * Private data of a receiver object
+2 -2
View File
@@ -25,9 +25,9 @@
#include "scheduler.h" #include "scheduler.h"
#include "allocator.h"
#include "queues/job_queue.h"
#include "globals.h" #include "globals.h"
#include "utils/allocator.h"
#include "queues/job_queue.h"
/** /**
* Private data of a scheduler object * Private data of a scheduler object
+2 -2
View File
@@ -25,11 +25,11 @@
#include "sender.h" #include "sender.h"
#include "allocator.h"
#include "socket.h" #include "socket.h"
#include "packet.h" #include "packet.h"
#include "queues/send_queue.h"
#include "globals.h" #include "globals.h"
#include "queues/send_queue.h"
#include "utils/allocator.h"
/** /**
* Private data of a sender object * Private data of a sender object
+2 -1
View File
@@ -29,9 +29,10 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "allocator.h"
#include "socket.h" #include "socket.h"
#include "utils/allocator.h"
typedef struct private_socket_s private_socket_t; typedef struct private_socket_s private_socket_t;
struct private_socket_s{ struct private_socket_s{
+2 -2
View File
@@ -23,9 +23,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
#include "../allocator.h"
#include "event_queue_test.h" #include "event_queue_test.h"
#include "../tester.h"
#include "../utils/allocator.h"
#include "../queues/event_queue.h" #include "../queues/event_queue.h"
/** /**
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef EVENT_QUEUE_TEST_H_ #ifndef EVENT_QUEUE_TEST_H_
#define EVENT_QUEUE_TEST_H_ #define EVENT_QUEUE_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the event_queue functionality * @brief Test function used to test the event_queue functionality
+6 -6
View File
@@ -22,14 +22,14 @@
#include <string.h> #include <string.h>
#include "../globals.h"
#include "../allocator.h"
#include "../logger_manager.h"
#include "generator_test.h" #include "generator_test.h"
#include "../tester.h"
#include "../logger.h" #include "../globals.h"
#include "../encodings.h"
#include "../generator.h" #include "../generator.h"
#include "../utils/allocator.h"
#include "../utils/logger_manager.h"
#include "../utils/logger.h"
#include "../encodings/encodings.h"
#include "../encodings/ike_header.h" #include "../encodings/ike_header.h"
extern payload_info_t *payload_infos[]; extern payload_info_t *payload_infos[];
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef GENERATOR_TEST_H_ #ifndef GENERATOR_TEST_H_
#define GENERATOR_TEST_H_ #define GENERATOR_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the generator with unsupported payload * @brief Test function used to test the generator with unsupported payload
+1 -1
View File
@@ -21,7 +21,7 @@
*/ */
#include "ike_sa_id_test.h" #include "ike_sa_id_test.h"
#include "../tester.h"
#include "../ike_sa_id.h" #include "../ike_sa_id.h"
/* /*
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef IKE_SA_ID_TEST_H_ #ifndef IKE_SA_ID_TEST_H_
#define IKE_SA_ID_TEST_H_ #define IKE_SA_ID_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the ike_sa_id functionality * @brief Test function used to test the ike_sa_id functionality
@@ -25,8 +25,8 @@
#include <unistd.h> #include <unistd.h>
#include "ike_sa_manager_test.h" #include "ike_sa_manager_test.h"
#include "../types.h" #include "../types.h"
#include "../tester.h"
#include "../ike_sa_manager.h" #include "../ike_sa_manager.h"
@@ -23,7 +23,7 @@
#ifndef IKE_SA_MANAGER_TEST_H_ #ifndef IKE_SA_MANAGER_TEST_H_
#define IKE_SA_MANAGER_TEST_H_ #define IKE_SA_MANAGER_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the ike_sa_manager_t functionality * @brief Test function used to test the ike_sa_manager_t functionality
+1 -1
View File
@@ -21,8 +21,8 @@
*/ */
#include "ike_sa_test.h" #include "ike_sa_test.h"
#include "../types.h" #include "../types.h"
#include "../tester.h"
#include "../message.h" #include "../message.h"
#include "../configuration.h" #include "../configuration.h"
#include "../ike_sa.h" #include "../ike_sa.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef IKE_SA_TEST_H_ #ifndef IKE_SA_TEST_H_
#define IKE_SA_TEST_H_ #define IKE_SA_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the ike_sa_t functionality * @brief Test function used to test the ike_sa_t functionality
+2 -2
View File
@@ -25,9 +25,9 @@
#include <pthread.h> #include <pthread.h>
#include <unistd.h> #include <unistd.h>
#include "../allocator.h"
#include "job_queue_test.h" #include "job_queue_test.h"
#include "../tester.h"
#include "../utils/allocator.h"
#include "../queues/job_queue.h" #include "../queues/job_queue.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef JOB_QUEUE_TEST_H_ #ifndef JOB_QUEUE_TEST_H_
#define JOB_QUEUE_TEST_H_ #define JOB_QUEUE_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the job_queue functionality * @brief Test function used to test the job_queue functionality
+2 -1
View File
@@ -22,7 +22,8 @@
#include <string.h> #include <string.h>
#include "../tester.h" #include "linked_list_test.h"
#include "../utils/linked_list.h" #include "../utils/linked_list.h"
/* /*
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef LINKED_LIST_TEST_H_ #ifndef LINKED_LIST_TEST_H_
#define LINKED_LIST_TEST_H_ #define LINKED_LIST_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function for the type linked_list_t * @brief Test function for the type linked_list_t
+3 -1
View File
@@ -21,9 +21,11 @@
*/ */
#include <string.h> #include <string.h>
#include "packet_test.h" #include "packet_test.h"
#include "../allocator.h"
#include "../packet.h" #include "../packet.h"
#include "../utils/allocator.h"
/* /*
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef PACKET_TEST_H_ #ifndef PACKET_TEST_H_
#define PACKET_TEST_H_ #define PACKET_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the packet_t functionality * @brief Test function used to test the packet_t functionality
+4 -4
View File
@@ -21,13 +21,13 @@
#include <string.h> #include <string.h>
#include "../allocator.h"
#include "parser_test.h" #include "parser_test.h"
#include "../tester.h"
#include "../logger_manager.h"
#include "../encodings.h"
#include "../generator.h" #include "../generator.h"
#include "../parser.h" #include "../parser.h"
#include "../utils/allocator.h"
#include "../utils/logger_manager.h"
#include "../encodings/encodings.h"
#include "../encodings/ike_header.h" #include "../encodings/ike_header.h"
extern payload_info_t *payload_infos[]; extern payload_info_t *payload_infos[];
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef PARSER_TEST_H_ #ifndef PARSER_TEST_H_
#define PARSER_TEST_H_ #define PARSER_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
void test_parser_with_header_payload(tester_t *tester); void test_parser_with_header_payload(tester_t *tester);
+4 -2
View File
@@ -23,14 +23,16 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "../allocator.h" #include "receiver_test.h"
#include "sender_test.h"
#include "../globals.h" #include "../globals.h"
#include "../receiver.h" #include "../receiver.h"
#include "../packet.h" #include "../packet.h"
#include "../socket.h" #include "../socket.h"
#include "../queues/send_queue.h" #include "../queues/send_queue.h"
#include "../queues/job_queue.h" #include "../queues/job_queue.h"
#include "../encodings/encodings.h"
#include "../utils/allocator.h"
/** /**
* Number of packets to send by sender-thread * Number of packets to send by sender-thread
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef RECEIVER_TEST_H_ #ifndef RECEIVER_TEST_H_
#define RECEIVER_TEST_H_ #define RECEIVER_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function for the type receiver_t * @brief Test function for the type receiver_t
+1
View File
@@ -24,6 +24,7 @@
#include <unistd.h> #include <unistd.h>
#include "scheduler_test.h" #include "scheduler_test.h"
#include "../globals.h" #include "../globals.h"
#include "../scheduler.h" #include "../scheduler.h"
#include "../queues/event_queue.h" #include "../queues/event_queue.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef SCHEDULER_TEST_H_ #ifndef SCHEDULER_TEST_H_
#define SCHEDULER_TEST_H_ #define SCHEDULER_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function for the type scheduler_t * @brief Test function for the type scheduler_t
+1 -1
View File
@@ -23,7 +23,7 @@
#include <pthread.h> #include <pthread.h>
#include "send_queue_test.h" #include "send_queue_test.h"
#include "../tester.h"
#include "../queues/send_queue.h" #include "../queues/send_queue.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef SEND_QUEUE_TEST_H_ #ifndef SEND_QUEUE_TEST_H_
#define SEND_QUEUE_TEST_H_ #define SEND_QUEUE_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function used to test the send_queue functionality * @brief Test function used to test the send_queue functionality
+2 -1
View File
@@ -22,14 +22,15 @@
#include <string.h> #include <string.h>
#include "../allocator.h"
#include "sender_test.h" #include "sender_test.h"
#include "../globals.h" #include "../globals.h"
#include "../sender.h" #include "../sender.h"
#include "../packet.h" #include "../packet.h"
#include "../socket.h" #include "../socket.h"
#include "../queues/send_queue.h" #include "../queues/send_queue.h"
#include "../queues/job_queue.h" #include "../queues/job_queue.h"
#include "../utils/allocator.h"
/** /**
* Number of packets to send by sender-thread * Number of packets to send by sender-thread
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef SENDER_TEST_H_ #ifndef SENDER_TEST_H_
#define SENDER_TEST_H_ #define SENDER_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function for the type sender_t * @brief Test function for the type sender_t
+2 -2
View File
@@ -23,10 +23,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "../allocator.h"
#include "socket_test.h" #include "socket_test.h"
#include "../tester.h"
#include "../socket.h" #include "../socket.h"
#include "../utils/allocator.h"
/* /*
* Description in header file * Description in header file
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef SOCKET_TEST_H_ #ifndef SOCKET_TEST_H_
#define SOCKET_TEST_H_ #define SOCKET_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function for the type socket_t * @brief Test function for the type socket_t
+3 -3
View File
@@ -23,13 +23,13 @@
#include <stdio.h> #include <stdio.h>
#include "../logger_manager.h"
#include "../allocator.h"
#include "../tester.h"
#include "../queues/job_queue.h" #include "../queues/job_queue.h"
#include "../queues/event_queue.h" #include "../queues/event_queue.h"
#include "../queues/send_queue.h" #include "../queues/send_queue.h"
#include "../socket.h" #include "../socket.h"
#include "../utils/logger_manager.h"
#include "../utils/allocator.h"
#include "../utils/tester.h"
#include "linked_list_test.h" #include "linked_list_test.h"
#include "thread_pool_test.h" #include "thread_pool_test.h"
#include "job_queue_test.h" #include "job_queue_test.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "thread_pool_test.h" #include "thread_pool_test.h"
#include "../tester.h"
#include "../thread_pool.h" #include "../thread_pool.h"
/* /*
+1 -1
View File
@@ -23,7 +23,7 @@
#ifndef THREAD_POOL_TEST_H_ #ifndef THREAD_POOL_TEST_H_
#define THREAD_POOL_TEST_H_ #define THREAD_POOL_TEST_H_
#include "../tester.h" #include "../utils/tester.h"
/** /**
* @brief Test function for the type thread_pool_t * @brief Test function for the type thread_pool_t
+3 -3
View File
@@ -27,10 +27,10 @@
#include "thread_pool.h" #include "thread_pool.h"
#include "allocator.h"
#include "logger.h"
#include "queues/job_queue.h"
#include "globals.h" #include "globals.h"
#include "queues/job_queue.h"
#include "utils/allocator.h"
#include "utils/logger.h"
/** /**
* @brief structure with private members for thread_pool_t * @brief structure with private members for thread_pool_t
@@ -29,7 +29,6 @@
#include <stdio.h> #include <stdio.h>
#include "allocator.h" #include "allocator.h"
#include "types.h"
#ifdef LEAK_DETECTIVE #ifdef LEAK_DETECTIVE
@@ -28,7 +28,7 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include "types.h" #include "../types.h"
/** /**
+1 -1
View File
@@ -24,7 +24,7 @@
#include "linked_list.h" #include "linked_list.h"
#include "../allocator.h" #include "allocator.h"
typedef struct linked_list_element_s linked_list_element_t; typedef struct linked_list_element_s linked_list_element_t;
@@ -27,8 +27,8 @@
#include <time.h> #include <time.h>
#include "logger.h" #include "logger.h"
#include "daemon.h"
#include "types.h" #include "../daemon.h"
#include "allocator.h" #include "allocator.h"
/** /**
@@ -24,7 +24,7 @@
#define LOGGER_H_ #define LOGGER_H_
#include <stdio.h> #include <stdio.h>
#include "types.h" #include "../types.h"
/** /**
* Log Levels supported by the logger object * Log Levels supported by the logger object
@@ -24,7 +24,7 @@
#include "logger_manager.h" #include "logger_manager.h"
#include "allocator.h" #include "allocator.h"
#include "utils/linked_list.h" #include "linked_list.h"
/** /**
* Maximum length of a logger name * Maximum length of a logger name
@@ -29,9 +29,8 @@
#include "tester.h" #include "tester.h"
#include "allocator.h" #include "allocator.h"
#include "utils/linked_list.h" #include "linked_list.h"
#include "thread_pool.h" #include "../queues/job_queue.h"
#include "queues/job_queue.h"
/** /**
* @brief Private Variables and Functions of tester class * @brief Private Variables and Functions of tester class
@@ -25,7 +25,7 @@
#include <stdio.h> #include <stdio.h>
#include "types.h" #include "../types.h"