aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/config')
-rw-r--r--src/libcharon/config/child_cfg.c26
-rw-r--r--src/libcharon/config/child_cfg.h14
-rw-r--r--src/libcharon/config/ike_cfg.c24
-rw-r--r--src/libcharon/config/ike_cfg.h12
-rw-r--r--src/libcharon/config/peer_cfg.c34
-rw-r--r--src/libcharon/config/peer_cfg.h20
-rw-r--r--src/libcharon/config/proposal.c28
-rw-r--r--src/libcharon/config/proposal.h10
8 files changed, 84 insertions, 84 deletions
diff --git a/src/libcharon/config/child_cfg.c b/src/libcharon/config/child_cfg.c
index 3d3c7419b..8e5c522d2 100644
--- a/src/libcharon/config/child_cfg.c
+++ b/src/libcharon/config/child_cfg.c
@@ -110,12 +110,12 @@ struct private_child_cfg_t {
/**
* Inactivity timeout
*/
- u_int32_t inactivity;
+ uint32_t inactivity;
/**
* Reqid to install CHILD_SA with
*/
- u_int32_t reqid;
+ uint32_t reqid;
/**
* Optional mark to install inbound CHILD_SA with
@@ -130,7 +130,7 @@ struct private_child_cfg_t {
/**
* Traffic Flow Confidentiality padding, if enabled
*/
- u_int32_t tfc;
+ uint32_t tfc;
/**
* set up IPsec transport SA in MIPv6 proxy mode
@@ -145,7 +145,7 @@ struct private_child_cfg_t {
/**
* anti-replay window size
*/
- u_int32_t replay_window;
+ uint32_t replay_window;
};
METHOD(child_cfg_t, get_name, char*,
@@ -405,7 +405,7 @@ METHOD(child_cfg_t, get_hostaccess, bool,
* Note: The distribution of random values is not perfect, but it
* should get the job done.
*/
-static u_int64_t apply_jitter(u_int64_t rekey, u_int64_t jitter)
+static uint64_t apply_jitter(uint64_t rekey, uint64_t jitter)
{
if (jitter == 0)
{
@@ -456,7 +456,7 @@ METHOD(child_cfg_t, get_dh_group, diffie_hellman_group_t,
{
enumerator_t *enumerator;
proposal_t *proposal;
- u_int16_t dh_group = MODP_NONE;
+ uint16_t dh_group = MODP_NONE;
enumerator = this->proposals->create_enumerator(this->proposals);
while (enumerator->enumerate(enumerator, &proposal))
@@ -476,13 +476,13 @@ METHOD(child_cfg_t, use_ipcomp, bool,
return this->use_ipcomp;
}
-METHOD(child_cfg_t, get_inactivity, u_int32_t,
+METHOD(child_cfg_t, get_inactivity, uint32_t,
private_child_cfg_t *this)
{
return this->inactivity;
}
-METHOD(child_cfg_t, get_reqid, u_int32_t,
+METHOD(child_cfg_t, get_reqid, uint32_t,
private_child_cfg_t *this)
{
return this->reqid;
@@ -494,20 +494,20 @@ METHOD(child_cfg_t, get_mark, mark_t,
return inbound ? this->mark_in : this->mark_out;
}
-METHOD(child_cfg_t, get_tfc, u_int32_t,
+METHOD(child_cfg_t, get_tfc, uint32_t,
private_child_cfg_t *this)
{
return this->tfc;
}
-METHOD(child_cfg_t, get_replay_window, u_int32_t,
+METHOD(child_cfg_t, get_replay_window, uint32_t,
private_child_cfg_t *this)
{
return this->replay_window;
}
METHOD(child_cfg_t, set_replay_window, void,
- private_child_cfg_t *this, u_int32_t replay_window)
+ private_child_cfg_t *this, uint32_t replay_window)
{
this->replay_window = replay_window;
}
@@ -613,8 +613,8 @@ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime,
char *updown, bool hostaccess,
ipsec_mode_t mode, action_t start_action,
action_t dpd_action, action_t close_action,
- bool ipcomp, u_int32_t inactivity, u_int32_t reqid,
- mark_t *mark_in, mark_t *mark_out, u_int32_t tfc)
+ bool ipcomp, uint32_t inactivity, uint32_t reqid,
+ mark_t *mark_in, mark_t *mark_out, uint32_t tfc)
{
private_child_cfg_t *this;
diff --git a/src/libcharon/config/child_cfg.h b/src/libcharon/config/child_cfg.h
index 22641f77e..0281f5a5c 100644
--- a/src/libcharon/config/child_cfg.h
+++ b/src/libcharon/config/child_cfg.h
@@ -210,14 +210,14 @@ struct child_cfg_t {
*
* @return inactivity timeout in s
*/
- u_int32_t (*get_inactivity)(child_cfg_t *this);
+ uint32_t (*get_inactivity)(child_cfg_t *this);
/**
* Specific reqid to use for CHILD_SA.
*
* @return reqid
*/
- u_int32_t (*get_reqid)(child_cfg_t *this);
+ uint32_t (*get_reqid)(child_cfg_t *this);
/**
* Optional mark for CHILD_SA.
@@ -232,21 +232,21 @@ struct child_cfg_t {
*
* @return TFC padding, 0 to disable, -1 for MTU
*/
- u_int32_t (*get_tfc)(child_cfg_t *this);
+ uint32_t (*get_tfc)(child_cfg_t *this);
/**
* Get anti-replay window size
*
* @return anti-replay window size
*/
- u_int32_t (*get_replay_window)(child_cfg_t *this);
+ uint32_t (*get_replay_window)(child_cfg_t *this);
/**
* Set anti-replay window size
*
* @param window anti-replay window size
*/
- void (*set_replay_window)(child_cfg_t *this, u_int32_t window);
+ void (*set_replay_window)(child_cfg_t *this, uint32_t window);
/**
* Sets two options needed for Mobile IPv6 interoperability.
@@ -328,7 +328,7 @@ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime,
char *updown, bool hostaccess,
ipsec_mode_t mode, action_t start_action,
action_t dpd_action, action_t close_action,
- bool ipcomp, u_int32_t inactivity, u_int32_t reqid,
- mark_t *mark_in, mark_t *mark_out, u_int32_t tfc);
+ bool ipcomp, uint32_t inactivity, uint32_t reqid,
+ mark_t *mark_in, mark_t *mark_out, uint32_t tfc);
#endif /** CHILD_CFG_H_ @}*/
diff --git a/src/libcharon/config/ike_cfg.c b/src/libcharon/config/ike_cfg.c
index a720e1493..a92622c1e 100644
--- a/src/libcharon/config/ike_cfg.c
+++ b/src/libcharon/config/ike_cfg.c
@@ -83,12 +83,12 @@ struct private_ike_cfg_t {
/**
* our source port
*/
- u_int16_t my_port;
+ uint16_t my_port;
/**
* destination port
*/
- u_int16_t other_port;
+ uint16_t other_port;
/**
* should we send a certificate request?
@@ -108,7 +108,7 @@ struct private_ike_cfg_t {
/**
* DSCP value to use on sent IKE packets
*/
- u_int8_t dscp;
+ uint8_t dscp;
/**
* List of proposals to use
@@ -143,7 +143,7 @@ METHOD(ike_cfg_t, fragmentation, fragmentation_t,
/**
* Common function for resolve_me/other
*/
-static host_t* resolve(linked_list_t *hosts, int family, u_int16_t port)
+static host_t* resolve(linked_list_t *hosts, int family, uint16_t port)
{
enumerator_t *enumerator;
host_t *host = NULL;
@@ -192,7 +192,7 @@ static u_int match(linked_list_t *hosts, linked_list_t *ranges, host_t *cand)
traffic_selector_t *ts;
char *str;
host_t *host;
- u_int8_t mask;
+ uint8_t mask;
u_int quality = 0;
/* try single hosts first */
@@ -261,19 +261,19 @@ METHOD(ike_cfg_t, get_other_addr, char*,
return this->other;
}
-METHOD(ike_cfg_t, get_my_port, u_int16_t,
+METHOD(ike_cfg_t, get_my_port, uint16_t,
private_ike_cfg_t *this)
{
return this->my_port;
}
-METHOD(ike_cfg_t, get_other_port, u_int16_t,
+METHOD(ike_cfg_t, get_other_port, uint16_t,
private_ike_cfg_t *this)
{
return this->other_port;
}
-METHOD(ike_cfg_t, get_dscp, u_int8_t,
+METHOD(ike_cfg_t, get_dscp, uint8_t,
private_ike_cfg_t *this)
{
return this->dscp;
@@ -353,7 +353,7 @@ METHOD(ike_cfg_t, get_dh_group, diffie_hellman_group_t,
{
enumerator_t *enumerator;
proposal_t *proposal;
- u_int16_t dh_group = MODP_NONE;
+ uint16_t dh_group = MODP_NONE;
enumerator = this->proposals->create_enumerator(this->proposals);
while (enumerator->enumerate(enumerator, &proposal))
@@ -545,9 +545,9 @@ int ike_cfg_get_family(ike_cfg_t *cfg, bool local)
* Described in header.
*/
ike_cfg_t *ike_cfg_create(ike_version_t version, bool certreq, bool force_encap,
- char *me, u_int16_t my_port,
- char *other, u_int16_t other_port,
- fragmentation_t fragmentation, u_int8_t dscp)
+ char *me, uint16_t my_port,
+ char *other, uint16_t other_port,
+ fragmentation_t fragmentation, uint8_t dscp)
{
private_ike_cfg_t *this;
diff --git a/src/libcharon/config/ike_cfg.h b/src/libcharon/config/ike_cfg.h
index a72960f4f..c6d9554ce 100644
--- a/src/libcharon/config/ike_cfg.h
+++ b/src/libcharon/config/ike_cfg.h
@@ -128,21 +128,21 @@ struct ike_cfg_t {
*
* @return source address port, host order
*/
- u_int16_t (*get_my_port)(ike_cfg_t *this);
+ uint16_t (*get_my_port)(ike_cfg_t *this);
/**
* Get the port to use as destination port.
*
* @return destination address, host order
*/
- u_int16_t (*get_other_port)(ike_cfg_t *this);
+ uint16_t (*get_other_port)(ike_cfg_t *this);
/**
* Get the DSCP value to use for IKE packets send from connections.
*
* @return DSCP value
*/
- u_int8_t (*get_dscp)(ike_cfg_t *this);
+ uint8_t (*get_dscp)(ike_cfg_t *this);
/**
* Adds a proposal to the list.
@@ -250,9 +250,9 @@ struct ike_cfg_t {
* @return ike_cfg_t object.
*/
ike_cfg_t *ike_cfg_create(ike_version_t version, bool certreq, bool force_encap,
- char *me, u_int16_t my_port,
- char *other, u_int16_t other_port,
- fragmentation_t fragmentation, u_int8_t dscp);
+ char *me, uint16_t my_port,
+ char *other, uint16_t other_port,
+ fragmentation_t fragmentation, uint8_t dscp);
/**
* Determine the address family of the local or remtoe address(es). If multiple
diff --git a/src/libcharon/config/peer_cfg.c b/src/libcharon/config/peer_cfg.c
index d28a79507..4eebfb09d 100644
--- a/src/libcharon/config/peer_cfg.c
+++ b/src/libcharon/config/peer_cfg.c
@@ -88,7 +88,7 @@ struct private_peer_cfg_t {
/**
* number of tries after giving up if peer does not respond
*/
- u_int32_t keyingtries;
+ uint32_t keyingtries;
/**
* enable support for MOBIKE
@@ -108,32 +108,32 @@ struct private_peer_cfg_t {
/**
* Time before starting rekeying
*/
- u_int32_t rekey_time;
+ uint32_t rekey_time;
/**
* Time before starting reauthentication
*/
- u_int32_t reauth_time;
+ uint32_t reauth_time;
/**
* Time, which specifies the range of a random value subtracted from above.
*/
- u_int32_t jitter_time;
+ uint32_t jitter_time;
/**
* Delay before deleting a rekeying/reauthenticating SA
*/
- u_int32_t over_time;
+ uint32_t over_time;
/**
* DPD check intervall
*/
- u_int32_t dpd;
+ uint32_t dpd;
/**
* DPD timeout intervall (used for IKEv1 only)
*/
- u_int32_t dpd_timeout;
+ uint32_t dpd_timeout;
/**
* List of virtual IPs (host_t*) to request
@@ -455,13 +455,13 @@ METHOD(peer_cfg_t, get_unique_policy, unique_policy_t,
return this->unique;
}
-METHOD(peer_cfg_t, get_keyingtries, u_int32_t,
+METHOD(peer_cfg_t, get_keyingtries, uint32_t,
private_peer_cfg_t *this)
{
return this->keyingtries;
}
-METHOD(peer_cfg_t, get_rekey_time, u_int32_t,
+METHOD(peer_cfg_t, get_rekey_time, uint32_t,
private_peer_cfg_t *this, bool jitter)
{
if (this->rekey_time == 0)
@@ -475,7 +475,7 @@ METHOD(peer_cfg_t, get_rekey_time, u_int32_t,
return this->rekey_time - (random() % this->jitter_time);
}
-METHOD(peer_cfg_t, get_reauth_time, u_int32_t,
+METHOD(peer_cfg_t, get_reauth_time, uint32_t,
private_peer_cfg_t *this, bool jitter)
{
if (this->reauth_time == 0)
@@ -489,7 +489,7 @@ METHOD(peer_cfg_t, get_reauth_time, u_int32_t,
return this->reauth_time - (random() % this->jitter_time);
}
-METHOD(peer_cfg_t, get_over_time, u_int32_t,
+METHOD(peer_cfg_t, get_over_time, uint32_t,
private_peer_cfg_t *this)
{
return this->over_time;
@@ -513,13 +513,13 @@ METHOD(peer_cfg_t, use_pull_mode, bool,
return this->pull_mode;
}
-METHOD(peer_cfg_t, get_dpd, u_int32_t,
+METHOD(peer_cfg_t, get_dpd, uint32_t,
private_peer_cfg_t *this)
{
return this->dpd;
}
-METHOD(peer_cfg_t, get_dpd_timeout, u_int32_t,
+METHOD(peer_cfg_t, get_dpd_timeout, uint32_t,
private_peer_cfg_t *this)
{
return this->dpd_timeout;
@@ -726,11 +726,11 @@ METHOD(peer_cfg_t, destroy, void,
*/
peer_cfg_t *peer_cfg_create(char *name,
ike_cfg_t *ike_cfg, cert_policy_t cert_policy,
- unique_policy_t unique, u_int32_t keyingtries,
- u_int32_t rekey_time, u_int32_t reauth_time,
- u_int32_t jitter_time, u_int32_t over_time,
+ unique_policy_t unique, uint32_t keyingtries,
+ uint32_t rekey_time, uint32_t reauth_time,
+ uint32_t jitter_time, uint32_t over_time,
bool mobike, bool aggressive, bool pull_mode,
- u_int32_t dpd, u_int32_t dpd_timeout,
+ uint32_t dpd, uint32_t dpd_timeout,
bool mediation, peer_cfg_t *mediated_by,
identification_t *peer_id)
{
diff --git a/src/libcharon/config/peer_cfg.h b/src/libcharon/config/peer_cfg.h
index b612a2ef1..a4646af87 100644
--- a/src/libcharon/config/peer_cfg.h
+++ b/src/libcharon/config/peer_cfg.h
@@ -222,7 +222,7 @@ struct peer_cfg_t {
*
* @return max number retries
*/
- u_int32_t (*get_keyingtries) (peer_cfg_t *this);
+ uint32_t (*get_keyingtries) (peer_cfg_t *this);
/**
* Get a time to start rekeying.
@@ -230,7 +230,7 @@ struct peer_cfg_t {
* @param jitter remove a jitter value to randomize time
* @return time in s when to start rekeying, 0 disables rekeying
*/
- u_int32_t (*get_rekey_time)(peer_cfg_t *this, bool jitter);
+ uint32_t (*get_rekey_time)(peer_cfg_t *this, bool jitter);
/**
* Get a time to start reauthentication.
@@ -238,14 +238,14 @@ struct peer_cfg_t {
* @param jitter remove a jitter value to randomize time
* @return time in s when to start reauthentication, 0 disables it
*/
- u_int32_t (*get_reauth_time)(peer_cfg_t *this, bool jitter);
+ uint32_t (*get_reauth_time)(peer_cfg_t *this, bool jitter);
/**
* Get the timeout of a rekeying/reauthenticating SA.
*
* @return timeout in s
*/
- u_int32_t (*get_over_time)(peer_cfg_t *this);
+ uint32_t (*get_over_time)(peer_cfg_t *this);
/**
* Use MOBIKE (RFC4555) if peer supports it?
@@ -273,14 +273,14 @@ struct peer_cfg_t {
*
* @return dpd_delay in seconds
*/
- u_int32_t (*get_dpd) (peer_cfg_t *this);
+ uint32_t (*get_dpd) (peer_cfg_t *this);
/**
* Get the DPD timeout interval (IKEv1 only)
*
* @return dpd_timeout in seconds
*/
- u_int32_t (*get_dpd_timeout) (peer_cfg_t *this);
+ uint32_t (*get_dpd_timeout) (peer_cfg_t *this);
/**
* Add a virtual IP to request as initiator.
@@ -397,11 +397,11 @@ struct peer_cfg_t {
*/
peer_cfg_t *peer_cfg_create(char *name,
ike_cfg_t *ike_cfg, cert_policy_t cert_policy,
- unique_policy_t unique, u_int32_t keyingtries,
- u_int32_t rekey_time, u_int32_t reauth_time,
- u_int32_t jitter_time, u_int32_t over_time,
+ unique_policy_t unique, uint32_t keyingtries,
+ uint32_t rekey_time, uint32_t reauth_time,
+ uint32_t jitter_time, uint32_t over_time,
bool mobike, bool aggressive, bool pull_mode,
- u_int32_t dpd, u_int32_t dpd_timeout,
+ uint32_t dpd, uint32_t dpd_timeout,
bool mediation, peer_cfg_t *mediated_by,
identification_t *peer_id);
diff --git a/src/libcharon/config/proposal.c b/src/libcharon/config/proposal.c
index 95b6a00ea..0315e4ebc 100644
--- a/src/libcharon/config/proposal.c
+++ b/src/libcharon/config/proposal.c
@@ -61,7 +61,7 @@ struct private_proposal_t {
/**
* senders SPI
*/
- u_int64_t spi;
+ uint64_t spi;
/**
* Proposal number
@@ -76,14 +76,14 @@ typedef struct {
/** Type of the transform */
transform_type_t type;
/** algorithm identifier */
- u_int16_t alg;
+ uint16_t alg;
/** key size in bits, or zero if not needed */
- u_int16_t key_size;
+ uint16_t key_size;
} entry_t;
METHOD(proposal_t, add_algorithm, void,
private_proposal_t *this, transform_type_t type,
- u_int16_t alg, u_int16_t key_size)
+ uint16_t alg, uint16_t key_size)
{
entry_t entry = {
.type = type,
@@ -97,8 +97,8 @@ METHOD(proposal_t, add_algorithm, void,
/**
* filter function for peer configs
*/
-static bool alg_filter(uintptr_t type, entry_t **in, u_int16_t *alg,
- void **unused, u_int16_t *key_size)
+static bool alg_filter(uintptr_t type, entry_t **in, uint16_t *alg,
+ void **unused, uint16_t *key_size)
{
entry_t *entry = *in;
@@ -127,7 +127,7 @@ METHOD(proposal_t, create_enumerator, enumerator_t*,
METHOD(proposal_t, get_algorithm, bool,
private_proposal_t *this, transform_type_t type,
- u_int16_t *alg, u_int16_t *key_size)
+ uint16_t *alg, uint16_t *key_size)
{
enumerator_t *enumerator;
bool found = FALSE;
@@ -147,7 +147,7 @@ METHOD(proposal_t, has_dh_group, bool,
{
bool found = FALSE, any = FALSE;
enumerator_t *enumerator;
- u_int16_t current;
+ uint16_t current;
enumerator = create_enumerator(this, DIFFIE_HELLMAN_GROUP);
while (enumerator->enumerate(enumerator, &current, NULL))
@@ -193,7 +193,7 @@ static bool select_algo(private_proposal_t *this, proposal_t *other,
proposal_t *selected, transform_type_t type, bool priv)
{
enumerator_t *e1, *e2;
- u_int16_t alg1, alg2, ks1, ks2;
+ uint16_t alg1, alg2, ks1, ks2;
bool found = FALSE, optional = FALSE;
if (type == INTEGRITY_ALGORITHM &&
@@ -301,12 +301,12 @@ METHOD(proposal_t, get_protocol, protocol_id_t,
}
METHOD(proposal_t, set_spi, void,
- private_proposal_t *this, u_int64_t spi)
+ private_proposal_t *this, uint64_t spi)
{
this->spi = spi;
}
-METHOD(proposal_t, get_spi, u_int64_t,
+METHOD(proposal_t, get_spi, uint64_t,
private_proposal_t *this)
{
return this->spi;
@@ -319,7 +319,7 @@ static bool algo_list_equals(private_proposal_t *this, proposal_t *other,
transform_type_t type)
{
enumerator_t *e1, *e2;
- u_int16_t alg1, alg2, ks1, ks2;
+ uint16_t alg1, alg2, ks1, ks2;
bool equals = TRUE;
e1 = create_enumerator(this, type);
@@ -418,7 +418,7 @@ static void check_proposal(private_proposal_t *this)
{
enumerator_t *e;
entry_t *entry;
- u_int16_t alg, ks;
+ uint16_t alg, ks;
bool all_aead = TRUE;
int i;
@@ -516,7 +516,7 @@ static int print_alg(private_proposal_t *this, printf_hook_data_t *data,
{
enumerator_t *enumerator;
size_t written = 0;
- u_int16_t alg, size;
+ uint16_t alg, size;
enumerator = create_enumerator(this, kind);
while (enumerator->enumerate(enumerator, &alg, &size))
diff --git a/src/libcharon/config/proposal.h b/src/libcharon/config/proposal.h
index 78b868868..f9f277820 100644
--- a/src/libcharon/config/proposal.h
+++ b/src/libcharon/config/proposal.h
@@ -78,13 +78,13 @@ struct proposal_t {
* @param key_size key size to use
*/
void (*add_algorithm) (proposal_t *this, transform_type_t type,
- u_int16_t alg, u_int16_t key_size);
+ uint16_t alg, uint16_t key_size);
/**
* Get an enumerator over algorithms for a specifc algo type.
*
* @param type kind of algorithm
- * @return enumerator over u_int16_t alg, u_int16_t key_size
+ * @return enumerator over uint16_t alg, uint16_t key_size
*/
enumerator_t *(*create_enumerator) (proposal_t *this, transform_type_t type);
@@ -99,7 +99,7 @@ struct proposal_t {
* @return TRUE if algorithm of this kind available
*/
bool (*get_algorithm) (proposal_t *this, transform_type_t type,
- u_int16_t *alg, u_int16_t *key_size);
+ uint16_t *alg, uint16_t *key_size);
/**
* Check if the proposal has a specific DH group.
@@ -141,14 +141,14 @@ struct proposal_t {
*
* @return spi for proto
*/
- u_int64_t (*get_spi) (proposal_t *this);
+ uint64_t (*get_spi) (proposal_t *this);
/**
* Set the SPI of the proposal.
*
* @param spi spi to set for proto
*/
- void (*set_spi) (proposal_t *this, u_int64_t spi);
+ void (*set_spi) (proposal_t *this, uint64_t spi);
/**
* Get the proposal number, as encoded in SA payload