better split up of library files "types.h" & "definitions.h"
centralized all printf specifier character definitions reuse of arginfo handlers more cleanups fixed more AMD64 issues added DEBUG_LEVEL compile flag to exclude DBGn() statements
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "configuration.h"
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
|
||||
/**
|
||||
* Timeout in milliseconds after that a half open IKE_SA gets deleted.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
typedef struct configuration_t configuration_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
|
||||
/**
|
||||
* @brief The interface for various daemon related configs.
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
typedef enum cert_policy_t cert_policy_t;
|
||||
typedef struct connection_t connection_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <utils/host.h>
|
||||
#include <utils/linked_list.h>
|
||||
#include <utils/identification.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
typedef struct connection_store_t connection_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <config/connections/connection.h>
|
||||
#include <utils/iterator.h>
|
||||
|
||||
|
||||
@@ -113,11 +113,9 @@ static connection_t *get_connection_by_hosts(private_local_connection_store_t *t
|
||||
|
||||
if (found)
|
||||
{
|
||||
host_t *found_my_host = found->get_my_host(found);
|
||||
host_t *found_other_host = found->get_other_host(found);
|
||||
|
||||
DBG2(DBG_CFG, "found matching connection \"%s\": %H...%H (prio=%d)",
|
||||
found->get_name(found), found_my_host, found_other_host, best_prio);
|
||||
found->get_name(found), found->get_my_host(found),
|
||||
found->get_other_host(found), best_prio);
|
||||
|
||||
/* give out a new reference to it */
|
||||
found->get_ref(found);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
typedef struct local_connection_store_t local_connection_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <config/connections/connection_store.h>
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
typedef struct credential_store_t credential_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <crypto/x509.h>
|
||||
#include <crypto/rsa/rsa_private_key.h>
|
||||
#include <crypto/rsa/rsa_public_key.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <utils/lexparser.h>
|
||||
#include <utils/linked_list.h>
|
||||
#include <crypto/certinfo.h>
|
||||
@@ -152,7 +152,7 @@ static status_t get_shared_key(private_local_credential_store_t *this,
|
||||
} prio_t;
|
||||
|
||||
prio_t best_prio = PRIO_UNDEFINED;
|
||||
chunk_t found = CHUNK_INITIALIZER;
|
||||
chunk_t found = chunk_empty;
|
||||
shared_key_t *shared_key;
|
||||
|
||||
iterator_t *iterator = this->shared_keys->create_iterator(this->shared_keys, TRUE);
|
||||
@@ -511,11 +511,8 @@ static bool verify(private_local_credential_store_t *this, x509_t *cert, bool *f
|
||||
rsa_public_key_t *issuer_public_key;
|
||||
bool valid_signature;
|
||||
|
||||
identification_t *subject = cert->get_subject(cert);
|
||||
identification_t *issuer = cert->get_issuer(cert);
|
||||
|
||||
DBG2(DBG_CFG, "subject: '%D'", subject);
|
||||
DBG2(DBG_CFG, "issuer: '%D'", issuer);
|
||||
DBG2(DBG_CFG, "subject: '%D'", cert->get_subject(cert));
|
||||
DBG2(DBG_CFG, "issuer: '%D'", cert->get_issuer(cert));
|
||||
|
||||
ugh = cert->is_valid(cert, &until);
|
||||
if (ugh != NULL)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
typedef struct local_credential_store_t local_credential_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <daemon.h>
|
||||
#include <config/credentials/credential_store.h>
|
||||
|
||||
|
||||
@@ -157,11 +157,9 @@ static policy_t *get_policy(private_local_policy_store_t *this,
|
||||
|
||||
if (found)
|
||||
{
|
||||
identification_t *found_my_id = found->get_my_id(found);
|
||||
identification_t *found_other_id = found->get_other_id(found);
|
||||
|
||||
DBG1(DBG_CFG, "found matching policy '%s': %D...%D (prio=%d)",
|
||||
found->get_name(found), found_my_id, found_other_id, best_prio);
|
||||
found->get_name(found), found->get_my_id(found),
|
||||
found->get_other_id(found), best_prio);
|
||||
/* give out a new reference to it */
|
||||
found->get_ref(found);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
typedef struct local_policy_store_t local_policy_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <config/policies/policy_store.h>
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
typedef enum dpd_action_t dpd_action_t;
|
||||
typedef struct policy_t policy_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <utils/identification.h>
|
||||
#include <config/traffic_selector.h>
|
||||
#include <config/proposal.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
typedef struct policy_store_t policy_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <config/policies/policy.h>
|
||||
#include <utils/linked_list.h>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef enum extended_sequence_numbers_t extended_sequence_numbers_t;
|
||||
typedef struct algorithm_t algorithm_t;
|
||||
typedef struct proposal_t proposal_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <utils/identification.h>
|
||||
#include <utils/linked_list.h>
|
||||
#include <utils/host.h>
|
||||
|
||||
@@ -237,24 +237,12 @@ static int print(FILE *stream, const struct printf_info *info,
|
||||
return written;
|
||||
}
|
||||
|
||||
/**
|
||||
* arginfo handler in printf()
|
||||
*/
|
||||
static int print_arginfo(const struct printf_info *info, size_t n, int *argtypes)
|
||||
{
|
||||
if (n > 0)
|
||||
{
|
||||
argtypes[0] = PA_POINTER;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* register printf() handlers
|
||||
*/
|
||||
static void __attribute__ ((constructor))print_register()
|
||||
{
|
||||
register_printf_function(TRAFFIC_SELECTOR_PRINTF_SPEC, print, print_arginfo);
|
||||
register_printf_function(PRINTF_TRAFFIC_SELECTOR, print, arginfo_ptr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -368,7 +356,7 @@ static bool equals(private_traffic_selector_t *this, private_traffic_selector_t
|
||||
*/
|
||||
static chunk_t get_from_address(private_traffic_selector_t *this)
|
||||
{
|
||||
chunk_t from = CHUNK_INITIALIZER;
|
||||
chunk_t from = chunk_empty;
|
||||
|
||||
switch (this->type)
|
||||
{
|
||||
@@ -395,7 +383,7 @@ static chunk_t get_from_address(private_traffic_selector_t *this)
|
||||
*/
|
||||
static chunk_t get_to_address(private_traffic_selector_t *this)
|
||||
{
|
||||
chunk_t to = CHUNK_INITIALIZER;
|
||||
chunk_t to = chunk_empty;
|
||||
|
||||
switch (this->type)
|
||||
{
|
||||
|
||||
@@ -27,14 +27,9 @@
|
||||
typedef enum ts_type_t ts_type_t;
|
||||
typedef struct traffic_selector_t traffic_selector_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <library.h>
|
||||
#include <utils/host.h>
|
||||
|
||||
/**
|
||||
* printf() specifier for tRaffic selectors
|
||||
*/
|
||||
#define TRAFFIC_SELECTOR_PRINTF_SPEC 'R'
|
||||
|
||||
/**
|
||||
* Traffic selector types.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user