Use standard unsigned integer types
This commit is contained in:
@@ -142,7 +142,7 @@ static host_t* offset2host(private_mem_pool_t *pool, int offset)
|
||||
{
|
||||
chunk_t addr;
|
||||
host_t *host;
|
||||
u_int32_t *pos;
|
||||
uint32_t *pos;
|
||||
|
||||
offset--;
|
||||
if (offset > pool->size)
|
||||
@@ -153,11 +153,11 @@ static host_t* offset2host(private_mem_pool_t *pool, int offset)
|
||||
addr = chunk_clone(pool->base->get_address(pool->base));
|
||||
if (pool->base->get_family(pool->base) == AF_INET6)
|
||||
{
|
||||
pos = (u_int32_t*)(addr.ptr + 12);
|
||||
pos = (uint32_t*)(addr.ptr + 12);
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = (u_int32_t*)addr.ptr;
|
||||
pos = (uint32_t*)addr.ptr;
|
||||
}
|
||||
*pos = htonl(offset + ntohl(*pos));
|
||||
host = host_create_from_chunk(pool->base->get_family(pool->base), addr, 0);
|
||||
@@ -171,7 +171,7 @@ static host_t* offset2host(private_mem_pool_t *pool, int offset)
|
||||
static int host2offset(private_mem_pool_t *pool, host_t *addr)
|
||||
{
|
||||
chunk_t host, base;
|
||||
u_int32_t hosti, basei;
|
||||
uint32_t hosti, basei;
|
||||
|
||||
if (addr->get_family(addr) != pool->base->get_family(pool->base))
|
||||
{
|
||||
@@ -189,8 +189,8 @@ static int host2offset(private_mem_pool_t *pool, host_t *addr)
|
||||
host = chunk_skip(host, 12);
|
||||
base = chunk_skip(base, 12);
|
||||
}
|
||||
hosti = ntohl(*(u_int32_t*)(host.ptr));
|
||||
basei = ntohl(*(u_int32_t*)(base.ptr));
|
||||
hosti = ntohl(*(uint32_t*)(host.ptr));
|
||||
basei = ntohl(*(uint32_t*)(base.ptr));
|
||||
if (hosti > basei + pool->size)
|
||||
{
|
||||
return -1;
|
||||
@@ -634,7 +634,7 @@ static private_mem_pool_t *create_generic(char *name)
|
||||
*/
|
||||
static u_int network_id_diff(host_t *host, int hostbits)
|
||||
{
|
||||
u_int32_t last;
|
||||
uint32_t last;
|
||||
chunk_t addr;
|
||||
|
||||
if (!hostbits)
|
||||
@@ -705,7 +705,7 @@ mem_pool_t *mem_pool_create_range(char *name, host_t *from, host_t *to)
|
||||
{
|
||||
private_mem_pool_t *this;
|
||||
chunk_t fromaddr, toaddr;
|
||||
u_int32_t diff;
|
||||
uint32_t diff;
|
||||
|
||||
fromaddr = from->get_address(from);
|
||||
toaddr = to->get_address(to);
|
||||
|
||||
@@ -688,7 +688,7 @@ METHOD(bus_t, child_rekey, void,
|
||||
}
|
||||
|
||||
METHOD(bus_t, children_migrate, void,
|
||||
private_bus_t *this, ike_sa_id_t *new, u_int32_t unique)
|
||||
private_bus_t *this, ike_sa_id_t *new, uint32_t unique)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
ike_sa_t *ike_sa;
|
||||
|
||||
@@ -432,7 +432,7 @@ struct bus_t {
|
||||
* @param new ID of new SA when called for the old, NULL otherwise
|
||||
* @param uniue unique ID of new SA when called for the old, 0 otherwise
|
||||
*/
|
||||
void (*children_migrate)(bus_t *this, ike_sa_id_t *new, u_int32_t unique);
|
||||
void (*children_migrate)(bus_t *this, ike_sa_id_t *new, uint32_t unique);
|
||||
|
||||
/**
|
||||
* Virtual IP assignment hook.
|
||||
|
||||
@@ -200,7 +200,7 @@ struct listener_t {
|
||||
* @return TRUE to stay registered, FALSE to unregister
|
||||
*/
|
||||
bool (*children_migrate)(listener_t *this, ike_sa_t *ike_sa,
|
||||
ike_sa_id_t *new, u_int32_t unique);
|
||||
ike_sa_id_t *new, uint32_t unique);
|
||||
|
||||
/**
|
||||
* Hook called to invoke additional authorization rules.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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_ @}*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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, ¤t, 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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -105,7 +105,7 @@ struct interface_listener_t {
|
||||
/**
|
||||
* unique ID, used for various methods
|
||||
*/
|
||||
u_int32_t id;
|
||||
uint32_t id;
|
||||
|
||||
/**
|
||||
* semaphore to implement wait_for_listener()
|
||||
@@ -493,7 +493,7 @@ METHOD(job_t, terminate_ike_execute, job_requeue_t,
|
||||
interface_job_t *job)
|
||||
{
|
||||
interface_listener_t *listener = &job->listener;
|
||||
u_int32_t unique_id = listener->id;
|
||||
uint32_t unique_id = listener->id;
|
||||
ike_sa_t *ike_sa;
|
||||
|
||||
ike_sa = charon->ike_sa_manager->checkout_by_id(charon->ike_sa_manager,
|
||||
@@ -528,7 +528,7 @@ METHOD(job_t, terminate_ike_execute, job_requeue_t,
|
||||
}
|
||||
|
||||
METHOD(controller_t, terminate_ike, status_t,
|
||||
controller_t *this, u_int32_t unique_id,
|
||||
controller_t *this, uint32_t unique_id,
|
||||
controller_cb_t callback, void *param, u_int timeout)
|
||||
{
|
||||
interface_job_t *job;
|
||||
@@ -582,7 +582,7 @@ METHOD(job_t, terminate_child_execute, job_requeue_t,
|
||||
interface_job_t *job)
|
||||
{
|
||||
interface_listener_t *listener = &job->listener;
|
||||
u_int32_t id = listener->id;
|
||||
uint32_t id = listener->id;
|
||||
child_sa_t *child_sa;
|
||||
ike_sa_t *ike_sa;
|
||||
|
||||
@@ -630,7 +630,7 @@ METHOD(job_t, terminate_child_execute, job_requeue_t,
|
||||
}
|
||||
|
||||
METHOD(controller_t, terminate_child, status_t,
|
||||
controller_t *this, u_int32_t unique_id,
|
||||
controller_t *this, uint32_t unique_id,
|
||||
controller_cb_t callback, void *param, u_int timeout)
|
||||
{
|
||||
interface_job_t *job;
|
||||
|
||||
@@ -111,7 +111,7 @@ struct controller_t {
|
||||
* - NEED_MORE, if callback returned FALSE
|
||||
* - OUT_OF_RES if timed out
|
||||
*/
|
||||
status_t (*terminate_ike)(controller_t *this, u_int32_t unique_id,
|
||||
status_t (*terminate_ike)(controller_t *this, uint32_t unique_id,
|
||||
controller_cb_t callback, void *param,
|
||||
u_int timeout);
|
||||
|
||||
@@ -131,7 +131,7 @@ struct controller_t {
|
||||
* - NEED_MORE, if callback returned FALSE
|
||||
* - OUT_OF_RES if timed out
|
||||
*/
|
||||
status_t (*terminate_child)(controller_t *this, u_int32_t unique_id,
|
||||
status_t (*terminate_child)(controller_t *this, uint32_t unique_id,
|
||||
controller_cb_t callback, void *param,
|
||||
u_int timeout);
|
||||
|
||||
|
||||
@@ -68,22 +68,22 @@ struct private_generator_t {
|
||||
/**
|
||||
* Buffer used to generate the data into.
|
||||
*/
|
||||
u_int8_t *buffer;
|
||||
uint8_t *buffer;
|
||||
|
||||
/**
|
||||
* Current write position in buffer (one byte aligned).
|
||||
*/
|
||||
u_int8_t *out_position;
|
||||
uint8_t *out_position;
|
||||
|
||||
/**
|
||||
* Position of last byte in buffer.
|
||||
*/
|
||||
u_int8_t *roof_position;
|
||||
uint8_t *roof_position;
|
||||
|
||||
/**
|
||||
* Current bit writing to in current byte (between 0 and 7).
|
||||
*/
|
||||
u_int8_t current_bit;
|
||||
uint8_t current_bit;
|
||||
|
||||
/**
|
||||
* Associated data struct to read informations from.
|
||||
@@ -93,7 +93,7 @@ struct private_generator_t {
|
||||
/**
|
||||
* Offset of the header length field in the buffer.
|
||||
*/
|
||||
u_int32_t header_length_offset;
|
||||
uint32_t header_length_offset;
|
||||
|
||||
/**
|
||||
* Attribute format of the last generated transform attribute.
|
||||
@@ -107,7 +107,7 @@ struct private_generator_t {
|
||||
* Depending on the value of attribute_format this field is used
|
||||
* to hold the length of the transform attribute in bytes.
|
||||
*/
|
||||
u_int16_t attribute_length;
|
||||
uint16_t attribute_length;
|
||||
|
||||
/**
|
||||
* TRUE, if debug messages should be logged during generation.
|
||||
@@ -142,7 +142,7 @@ static int get_length(private_generator_t *this)
|
||||
/**
|
||||
* Get current offset in buffer (in bytes).
|
||||
*/
|
||||
static u_int32_t get_offset(private_generator_t *this)
|
||||
static uint32_t get_offset(private_generator_t *this)
|
||||
{
|
||||
return this->out_position - this->buffer;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ static void write_bytes_to_buffer(private_generator_t *this, void *bytes,
|
||||
int number_of_bytes)
|
||||
{
|
||||
int i;
|
||||
u_int8_t *read_position = (u_int8_t *)bytes;
|
||||
uint8_t *read_position = (uint8_t *)bytes;
|
||||
|
||||
make_space_available(this, number_of_bytes * 8);
|
||||
|
||||
@@ -195,7 +195,7 @@ static void write_bytes_to_buffer(private_generator_t *this, void *bytes,
|
||||
* Generates a U_INT-Field type and writes it to buffer.
|
||||
*/
|
||||
static void generate_u_int_type(private_generator_t *this,
|
||||
encoding_type_t int_type,u_int32_t offset)
|
||||
encoding_type_t int_type,uint32_t offset)
|
||||
{
|
||||
int number_of_bits = 0;
|
||||
|
||||
@@ -242,12 +242,12 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
{
|
||||
case U_INT_4:
|
||||
{
|
||||
u_int8_t high, low;
|
||||
uint8_t high, low;
|
||||
|
||||
if (this->current_bit == 0)
|
||||
{
|
||||
/* high of current byte in buffer has to be set to the new value*/
|
||||
high = *((u_int8_t *)(this->data_struct + offset)) << 4;
|
||||
high = *((uint8_t *)(this->data_struct + offset)) << 4;
|
||||
/* low in buffer is not changed */
|
||||
low = *(this->out_position) & 0x0F;
|
||||
/* high is set, low_val is not changed */
|
||||
@@ -264,7 +264,7 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
/* high in buffer is not changed */
|
||||
high = *(this->out_position) & 0xF0;
|
||||
/* low of current byte in buffer has to be set to the new value*/
|
||||
low = *((u_int8_t *)(this->data_struct + offset)) & 0x0F;
|
||||
low = *((uint8_t *)(this->data_struct + offset)) & 0x0F;
|
||||
*(this->out_position) = high | low;
|
||||
if (this->debug)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
case U_INT_8:
|
||||
{
|
||||
/* 8 bit values are written as they are */
|
||||
*this->out_position = *((u_int8_t *)(this->data_struct + offset));
|
||||
*this->out_position = *((uint8_t *)(this->data_struct + offset));
|
||||
if (this->debug)
|
||||
{
|
||||
DBG3(DBG_ENC, " => %d", *(this->out_position));
|
||||
@@ -297,8 +297,8 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
}
|
||||
case ATTRIBUTE_TYPE:
|
||||
{
|
||||
u_int8_t attribute_format_flag;
|
||||
u_int16_t val;
|
||||
uint8_t attribute_format_flag;
|
||||
uint16_t val;
|
||||
|
||||
/* attribute type must not change first bit of current byte */
|
||||
if (this->current_bit != 1)
|
||||
@@ -308,7 +308,7 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
}
|
||||
attribute_format_flag = *(this->out_position) & 0x80;
|
||||
/* get attribute type value as 16 bit integer*/
|
||||
val = *((u_int16_t*)(this->data_struct + offset));
|
||||
val = *((uint16_t*)(this->data_struct + offset));
|
||||
/* unset most significant bit */
|
||||
val &= 0x7FFF;
|
||||
if (attribute_format_flag)
|
||||
@@ -321,7 +321,7 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
DBG3(DBG_ENC, " => %d", val);
|
||||
}
|
||||
/* write bytes to buffer (set bit is overwritten) */
|
||||
write_bytes_to_buffer(this, &val, sizeof(u_int16_t));
|
||||
write_bytes_to_buffer(this, &val, sizeof(uint16_t));
|
||||
this->current_bit = 0;
|
||||
break;
|
||||
|
||||
@@ -330,33 +330,33 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
case PAYLOAD_LENGTH:
|
||||
case ATTRIBUTE_LENGTH:
|
||||
{
|
||||
u_int16_t val = htons(*((u_int16_t*)(this->data_struct + offset)));
|
||||
uint16_t val = htons(*((uint16_t*)(this->data_struct + offset)));
|
||||
if (this->debug)
|
||||
{
|
||||
DBG3(DBG_ENC, " %b", &val, sizeof(u_int16_t));
|
||||
DBG3(DBG_ENC, " %b", &val, sizeof(uint16_t));
|
||||
}
|
||||
write_bytes_to_buffer(this, &val, sizeof(u_int16_t));
|
||||
write_bytes_to_buffer(this, &val, sizeof(uint16_t));
|
||||
break;
|
||||
}
|
||||
case U_INT_32:
|
||||
{
|
||||
u_int32_t val = htonl(*((u_int32_t*)(this->data_struct + offset)));
|
||||
uint32_t val = htonl(*((uint32_t*)(this->data_struct + offset)));
|
||||
if (this->debug)
|
||||
{
|
||||
DBG3(DBG_ENC, " %b", &val, sizeof(u_int32_t));
|
||||
DBG3(DBG_ENC, " %b", &val, sizeof(uint32_t));
|
||||
}
|
||||
write_bytes_to_buffer(this, &val, sizeof(u_int32_t));
|
||||
write_bytes_to_buffer(this, &val, sizeof(uint32_t));
|
||||
break;
|
||||
}
|
||||
case IKE_SPI:
|
||||
{
|
||||
/* 64 bit are written as-is, no host order conversion */
|
||||
write_bytes_to_buffer(this, this->data_struct + offset,
|
||||
sizeof(u_int64_t));
|
||||
sizeof(uint64_t));
|
||||
if (this->debug)
|
||||
{
|
||||
DBG3(DBG_ENC, " %b", this->data_struct + offset,
|
||||
sizeof(u_int64_t));
|
||||
sizeof(uint64_t));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -372,10 +372,10 @@ static void generate_u_int_type(private_generator_t *this,
|
||||
/**
|
||||
* Generate a FLAG filed
|
||||
*/
|
||||
static void generate_flag(private_generator_t *this, u_int32_t offset)
|
||||
static void generate_flag(private_generator_t *this, uint32_t offset)
|
||||
{
|
||||
u_int8_t flag_value;
|
||||
u_int8_t flag;
|
||||
uint8_t flag_value;
|
||||
uint8_t flag;
|
||||
|
||||
flag_value = (*((bool *) (this->data_struct + offset))) ? 1 : 0;
|
||||
/* get flag position */
|
||||
@@ -406,7 +406,7 @@ static void generate_flag(private_generator_t *this, u_int32_t offset)
|
||||
/**
|
||||
* Generates a bytestream from a chunk_t.
|
||||
*/
|
||||
static void generate_from_chunk(private_generator_t *this, u_int32_t offset)
|
||||
static void generate_from_chunk(private_generator_t *this, uint32_t offset)
|
||||
{
|
||||
chunk_t *value;
|
||||
|
||||
@@ -427,11 +427,11 @@ static void generate_from_chunk(private_generator_t *this, u_int32_t offset)
|
||||
}
|
||||
|
||||
METHOD(generator_t, get_chunk, chunk_t,
|
||||
private_generator_t *this, u_int32_t **lenpos)
|
||||
private_generator_t *this, uint32_t **lenpos)
|
||||
{
|
||||
chunk_t data;
|
||||
|
||||
*lenpos = (u_int32_t*)(this->buffer + this->header_length_offset);
|
||||
*lenpos = (uint32_t*)(this->buffer + this->header_length_offset);
|
||||
data = chunk_create(this->buffer, get_length(this));
|
||||
if (this->debug)
|
||||
{
|
||||
@@ -537,7 +537,7 @@ METHOD(generator_t, generate_payload, void,
|
||||
generate_u_int_type(this, U_INT_16, rules[i].offset);
|
||||
/* this field hold the length of the attribute */
|
||||
this->attribute_length =
|
||||
*((u_int16_t *)(this->data_struct + rules[i].offset));
|
||||
*((uint16_t *)(this->data_struct + rules[i].offset));
|
||||
}
|
||||
break;
|
||||
case ATTRIBUTE_VALUE:
|
||||
|
||||
@@ -57,7 +57,7 @@ struct generator_t {
|
||||
* @param lenpos receives a pointer to fill in length value
|
||||
* @param return chunk to internal buffer.
|
||||
*/
|
||||
chunk_t (*get_chunk) (generator_t *this, u_int32_t **lenpos);
|
||||
chunk_t (*get_chunk) (generator_t *this, uint32_t **lenpos);
|
||||
|
||||
/**
|
||||
* Destroys a generator_t object.
|
||||
|
||||
@@ -829,7 +829,7 @@ typedef struct {
|
||||
* fragments we expect.
|
||||
* For IKEv2 we store the total number of fragment we received last.
|
||||
*/
|
||||
u_int16_t last;
|
||||
uint16_t last;
|
||||
|
||||
/**
|
||||
* Length of all currently received fragments.
|
||||
@@ -858,12 +858,12 @@ struct private_message_t {
|
||||
/**
|
||||
* Minor version of message.
|
||||
*/
|
||||
u_int8_t major_version;
|
||||
uint8_t major_version;
|
||||
|
||||
/**
|
||||
* Major version of message.
|
||||
*/
|
||||
u_int8_t minor_version;
|
||||
uint8_t minor_version;
|
||||
|
||||
/**
|
||||
* First Payload in message.
|
||||
@@ -903,7 +903,7 @@ struct private_message_t {
|
||||
/**
|
||||
* Message ID of this message.
|
||||
*/
|
||||
u_int32_t message_id;
|
||||
uint32_t message_id;
|
||||
|
||||
/**
|
||||
* ID of assigned IKE_SA.
|
||||
@@ -953,7 +953,7 @@ struct private_message_t {
|
||||
typedef struct {
|
||||
|
||||
/** fragment number */
|
||||
u_int8_t num;
|
||||
uint8_t num;
|
||||
|
||||
/** fragment data */
|
||||
chunk_t data;
|
||||
@@ -1024,48 +1024,48 @@ METHOD(message_t, get_ike_sa_id, ike_sa_id_t*,
|
||||
}
|
||||
|
||||
METHOD(message_t, set_message_id, void,
|
||||
private_message_t *this,u_int32_t message_id)
|
||||
private_message_t *this,uint32_t message_id)
|
||||
{
|
||||
this->message_id = message_id;
|
||||
}
|
||||
|
||||
METHOD(message_t, get_message_id, u_int32_t,
|
||||
METHOD(message_t, get_message_id, uint32_t,
|
||||
private_message_t *this)
|
||||
{
|
||||
return this->message_id;
|
||||
}
|
||||
|
||||
METHOD(message_t, get_initiator_spi, u_int64_t,
|
||||
METHOD(message_t, get_initiator_spi, uint64_t,
|
||||
private_message_t *this)
|
||||
{
|
||||
return (this->ike_sa_id->get_initiator_spi(this->ike_sa_id));
|
||||
}
|
||||
|
||||
METHOD(message_t, get_responder_spi, u_int64_t,
|
||||
METHOD(message_t, get_responder_spi, uint64_t,
|
||||
private_message_t *this)
|
||||
{
|
||||
return (this->ike_sa_id->get_responder_spi(this->ike_sa_id));
|
||||
}
|
||||
|
||||
METHOD(message_t, set_major_version, void,
|
||||
private_message_t *this, u_int8_t major_version)
|
||||
private_message_t *this, uint8_t major_version)
|
||||
{
|
||||
this->major_version = major_version;
|
||||
}
|
||||
|
||||
METHOD(message_t, get_major_version, u_int8_t,
|
||||
METHOD(message_t, get_major_version, uint8_t,
|
||||
private_message_t *this)
|
||||
{
|
||||
return this->major_version;
|
||||
}
|
||||
|
||||
METHOD(message_t, set_minor_version, void,
|
||||
private_message_t *this,u_int8_t minor_version)
|
||||
private_message_t *this,uint8_t minor_version)
|
||||
{
|
||||
this->minor_version = minor_version;
|
||||
}
|
||||
|
||||
METHOD(message_t, get_minor_version, u_int8_t,
|
||||
METHOD(message_t, get_minor_version, uint8_t,
|
||||
private_message_t *this)
|
||||
{
|
||||
return this->minor_version;
|
||||
@@ -1331,7 +1331,7 @@ static char* get_string(private_message_t *this, char *buf, int len)
|
||||
if (payload->get_type(payload) == PLV2_EAP)
|
||||
{
|
||||
eap_payload_t *eap = (eap_payload_t*)payload;
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
eap_type_t type;
|
||||
char method[64] = "";
|
||||
|
||||
@@ -1790,7 +1790,7 @@ static status_t finalize_message(private_message_t *this, keymat_t *keymat,
|
||||
{
|
||||
keymat_v1_t *keymat_v1 = (keymat_v1_t*)keymat;
|
||||
chunk_t chunk;
|
||||
u_int32_t *lenpos;
|
||||
uint32_t *lenpos;
|
||||
|
||||
if (encrypted)
|
||||
{
|
||||
@@ -1893,7 +1893,7 @@ static message_t *clone_message(private_message_t *this)
|
||||
* Create a single fragment with the given data
|
||||
*/
|
||||
static message_t *create_fragment(private_message_t *this, payload_type_t next,
|
||||
u_int16_t num, u_int16_t count, chunk_t data)
|
||||
uint16_t num, uint16_t count, chunk_t data)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
payload_t *fragment, *payload;
|
||||
@@ -1972,11 +1972,11 @@ METHOD(message_t, fragment, status_t,
|
||||
message_t *fragment;
|
||||
packet_t *packet;
|
||||
payload_type_t next = PL_NONE;
|
||||
u_int16_t num, count;
|
||||
uint16_t num, count;
|
||||
host_t *src, *dst;
|
||||
chunk_t data;
|
||||
status_t status;
|
||||
u_int32_t *lenpos;
|
||||
uint32_t *lenpos;
|
||||
size_t len;
|
||||
|
||||
src = this->packet->get_source(this->packet);
|
||||
@@ -2703,7 +2703,7 @@ METHOD(message_t, parse_body, status_t,
|
||||
/**
|
||||
* Store the fragment data for the fragment with the given fragment number.
|
||||
*/
|
||||
static status_t add_fragment(private_message_t *this, u_int16_t num,
|
||||
static status_t add_fragment(private_message_t *this, uint16_t num,
|
||||
chunk_t data)
|
||||
{
|
||||
fragment_t *fragment;
|
||||
@@ -2777,7 +2777,7 @@ METHOD(message_t, add_fragment_v1, status_t,
|
||||
{
|
||||
fragment_payload_t *payload;
|
||||
chunk_t data;
|
||||
u_int8_t num;
|
||||
uint8_t num;
|
||||
status_t status;
|
||||
|
||||
if (!this->frag)
|
||||
@@ -2840,7 +2840,7 @@ METHOD(message_t, add_fragment_v2, status_t,
|
||||
payload_t *payload;
|
||||
enumerator_t *enumerator;
|
||||
chunk_t data;
|
||||
u_int16_t total, num;
|
||||
uint16_t total, num;
|
||||
status_t status;
|
||||
|
||||
if (!this->frag)
|
||||
|
||||
@@ -49,56 +49,56 @@ struct message_t {
|
||||
*
|
||||
* @param major_version major version to set
|
||||
*/
|
||||
void (*set_major_version) (message_t *this, u_int8_t major_version);
|
||||
void (*set_major_version) (message_t *this, uint8_t major_version);
|
||||
|
||||
/**
|
||||
* Gets the IKE major version of the message.
|
||||
*
|
||||
* @return major version of the message
|
||||
*/
|
||||
u_int8_t (*get_major_version) (message_t *this);
|
||||
uint8_t (*get_major_version) (message_t *this);
|
||||
|
||||
/**
|
||||
* Sets the IKE minor version of the message.
|
||||
*
|
||||
* @param minor_version minor version to set
|
||||
*/
|
||||
void (*set_minor_version) (message_t *this, u_int8_t minor_version);
|
||||
void (*set_minor_version) (message_t *this, uint8_t minor_version);
|
||||
|
||||
/**
|
||||
* Gets the IKE minor version of the message.
|
||||
*
|
||||
* @return minor version of the message
|
||||
*/
|
||||
u_int8_t (*get_minor_version) (message_t *this);
|
||||
uint8_t (*get_minor_version) (message_t *this);
|
||||
|
||||
/**
|
||||
* Sets the Message ID of the message.
|
||||
*
|
||||
* @param message_id message_id to set
|
||||
*/
|
||||
void (*set_message_id) (message_t *this, u_int32_t message_id);
|
||||
void (*set_message_id) (message_t *this, uint32_t message_id);
|
||||
|
||||
/**
|
||||
* Gets the Message ID of the message.
|
||||
*
|
||||
* @return message_id type of the message
|
||||
*/
|
||||
u_int32_t (*get_message_id) (message_t *this);
|
||||
uint32_t (*get_message_id) (message_t *this);
|
||||
|
||||
/**
|
||||
* Gets the initiator SPI of the message.
|
||||
*
|
||||
* @return initiator spi of the message
|
||||
*/
|
||||
u_int64_t (*get_initiator_spi) (message_t *this);
|
||||
uint64_t (*get_initiator_spi) (message_t *this);
|
||||
|
||||
/**
|
||||
* Gets the responder SPI of the message.
|
||||
*
|
||||
* @return responder spi of the message
|
||||
*/
|
||||
u_int64_t (*get_responder_spi) (message_t *this);
|
||||
uint64_t (*get_responder_spi) (message_t *this);
|
||||
|
||||
/**
|
||||
* Sets the IKE_SA ID of the message.
|
||||
|
||||
@@ -61,27 +61,27 @@ struct private_parser_t {
|
||||
/**
|
||||
* major IKE version
|
||||
*/
|
||||
u_int8_t major_version;
|
||||
uint8_t major_version;
|
||||
|
||||
/**
|
||||
* Current bit for reading in input data.
|
||||
*/
|
||||
u_int8_t bit_pos;
|
||||
uint8_t bit_pos;
|
||||
|
||||
/**
|
||||
* Current byte for reading in input data.
|
||||
*/
|
||||
u_int8_t *byte_pos;
|
||||
uint8_t *byte_pos;
|
||||
|
||||
/**
|
||||
* Input data to parse.
|
||||
*/
|
||||
u_int8_t *input;
|
||||
uint8_t *input;
|
||||
|
||||
/**
|
||||
* Roof of input, used for length-checking.
|
||||
*/
|
||||
u_int8_t *input_roof;
|
||||
uint8_t *input_roof;
|
||||
|
||||
/**
|
||||
* Set of encoding rules for this parsing session.
|
||||
@@ -113,9 +113,9 @@ static bool bad_bitpos(private_parser_t *this, int number)
|
||||
* Parse a 4-Bit unsigned integer from the current parsing position.
|
||||
*/
|
||||
static bool parse_uint4(private_parser_t *this, int rule_number,
|
||||
u_int8_t *output_pos)
|
||||
uint8_t *output_pos)
|
||||
{
|
||||
if (this->byte_pos + sizeof(u_int8_t) > this->input_roof)
|
||||
if (this->byte_pos + sizeof(uint8_t) > this->input_roof)
|
||||
{
|
||||
return short_input(this, rule_number);
|
||||
}
|
||||
@@ -150,9 +150,9 @@ static bool parse_uint4(private_parser_t *this, int rule_number,
|
||||
* Parse a 8-Bit unsigned integer from the current parsing position.
|
||||
*/
|
||||
static bool parse_uint8(private_parser_t *this, int rule_number,
|
||||
u_int8_t *output_pos)
|
||||
uint8_t *output_pos)
|
||||
{
|
||||
if (this->byte_pos + sizeof(u_int8_t) > this->input_roof)
|
||||
if (this->byte_pos + sizeof(uint8_t) > this->input_roof)
|
||||
{
|
||||
return short_input(this, rule_number);
|
||||
}
|
||||
@@ -173,9 +173,9 @@ static bool parse_uint8(private_parser_t *this, int rule_number,
|
||||
* Parse a 15-Bit unsigned integer from the current parsing position.
|
||||
*/
|
||||
static bool parse_uint15(private_parser_t *this, int rule_number,
|
||||
u_int16_t *output_pos)
|
||||
uint16_t *output_pos)
|
||||
{
|
||||
if (this->byte_pos + sizeof(u_int16_t) > this->input_roof)
|
||||
if (this->byte_pos + sizeof(uint16_t) > this->input_roof)
|
||||
{
|
||||
return short_input(this, rule_number);
|
||||
}
|
||||
@@ -185,11 +185,11 @@ static bool parse_uint15(private_parser_t *this, int rule_number,
|
||||
}
|
||||
if (output_pos)
|
||||
{
|
||||
memcpy(output_pos, this->byte_pos, sizeof(u_int16_t));
|
||||
memcpy(output_pos, this->byte_pos, sizeof(uint16_t));
|
||||
*output_pos = ntohs(*output_pos) & ~0x8000;
|
||||
DBG3(DBG_ENC, " => %hu", *output_pos);
|
||||
}
|
||||
this->byte_pos += sizeof(u_int16_t);
|
||||
this->byte_pos += sizeof(uint16_t);
|
||||
this->bit_pos = 0;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -198,9 +198,9 @@ static bool parse_uint15(private_parser_t *this, int rule_number,
|
||||
* Parse a 16-Bit unsigned integer from the current parsing position.
|
||||
*/
|
||||
static bool parse_uint16(private_parser_t *this, int rule_number,
|
||||
u_int16_t *output_pos)
|
||||
uint16_t *output_pos)
|
||||
{
|
||||
if (this->byte_pos + sizeof(u_int16_t) > this->input_roof)
|
||||
if (this->byte_pos + sizeof(uint16_t) > this->input_roof)
|
||||
{
|
||||
return short_input(this, rule_number);
|
||||
}
|
||||
@@ -210,20 +210,20 @@ static bool parse_uint16(private_parser_t *this, int rule_number,
|
||||
}
|
||||
if (output_pos)
|
||||
{
|
||||
memcpy(output_pos, this->byte_pos, sizeof(u_int16_t));
|
||||
memcpy(output_pos, this->byte_pos, sizeof(uint16_t));
|
||||
*output_pos = ntohs(*output_pos);
|
||||
DBG3(DBG_ENC, " => %hu", *output_pos);
|
||||
}
|
||||
this->byte_pos += sizeof(u_int16_t);
|
||||
this->byte_pos += sizeof(uint16_t);
|
||||
return TRUE;
|
||||
}
|
||||
/**
|
||||
* Parse a 32-Bit unsigned integer from the current parsing position.
|
||||
*/
|
||||
static bool parse_uint32(private_parser_t *this, int rule_number,
|
||||
u_int32_t *output_pos)
|
||||
uint32_t *output_pos)
|
||||
{
|
||||
if (this->byte_pos + sizeof(u_int32_t) > this->input_roof)
|
||||
if (this->byte_pos + sizeof(uint32_t) > this->input_roof)
|
||||
{
|
||||
return short_input(this, rule_number);
|
||||
}
|
||||
@@ -233,11 +233,11 @@ static bool parse_uint32(private_parser_t *this, int rule_number,
|
||||
}
|
||||
if (output_pos)
|
||||
{
|
||||
memcpy(output_pos, this->byte_pos, sizeof(u_int32_t));
|
||||
memcpy(output_pos, this->byte_pos, sizeof(uint32_t));
|
||||
*output_pos = ntohl(*output_pos);
|
||||
DBG3(DBG_ENC, " => %u", *output_pos);
|
||||
}
|
||||
this->byte_pos += sizeof(u_int32_t);
|
||||
this->byte_pos += sizeof(uint32_t);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ static bool parse_uint32(private_parser_t *this, int rule_number,
|
||||
* Parse a given amount of bytes and writes them to a specific location
|
||||
*/
|
||||
static bool parse_bytes(private_parser_t *this, int rule_number,
|
||||
u_int8_t *output_pos, int bytes)
|
||||
uint8_t *output_pos, int bytes)
|
||||
{
|
||||
if (this->byte_pos + bytes > this->input_roof)
|
||||
{
|
||||
@@ -270,13 +270,13 @@ static bool parse_bytes(private_parser_t *this, int rule_number,
|
||||
static bool parse_bit(private_parser_t *this, int rule_number,
|
||||
bool *output_pos)
|
||||
{
|
||||
if (this->byte_pos + sizeof(u_int8_t) > this->input_roof)
|
||||
if (this->byte_pos + sizeof(uint8_t) > this->input_roof)
|
||||
{
|
||||
return short_input(this, rule_number);
|
||||
}
|
||||
if (output_pos)
|
||||
{
|
||||
u_int8_t mask;
|
||||
uint8_t mask;
|
||||
mask = 0x01 << (7 - this->bit_pos);
|
||||
*output_pos = *this->byte_pos & mask;
|
||||
|
||||
@@ -312,7 +312,7 @@ static bool parse_list(private_parser_t *this, int rule_number,
|
||||
}
|
||||
while (length > 0)
|
||||
{
|
||||
u_int8_t *pos_before = this->byte_pos;
|
||||
uint8_t *pos_before = this->byte_pos;
|
||||
payload_t *payload;
|
||||
|
||||
DBG2(DBG_ENC, " %d bytes left, parsing recursively %N",
|
||||
@@ -368,7 +368,7 @@ METHOD(parser_t, parse_payload, status_t,
|
||||
payload_t *pld;
|
||||
void *output;
|
||||
int payload_length = 0, spi_size = 0, attribute_length = 0, header_length;
|
||||
u_int16_t ts_type = 0;
|
||||
uint16_t ts_type = 0;
|
||||
bool attribute_format = FALSE;
|
||||
int rule_number, rule_count;
|
||||
encoding_rule_t *rule;
|
||||
@@ -468,7 +468,7 @@ METHOD(parser_t, parse_payload, status_t,
|
||||
return PARSE_ERROR;
|
||||
}
|
||||
/* parsed u_int16 should be aligned */
|
||||
payload_length = *(u_int16_t*)(output + rule->offset);
|
||||
payload_length = *(uint16_t*)(output + rule->offset);
|
||||
/* all payloads must have at least 4 bytes header */
|
||||
if (payload_length < 4)
|
||||
{
|
||||
@@ -484,7 +484,7 @@ METHOD(parser_t, parse_payload, status_t,
|
||||
pld->destroy(pld);
|
||||
return PARSE_ERROR;
|
||||
}
|
||||
spi_size = *(u_int8_t*)(output + rule->offset);
|
||||
spi_size = *(uint8_t*)(output + rule->offset);
|
||||
break;
|
||||
}
|
||||
case SPI:
|
||||
@@ -564,7 +564,7 @@ METHOD(parser_t, parse_payload, status_t,
|
||||
pld->destroy(pld);
|
||||
return PARSE_ERROR;
|
||||
}
|
||||
attribute_length = *(u_int16_t*)(output + rule->offset);
|
||||
attribute_length = *(uint16_t*)(output + rule->offset);
|
||||
break;
|
||||
}
|
||||
case ATTRIBUTE_LENGTH_OR_VALUE:
|
||||
@@ -574,7 +574,7 @@ METHOD(parser_t, parse_payload, status_t,
|
||||
pld->destroy(pld);
|
||||
return PARSE_ERROR;
|
||||
}
|
||||
attribute_length = *(u_int16_t*)(output + rule->offset);
|
||||
attribute_length = *(uint16_t*)(output + rule->offset);
|
||||
break;
|
||||
}
|
||||
case ATTRIBUTE_VALUE:
|
||||
@@ -595,7 +595,7 @@ METHOD(parser_t, parse_payload, status_t,
|
||||
pld->destroy(pld);
|
||||
return PARSE_ERROR;
|
||||
}
|
||||
ts_type = *(u_int8_t*)(output + rule->offset);
|
||||
ts_type = *(uint8_t*)(output + rule->offset);
|
||||
break;
|
||||
}
|
||||
case ADDRESS:
|
||||
@@ -642,7 +642,7 @@ METHOD(parser_t, reset_context, void,
|
||||
}
|
||||
|
||||
METHOD(parser_t, set_major_version, void,
|
||||
private_parser_t *this, u_int8_t major_version)
|
||||
private_parser_t *this, uint8_t major_version)
|
||||
{
|
||||
this->major_version = major_version;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ struct parser_t {
|
||||
*
|
||||
* @param major_version the major IKE version
|
||||
*/
|
||||
void (*set_major_version) (parser_t *this, u_int8_t major_version);
|
||||
void (*set_major_version) (parser_t *this, uint8_t major_version);
|
||||
|
||||
/**
|
||||
* Destroys a parser_t object.
|
||||
|
||||
@@ -35,7 +35,7 @@ struct private_auth_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -50,17 +50,17 @@ struct private_auth_payload_t {
|
||||
/**
|
||||
* Reserved bytes
|
||||
*/
|
||||
u_int8_t reserved_byte[3];
|
||||
uint8_t reserved_byte[3];
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Method of the AUTH Data.
|
||||
*/
|
||||
u_int8_t auth_method;
|
||||
uint8_t auth_method;
|
||||
|
||||
/**
|
||||
* The contained auth data value.
|
||||
|
||||
@@ -55,7 +55,7 @@ struct private_cert_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -70,12 +70,12 @@ struct private_cert_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Encoding of the CERT Data.
|
||||
*/
|
||||
u_int8_t encoding;
|
||||
uint8_t encoding;
|
||||
|
||||
/**
|
||||
* The contained cert data value.
|
||||
|
||||
@@ -38,7 +38,7 @@ struct private_certreq_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -53,12 +53,12 @@ struct private_certreq_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Encoding of the CERT Data.
|
||||
*/
|
||||
u_int8_t encoding;
|
||||
uint8_t encoding;
|
||||
|
||||
/**
|
||||
* The contained certreq data value.
|
||||
|
||||
@@ -48,12 +48,12 @@ struct private_configuration_attribute_t {
|
||||
/**
|
||||
* Type of the attribute.
|
||||
*/
|
||||
u_int16_t attr_type;
|
||||
uint16_t attr_type;
|
||||
|
||||
/**
|
||||
* Length of the attribute, value if af_flag set.
|
||||
*/
|
||||
u_int16_t length_or_value;
|
||||
uint16_t length_or_value;
|
||||
|
||||
/**
|
||||
* Attribute value as chunk.
|
||||
@@ -272,7 +272,7 @@ METHOD(configuration_attribute_t, get_chunk, chunk_t,
|
||||
return this->value;
|
||||
}
|
||||
|
||||
METHOD(configuration_attribute_t, get_value, u_int16_t,
|
||||
METHOD(configuration_attribute_t, get_value, uint16_t,
|
||||
private_configuration_attribute_t *this)
|
||||
{
|
||||
if (this->af_flag)
|
||||
@@ -328,7 +328,7 @@ configuration_attribute_t *configuration_attribute_create_chunk(
|
||||
|
||||
this = (private_configuration_attribute_t*)
|
||||
configuration_attribute_create(type);
|
||||
this->attr_type = ((u_int16_t)attr_type) & 0x7FFF;
|
||||
this->attr_type = ((uint16_t)attr_type) & 0x7FFF;
|
||||
this->value = chunk_clone(chunk);
|
||||
this->length_or_value = chunk.len;
|
||||
|
||||
@@ -339,13 +339,13 @@ configuration_attribute_t *configuration_attribute_create_chunk(
|
||||
* Described in header.
|
||||
*/
|
||||
configuration_attribute_t *configuration_attribute_create_value(
|
||||
configuration_attribute_type_t attr_type, u_int16_t value)
|
||||
configuration_attribute_type_t attr_type, uint16_t value)
|
||||
{
|
||||
private_configuration_attribute_t *this;
|
||||
|
||||
this = (private_configuration_attribute_t*)
|
||||
configuration_attribute_create(PLV1_CONFIGURATION_ATTRIBUTE);
|
||||
this->attr_type = ((u_int16_t)attr_type) & 0x7FFF;
|
||||
this->attr_type = ((uint16_t)attr_type) & 0x7FFF;
|
||||
this->length_or_value = value;
|
||||
this->af_flag = TRUE;
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ struct configuration_attribute_t {
|
||||
*
|
||||
* @return attribute value
|
||||
*/
|
||||
u_int16_t (*get_value) (configuration_attribute_t *this);
|
||||
uint16_t (*get_value) (configuration_attribute_t *this);
|
||||
|
||||
/**
|
||||
* Destroys an configuration_attribute_t object.
|
||||
@@ -92,6 +92,6 @@ configuration_attribute_t *configuration_attribute_create_chunk(
|
||||
* @return created PLV1_CONFIGURATION_ATTRIBUTE configuration attribute
|
||||
*/
|
||||
configuration_attribute_t *configuration_attribute_create_value(
|
||||
configuration_attribute_type_t attr_type, u_int16_t value);
|
||||
configuration_attribute_type_t attr_type, uint16_t value);
|
||||
|
||||
#endif /** CONFIGURATION_ATTRIBUTE_H_ @}*/
|
||||
|
||||
@@ -44,7 +44,7 @@ struct private_cp_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -59,17 +59,17 @@ struct private_cp_payload_t {
|
||||
/**
|
||||
* Reserved bytes
|
||||
*/
|
||||
u_int8_t reserved_byte[3];
|
||||
uint8_t reserved_byte[3];
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Identifier field, IKEv1 only
|
||||
*/
|
||||
u_int16_t identifier;
|
||||
uint16_t identifier;
|
||||
|
||||
/**
|
||||
* List of attributes, as configuration_attribute_t
|
||||
@@ -79,7 +79,7 @@ struct private_cp_payload_t {
|
||||
/**
|
||||
* Config Type.
|
||||
*/
|
||||
u_int8_t cfg_type;
|
||||
uint8_t cfg_type;
|
||||
|
||||
/**
|
||||
* PLV2_CONFIGURATION or PLV1_CONFIGURATION
|
||||
@@ -269,13 +269,13 @@ METHOD(cp_payload_t, get_config_type, config_type_t,
|
||||
return this->cfg_type;
|
||||
}
|
||||
|
||||
METHOD(cp_payload_t, get_identifier, u_int16_t,
|
||||
METHOD(cp_payload_t, get_identifier, uint16_t,
|
||||
private_cp_payload_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
METHOD(cp_payload_t, set_identifier, void,
|
||||
private_cp_payload_t *this, u_int16_t identifier)
|
||||
private_cp_payload_t *this, uint16_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -82,14 +82,14 @@ struct cp_payload_t {
|
||||
*
|
||||
@param identifier identifier to set
|
||||
*/
|
||||
void (*set_identifier) (cp_payload_t *this, u_int16_t identifier);
|
||||
void (*set_identifier) (cp_payload_t *this, uint16_t identifier);
|
||||
|
||||
/**
|
||||
* Get the configuration payload identifier (IKEv1 only).
|
||||
*
|
||||
* @return identifier
|
||||
*/
|
||||
u_int16_t (*get_identifier) (cp_payload_t *this);
|
||||
uint16_t (*get_identifier) (cp_payload_t *this);
|
||||
|
||||
/**
|
||||
* Destroys an cp_payload_t object.
|
||||
|
||||
@@ -36,7 +36,7 @@ struct private_delete_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -51,27 +51,27 @@ struct private_delete_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* IKEv1 Domain of Interpretation
|
||||
*/
|
||||
u_int32_t doi;
|
||||
uint32_t doi;
|
||||
|
||||
/**
|
||||
* Protocol ID.
|
||||
*/
|
||||
u_int8_t protocol_id;
|
||||
uint8_t protocol_id;
|
||||
|
||||
/**
|
||||
* SPI Size.
|
||||
*/
|
||||
u_int8_t spi_size;
|
||||
uint8_t spi_size;
|
||||
|
||||
/**
|
||||
* Number of SPI's.
|
||||
*/
|
||||
u_int16_t spi_count;
|
||||
uint16_t spi_count;
|
||||
|
||||
/**
|
||||
* The contained SPI's.
|
||||
@@ -257,7 +257,7 @@ METHOD(delete_payload_t, get_protocol_id, protocol_id_t,
|
||||
}
|
||||
|
||||
METHOD(delete_payload_t, add_spi, void,
|
||||
private_delete_payload_t *this, u_int32_t spi)
|
||||
private_delete_payload_t *this, uint32_t spi)
|
||||
{
|
||||
switch (this->protocol_id)
|
||||
{
|
||||
@@ -273,7 +273,7 @@ METHOD(delete_payload_t, add_spi, void,
|
||||
}
|
||||
|
||||
METHOD(delete_payload_t, set_ike_spi, void,
|
||||
private_delete_payload_t *this, u_int64_t spi_i, u_int64_t spi_r)
|
||||
private_delete_payload_t *this, uint64_t spi_i, uint64_t spi_r)
|
||||
{
|
||||
free(this->spis.ptr);
|
||||
this->spis = chunk_cat("cc", chunk_from_thing(spi_i),
|
||||
@@ -283,15 +283,15 @@ METHOD(delete_payload_t, set_ike_spi, void,
|
||||
}
|
||||
|
||||
METHOD(delete_payload_t, get_ike_spi, bool,
|
||||
private_delete_payload_t *this, u_int64_t *spi_i, u_int64_t *spi_r)
|
||||
private_delete_payload_t *this, uint64_t *spi_i, uint64_t *spi_r)
|
||||
{
|
||||
if (this->protocol_id != PROTO_IKE ||
|
||||
this->spis.len < 2 * sizeof(u_int64_t))
|
||||
this->spis.len < 2 * sizeof(uint64_t))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memcpy(spi_i, this->spis.ptr, sizeof(u_int64_t));
|
||||
memcpy(spi_r, this->spis.ptr + sizeof(u_int64_t), sizeof(u_int64_t));
|
||||
memcpy(spi_i, this->spis.ptr, sizeof(uint64_t));
|
||||
memcpy(spi_r, this->spis.ptr + sizeof(uint64_t), sizeof(uint64_t));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ typedef struct {
|
||||
} spi_enumerator_t;
|
||||
|
||||
METHOD(enumerator_t, spis_enumerate, bool,
|
||||
spi_enumerator_t *this, u_int32_t *spi)
|
||||
spi_enumerator_t *this, uint32_t *spi)
|
||||
{
|
||||
if (this->spis.len >= sizeof(*spi))
|
||||
{
|
||||
@@ -322,7 +322,7 @@ METHOD(delete_payload_t, create_spi_enumerator, enumerator_t*,
|
||||
{
|
||||
spi_enumerator_t *e;
|
||||
|
||||
if (this->spi_size != sizeof(u_int32_t))
|
||||
if (this->spi_size != sizeof(uint32_t))
|
||||
{
|
||||
return enumerator_create_empty();
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ struct delete_payload_t {
|
||||
*
|
||||
* @param spi spi to add
|
||||
*/
|
||||
void (*add_spi) (delete_payload_t *this, u_int32_t spi);
|
||||
void (*add_spi) (delete_payload_t *this, uint32_t spi);
|
||||
|
||||
/**
|
||||
* Set the IKE SPIs for an IKEv1 delete.
|
||||
@@ -59,7 +59,7 @@ struct delete_payload_t {
|
||||
* @param spi_i initiator SPI
|
||||
* @param spi_r responder SPI
|
||||
*/
|
||||
void (*set_ike_spi)(delete_payload_t *this, u_int64_t spi_i, u_int64_t spi_r);
|
||||
void (*set_ike_spi)(delete_payload_t *this, uint64_t spi_i, uint64_t spi_r);
|
||||
|
||||
/**
|
||||
* Get the IKE SPIs from an IKEv1 delete.
|
||||
@@ -68,12 +68,12 @@ struct delete_payload_t {
|
||||
* @param spi_r responder SPI
|
||||
* @return TRUE if SPIs extracted successfully
|
||||
*/
|
||||
bool (*get_ike_spi)(delete_payload_t *this, u_int64_t *spi_i, u_int64_t *spi_r);
|
||||
bool (*get_ike_spi)(delete_payload_t *this, uint64_t *spi_i, uint64_t *spi_r);
|
||||
|
||||
/**
|
||||
* Get an enumerator over the SPIs in network order.
|
||||
*
|
||||
* @return enumerator over SPIs, u_int32_t
|
||||
* @return enumerator over SPIs, uint32_t
|
||||
*/
|
||||
enumerator_t *(*create_spi_enumerator) (delete_payload_t *this);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ struct private_eap_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -53,7 +53,7 @@ struct private_eap_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* EAP message data, if available
|
||||
@@ -102,8 +102,8 @@ static encoding_rule_t encodings[] = {
|
||||
METHOD(payload_t, verify, status_t,
|
||||
private_eap_payload_t *this)
|
||||
{
|
||||
u_int16_t length;
|
||||
u_int8_t code;
|
||||
uint16_t length;
|
||||
uint8_t code;
|
||||
|
||||
if (this->data.len < 4)
|
||||
{
|
||||
@@ -208,7 +208,7 @@ METHOD(eap_payload_t, get_code, eap_code_t,
|
||||
return 0;
|
||||
}
|
||||
|
||||
METHOD(eap_payload_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_payload_t, get_identifier, uint8_t,
|
||||
private_eap_payload_t *this)
|
||||
{
|
||||
if (this->data.len > 1)
|
||||
@@ -224,7 +224,7 @@ METHOD(eap_payload_t, get_identifier, u_int8_t,
|
||||
* @return the new offset or 0 if failed
|
||||
*/
|
||||
static size_t extract_type(private_eap_payload_t *this, size_t offset,
|
||||
eap_type_t *type, u_int32_t *vendor)
|
||||
eap_type_t *type, uint32_t *vendor)
|
||||
{
|
||||
if (this->data.len > offset)
|
||||
{
|
||||
@@ -245,7 +245,7 @@ static size_t extract_type(private_eap_payload_t *this, size_t offset,
|
||||
}
|
||||
|
||||
METHOD(eap_payload_t, get_type, eap_type_t,
|
||||
private_eap_payload_t *this, u_int32_t *vendor)
|
||||
private_eap_payload_t *this, uint32_t *vendor)
|
||||
{
|
||||
eap_type_t type;
|
||||
|
||||
@@ -270,7 +270,7 @@ typedef struct {
|
||||
} type_enumerator_t;
|
||||
|
||||
METHOD(enumerator_t, enumerate_types, bool,
|
||||
type_enumerator_t *this, eap_type_t *type, u_int32_t *vendor)
|
||||
type_enumerator_t *this, eap_type_t *type, uint32_t *vendor)
|
||||
{
|
||||
this->offset = extract_type(this->payload, this->offset, type, vendor);
|
||||
return this->offset;
|
||||
@@ -281,7 +281,7 @@ METHOD(eap_payload_t, get_types, enumerator_t*,
|
||||
{
|
||||
type_enumerator_t *enumerator;
|
||||
eap_type_t type;
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
size_t offset;
|
||||
|
||||
offset = extract_type(this, 4, &type, &vendor);
|
||||
@@ -373,7 +373,7 @@ eap_payload_t *eap_payload_create_data_own(chunk_t data)
|
||||
/*
|
||||
* Described in header
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_code(eap_code_t code, u_int8_t identifier)
|
||||
eap_payload_t *eap_payload_create_code(eap_code_t code, uint8_t identifier)
|
||||
{
|
||||
chunk_t data;
|
||||
|
||||
@@ -385,7 +385,7 @@ eap_payload_t *eap_payload_create_code(eap_code_t code, u_int8_t identifier)
|
||||
/**
|
||||
* Write the given type either expanded or not
|
||||
*/
|
||||
static void write_type(bio_writer_t *writer, eap_type_t type, u_int32_t vendor,
|
||||
static void write_type(bio_writer_t *writer, eap_type_t type, uint32_t vendor,
|
||||
bool expanded)
|
||||
{
|
||||
if (expanded)
|
||||
@@ -403,12 +403,12 @@ static void write_type(bio_writer_t *writer, eap_type_t type, u_int32_t vendor,
|
||||
/*
|
||||
* Described in header
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_nak(u_int8_t identifier, eap_type_t type,
|
||||
u_int32_t vendor, bool expanded)
|
||||
eap_payload_t *eap_payload_create_nak(uint8_t identifier, eap_type_t type,
|
||||
uint32_t vendor, bool expanded)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
eap_type_t reg_type;
|
||||
u_int32_t reg_vendor;
|
||||
uint32_t reg_vendor;
|
||||
bio_writer_t *writer;
|
||||
chunk_t data;
|
||||
bool added_any = FALSE, found_vendor = FALSE;
|
||||
|
||||
@@ -72,7 +72,7 @@ struct eap_payload_t {
|
||||
*
|
||||
* @return unique identifier
|
||||
*/
|
||||
u_int8_t (*get_identifier) (eap_payload_t *this);
|
||||
uint8_t (*get_identifier) (eap_payload_t *this);
|
||||
|
||||
/**
|
||||
* Get the EAP method type.
|
||||
@@ -80,13 +80,13 @@ struct eap_payload_t {
|
||||
* @param vendor pointer receiving vendor identifier
|
||||
* @return EAP method type, vendor specific if vendor != 0
|
||||
*/
|
||||
eap_type_t (*get_type) (eap_payload_t *this, u_int32_t *vendor);
|
||||
eap_type_t (*get_type) (eap_payload_t *this, uint32_t *vendor);
|
||||
|
||||
/**
|
||||
* Enumerate the EAP method types contained in an EAP-Nak (i.e. get_type()
|
||||
* returns EAP_NAK).
|
||||
*
|
||||
* @return enumerator over (eap_type_t type, u_int32_t vendor)
|
||||
* @return enumerator over (eap_type_t type, uint32_t vendor)
|
||||
*/
|
||||
enumerator_t* (*get_types) (eap_payload_t *this);
|
||||
|
||||
@@ -136,7 +136,7 @@ eap_payload_t *eap_payload_create_data_own(chunk_t data);
|
||||
* @param identifier EAP identifier to use in payload
|
||||
* @return eap_payload_t object
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_code(eap_code_t code, u_int8_t identifier);
|
||||
eap_payload_t *eap_payload_create_code(eap_code_t code, uint8_t identifier);
|
||||
|
||||
/**
|
||||
* Creates an eap_payload_t EAP_RESPONSE containing an EAP_NAK.
|
||||
@@ -147,7 +147,7 @@ eap_payload_t *eap_payload_create_code(eap_code_t code, u_int8_t identifier);
|
||||
* @param expanded TRUE to send an expanded Nak
|
||||
* @return eap_payload_t object
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_nak(u_int8_t identifier, eap_type_t type,
|
||||
u_int32_t vendor, bool expanded);
|
||||
eap_payload_t *eap_payload_create_nak(uint8_t identifier, eap_type_t type,
|
||||
uint32_t vendor, bool expanded);
|
||||
|
||||
#endif /** EAP_PAYLOAD_H_ @}*/
|
||||
|
||||
@@ -289,10 +289,10 @@ enum encoding_type_t {
|
||||
/**
|
||||
* Representating an IKE_SPI field in an IKEv2 Header.
|
||||
*
|
||||
* When generating the value of the u_int64_t pointing to
|
||||
* When generating the value of the uint64_t pointing to
|
||||
* is written (host and networ order is not changed).
|
||||
*
|
||||
* When parsing 8 bytes are read and written into the u_int64_t pointing to.
|
||||
* When parsing 8 bytes are read and written into the uint64_t pointing to.
|
||||
*/
|
||||
IKE_SPI,
|
||||
|
||||
@@ -342,7 +342,7 @@ struct encoding_rule_t {
|
||||
* When generating, data are read from this offset in the
|
||||
* data struct.
|
||||
*/
|
||||
u_int32_t offset;
|
||||
uint32_t offset;
|
||||
};
|
||||
|
||||
#endif /** ENCODINGS_H_ @}*/
|
||||
|
||||
@@ -42,14 +42,14 @@ struct encrypted_fragment_payload_t {
|
||||
*
|
||||
* @return fragment number
|
||||
*/
|
||||
u_int16_t (*get_fragment_number)(encrypted_fragment_payload_t *this);
|
||||
uint16_t (*get_fragment_number)(encrypted_fragment_payload_t *this);
|
||||
|
||||
/**
|
||||
* Get the total number of fragments.
|
||||
*
|
||||
* @return total number of fragments
|
||||
*/
|
||||
u_int16_t (*get_total_fragments)(encrypted_fragment_payload_t *this);
|
||||
uint16_t (*get_total_fragments)(encrypted_fragment_payload_t *this);
|
||||
|
||||
/**
|
||||
* Get the (decrypted) content of this payload.
|
||||
@@ -80,6 +80,6 @@ encrypted_fragment_payload_t *encrypted_fragment_payload_create();
|
||||
* @return encrypted_fragment_payload_t object
|
||||
*/
|
||||
encrypted_fragment_payload_t *encrypted_fragment_payload_create_from_data(
|
||||
u_int16_t num, u_int16_t total, chunk_t data);
|
||||
uint16_t num, uint16_t total, chunk_t data);
|
||||
|
||||
#endif /** ENCRYPTED_FRAGMENT_PAYLOAD_H_ @}*/
|
||||
|
||||
@@ -43,17 +43,17 @@ struct private_encrypted_payload_t {
|
||||
* next_payload means here the first payload of the
|
||||
* contained, encrypted payload.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Flags, including reserved bits
|
||||
*/
|
||||
u_int8_t flags;
|
||||
uint8_t flags;
|
||||
|
||||
/**
|
||||
* Length of this payload
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Chunk containing the IV, plain, padding and ICV.
|
||||
@@ -88,17 +88,17 @@ struct private_encrypted_fragment_payload_t {
|
||||
* the original encrypted payload, for all other fragments it MUST be set
|
||||
* to zero.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Flags, including reserved bits
|
||||
*/
|
||||
u_int8_t flags;
|
||||
uint8_t flags;
|
||||
|
||||
/**
|
||||
* Length of this payload
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Chunk containing the IV, plain, padding and ICV.
|
||||
@@ -108,12 +108,12 @@ struct private_encrypted_fragment_payload_t {
|
||||
/**
|
||||
* Fragment number
|
||||
*/
|
||||
u_int16_t fragment_number;
|
||||
uint16_t fragment_number;
|
||||
|
||||
/**
|
||||
* Total fragments
|
||||
*/
|
||||
u_int16_t total_fragments;
|
||||
uint16_t total_fragments;
|
||||
|
||||
/**
|
||||
* AEAD transform to use
|
||||
@@ -366,7 +366,7 @@ static chunk_t generate(private_encrypted_payload_t *this,
|
||||
{
|
||||
payload_t *current, *next;
|
||||
enumerator_t *enumerator;
|
||||
u_int32_t *lenpos;
|
||||
uint32_t *lenpos;
|
||||
chunk_t chunk = chunk_empty;
|
||||
|
||||
enumerator = this->payloads->create_enumerator(this->payloads);
|
||||
@@ -402,9 +402,9 @@ METHOD(encrypted_payload_t, generate_payloads, void,
|
||||
static chunk_t append_header(private_encrypted_payload_t *this, chunk_t assoc)
|
||||
{
|
||||
struct {
|
||||
u_int8_t next_payload;
|
||||
u_int8_t flags;
|
||||
u_int16_t length;
|
||||
uint8_t next_payload;
|
||||
uint8_t flags;
|
||||
uint16_t length;
|
||||
} __attribute__((packed)) header = {
|
||||
.next_payload = this->next_payload,
|
||||
.flags = this->flags,
|
||||
@@ -416,7 +416,7 @@ static chunk_t append_header(private_encrypted_payload_t *this, chunk_t assoc)
|
||||
/**
|
||||
* Encrypts the data in plain and returns it in an allocated chunk.
|
||||
*/
|
||||
static status_t encrypt_content(char *label, aead_t *aead, u_int64_t mid,
|
||||
static status_t encrypt_content(char *label, aead_t *aead, uint64_t mid,
|
||||
chunk_t plain, chunk_t assoc, chunk_t *encrypted)
|
||||
{
|
||||
chunk_t iv, padding, icv, crypt;
|
||||
@@ -486,7 +486,7 @@ static status_t encrypt_content(char *label, aead_t *aead, u_int64_t mid,
|
||||
}
|
||||
|
||||
METHOD(encrypted_payload_t, encrypt, status_t,
|
||||
private_encrypted_payload_t *this, u_int64_t mid, chunk_t assoc)
|
||||
private_encrypted_payload_t *this, uint64_t mid, chunk_t assoc)
|
||||
{
|
||||
generator_t *generator;
|
||||
chunk_t plain;
|
||||
@@ -512,7 +512,7 @@ METHOD(encrypted_payload_t, encrypt, status_t,
|
||||
}
|
||||
|
||||
METHOD(encrypted_payload_t, encrypt_v1, status_t,
|
||||
private_encrypted_payload_t *this, u_int64_t mid, chunk_t iv)
|
||||
private_encrypted_payload_t *this, uint64_t mid, chunk_t iv)
|
||||
{
|
||||
generator_t *generator;
|
||||
chunk_t plain, padding;
|
||||
@@ -869,13 +869,13 @@ METHOD2(payload_t, encrypted_payload_t, frag_get_length, size_t,
|
||||
return this->payload_length;
|
||||
}
|
||||
|
||||
METHOD(encrypted_fragment_payload_t, get_fragment_number, u_int16_t,
|
||||
METHOD(encrypted_fragment_payload_t, get_fragment_number, uint16_t,
|
||||
private_encrypted_fragment_payload_t *this)
|
||||
{
|
||||
return this->fragment_number;
|
||||
}
|
||||
|
||||
METHOD(encrypted_fragment_payload_t, get_total_fragments, u_int16_t,
|
||||
METHOD(encrypted_fragment_payload_t, get_total_fragments, uint16_t,
|
||||
private_encrypted_fragment_payload_t *this)
|
||||
{
|
||||
return this->total_fragments;
|
||||
@@ -906,11 +906,11 @@ static chunk_t append_header_frag(private_encrypted_fragment_payload_t *this,
|
||||
chunk_t assoc)
|
||||
{
|
||||
struct {
|
||||
u_int8_t next_payload;
|
||||
u_int8_t flags;
|
||||
u_int16_t length;
|
||||
u_int16_t fragment_number;
|
||||
u_int16_t total_fragments;
|
||||
uint8_t next_payload;
|
||||
uint8_t flags;
|
||||
uint16_t length;
|
||||
uint16_t fragment_number;
|
||||
uint16_t total_fragments;
|
||||
} __attribute__((packed)) header = {
|
||||
.next_payload = this->next_payload,
|
||||
.flags = this->flags,
|
||||
@@ -922,7 +922,7 @@ static chunk_t append_header_frag(private_encrypted_fragment_payload_t *this,
|
||||
}
|
||||
|
||||
METHOD(encrypted_payload_t, frag_encrypt, status_t,
|
||||
private_encrypted_fragment_payload_t *this, u_int64_t mid, chunk_t assoc)
|
||||
private_encrypted_fragment_payload_t *this, uint64_t mid, chunk_t assoc)
|
||||
{
|
||||
status_t status;
|
||||
|
||||
@@ -1015,7 +1015,7 @@ encrypted_fragment_payload_t *encrypted_fragment_payload_create()
|
||||
* Described in header
|
||||
*/
|
||||
encrypted_fragment_payload_t *encrypted_fragment_payload_create_from_data(
|
||||
u_int16_t num, u_int16_t total, chunk_t plain)
|
||||
uint16_t num, uint16_t total, chunk_t plain)
|
||||
{
|
||||
private_encrypted_fragment_payload_t *this;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ struct encrypted_payload_t {
|
||||
* - FAILED if encryption failed
|
||||
* - INVALID_STATE if aead not supplied, but needed
|
||||
*/
|
||||
status_t (*encrypt) (encrypted_payload_t *this, u_int64_t mid,
|
||||
status_t (*encrypt) (encrypted_payload_t *this, uint64_t mid,
|
||||
chunk_t assoc);
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,7 +33,7 @@ struct private_endpoint_notify_t {
|
||||
/**
|
||||
* Priority
|
||||
*/
|
||||
u_int32_t priority;
|
||||
uint32_t priority;
|
||||
|
||||
/**
|
||||
* Family
|
||||
@@ -83,36 +83,36 @@ static private_endpoint_notify_t *endpoint_notify_create();
|
||||
/**
|
||||
* Helper functions to parse integer values
|
||||
*/
|
||||
static status_t parse_uint8(u_int8_t **cur, u_int8_t *top, u_int8_t *val)
|
||||
static status_t parse_uint8(uint8_t **cur, uint8_t *top, uint8_t *val)
|
||||
{
|
||||
if (*cur + sizeof(u_int8_t) > top)
|
||||
if (*cur + sizeof(uint8_t) > top)
|
||||
{
|
||||
return FAILED;
|
||||
}
|
||||
*val = *(u_int8_t*)*cur;
|
||||
*cur += sizeof(u_int8_t);
|
||||
*val = *(uint8_t*)*cur;
|
||||
*cur += sizeof(uint8_t);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static status_t parse_uint16(u_int8_t **cur, u_int8_t *top, u_int16_t *val)
|
||||
static status_t parse_uint16(uint8_t **cur, uint8_t *top, uint16_t *val)
|
||||
{
|
||||
if (*cur + sizeof(u_int16_t) > top)
|
||||
if (*cur + sizeof(uint16_t) > top)
|
||||
{
|
||||
return FAILED;
|
||||
}
|
||||
*val = ntohs(*(u_int16_t*)*cur);
|
||||
*cur += sizeof(u_int16_t);
|
||||
*val = ntohs(*(uint16_t*)*cur);
|
||||
*cur += sizeof(uint16_t);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static status_t parse_uint32(u_int8_t **cur, u_int8_t *top, u_int32_t *val)
|
||||
static status_t parse_uint32(uint8_t **cur, uint8_t *top, uint32_t *val)
|
||||
{
|
||||
if (*cur + sizeof(u_int32_t) > top)
|
||||
if (*cur + sizeof(uint32_t) > top)
|
||||
{
|
||||
return FAILED;
|
||||
}
|
||||
*val = ntohl(*(u_int32_t*)*cur);
|
||||
*cur += sizeof(u_int32_t);
|
||||
*val = ntohl(*(uint32_t*)*cur);
|
||||
*cur += sizeof(uint32_t);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -121,11 +121,11 @@ static status_t parse_uint32(u_int8_t **cur, u_int8_t *top, u_int32_t *val)
|
||||
*/
|
||||
static status_t parse_notification_data(private_endpoint_notify_t *this, chunk_t data)
|
||||
{
|
||||
u_int8_t family, type, addr_family;
|
||||
u_int16_t port;
|
||||
uint8_t family, type, addr_family;
|
||||
uint16_t port;
|
||||
chunk_t addr;
|
||||
u_int8_t *cur = data.ptr;
|
||||
u_int8_t *top = data.ptr + data.len;
|
||||
uint8_t *cur = data.ptr;
|
||||
uint8_t *top = data.ptr + data.len;
|
||||
|
||||
DBG3(DBG_IKE, "me_endpoint_data %B", &data);
|
||||
|
||||
@@ -191,9 +191,9 @@ static chunk_t build_notification_data(private_endpoint_notify_t *this)
|
||||
{
|
||||
chunk_t prio_chunk, family_chunk, type_chunk, port_chunk, addr_chunk;
|
||||
chunk_t data;
|
||||
u_int32_t prio;
|
||||
u_int16_t port;
|
||||
u_int8_t family, type;
|
||||
uint32_t prio;
|
||||
uint16_t port;
|
||||
uint8_t family, type;
|
||||
|
||||
prio = htonl(this->priority);
|
||||
prio_chunk = chunk_from_thing(prio);
|
||||
@@ -237,14 +237,14 @@ METHOD(endpoint_notify_t, build_notify, notify_payload_t*,
|
||||
}
|
||||
|
||||
|
||||
METHOD(endpoint_notify_t, get_priority, u_int32_t,
|
||||
METHOD(endpoint_notify_t, get_priority, uint32_t,
|
||||
private_endpoint_notify_t *this)
|
||||
{
|
||||
return this->priority;
|
||||
}
|
||||
|
||||
METHOD(endpoint_notify_t, set_priority, void,
|
||||
private_endpoint_notify_t *this, u_int32_t priority)
|
||||
private_endpoint_notify_t *this, uint32_t priority)
|
||||
{
|
||||
this->priority = priority;
|
||||
}
|
||||
|
||||
@@ -82,14 +82,14 @@ struct endpoint_notify_t {
|
||||
*
|
||||
* @return priority
|
||||
*/
|
||||
u_int32_t (*get_priority) (endpoint_notify_t *this);
|
||||
uint32_t (*get_priority) (endpoint_notify_t *this);
|
||||
|
||||
/**
|
||||
* Sets the priority of this endpoint.
|
||||
*
|
||||
* @param priority priority
|
||||
*/
|
||||
void (*set_priority) (endpoint_notify_t *this, u_int32_t priority);
|
||||
void (*set_priority) (endpoint_notify_t *this, uint32_t priority);
|
||||
|
||||
/**
|
||||
* Returns the endpoint type of this endpoint.
|
||||
|
||||
@@ -35,32 +35,32 @@ struct private_fragment_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Reserved byte
|
||||
*/
|
||||
u_int8_t reserved;
|
||||
uint8_t reserved;
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Fragment ID.
|
||||
*/
|
||||
u_int16_t fragment_id;
|
||||
uint16_t fragment_id;
|
||||
|
||||
/**
|
||||
* Fragment number.
|
||||
*/
|
||||
u_int8_t fragment_number;
|
||||
uint8_t fragment_number;
|
||||
|
||||
/**
|
||||
* Flags
|
||||
*/
|
||||
u_int8_t flags;
|
||||
uint8_t flags;
|
||||
|
||||
/**
|
||||
* The contained fragment data.
|
||||
@@ -145,13 +145,13 @@ METHOD(payload_t, get_length, size_t,
|
||||
return this->payload_length;
|
||||
}
|
||||
|
||||
METHOD(fragment_payload_t, get_id, u_int16_t,
|
||||
METHOD(fragment_payload_t, get_id, uint16_t,
|
||||
private_fragment_payload_t *this)
|
||||
{
|
||||
return this->fragment_id;
|
||||
}
|
||||
|
||||
METHOD(fragment_payload_t, get_number, u_int8_t,
|
||||
METHOD(fragment_payload_t, get_number, uint8_t,
|
||||
private_fragment_payload_t *this)
|
||||
{
|
||||
return this->fragment_number;
|
||||
@@ -210,7 +210,7 @@ fragment_payload_t *fragment_payload_create()
|
||||
/*
|
||||
* Described in header
|
||||
*/
|
||||
fragment_payload_t *fragment_payload_create_from_data(u_int8_t num, bool last,
|
||||
fragment_payload_t *fragment_payload_create_from_data(uint8_t num, bool last,
|
||||
chunk_t data)
|
||||
{
|
||||
private_fragment_payload_t *this;
|
||||
|
||||
@@ -42,14 +42,14 @@ struct fragment_payload_t {
|
||||
*
|
||||
* @return fragment ID
|
||||
*/
|
||||
u_int16_t (*get_id)(fragment_payload_t *this);
|
||||
uint16_t (*get_id)(fragment_payload_t *this);
|
||||
|
||||
/**
|
||||
* Get the fragment number. Defines the order of the fragments.
|
||||
*
|
||||
* @return fragment number
|
||||
*/
|
||||
u_int8_t (*get_number)(fragment_payload_t *this);
|
||||
uint8_t (*get_number)(fragment_payload_t *this);
|
||||
|
||||
/**
|
||||
* Check if this is the last fragment.
|
||||
@@ -88,7 +88,7 @@ fragment_payload_t *fragment_payload_create();
|
||||
* @param data fragment data (gets cloned)
|
||||
* @return fragment_payload_t object
|
||||
*/
|
||||
fragment_payload_t *fragment_payload_create_from_data(u_int8_t num, bool last,
|
||||
fragment_payload_t *fragment_payload_create_from_data(uint8_t num, bool last,
|
||||
chunk_t data);
|
||||
|
||||
#endif /** FRAGMENT_PAYLOAD_H_ @}*/
|
||||
|
||||
@@ -34,17 +34,17 @@ struct private_hash_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Reserved byte
|
||||
*/
|
||||
u_int8_t reserved;
|
||||
uint8_t reserved;
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* The contained hash value.
|
||||
|
||||
@@ -38,7 +38,7 @@ struct private_id_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -53,17 +53,17 @@ struct private_id_payload_t {
|
||||
/**
|
||||
* Reserved bytes
|
||||
*/
|
||||
u_int8_t reserved_byte[3];
|
||||
uint8_t reserved_byte[3];
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Type of the ID Data.
|
||||
*/
|
||||
u_int8_t id_type;
|
||||
uint8_t id_type;
|
||||
|
||||
/**
|
||||
* The contained id data value.
|
||||
@@ -73,12 +73,12 @@ struct private_id_payload_t {
|
||||
/**
|
||||
* Tunneled protocol ID for IKEv1 quick modes.
|
||||
*/
|
||||
u_int8_t protocol_id;
|
||||
uint8_t protocol_id;
|
||||
|
||||
/**
|
||||
* Tunneled port for IKEv1 quick modes.
|
||||
*/
|
||||
u_int16_t port;
|
||||
uint16_t port;
|
||||
|
||||
/**
|
||||
* one of PLV2_ID_INITIATOR, PLV2_ID_RESPONDER, IDv1 and PLV1_NAT_OA
|
||||
@@ -334,7 +334,7 @@ METHOD(id_payload_t, get_ts, traffic_selector_t*,
|
||||
METHOD(id_payload_t, get_encoded, chunk_t,
|
||||
private_id_payload_t *this)
|
||||
{
|
||||
u_int16_t port = htons(this->port);
|
||||
uint16_t port = htons(this->port);
|
||||
return chunk_cat("cccc", chunk_from_thing(this->id_type),
|
||||
chunk_from_thing(this->protocol_id),
|
||||
chunk_from_thing(port), this->id_data);
|
||||
@@ -400,7 +400,7 @@ id_payload_t *id_payload_create_from_identification(payload_type_t type,
|
||||
id_payload_t *id_payload_create_from_ts(traffic_selector_t *ts)
|
||||
{
|
||||
private_id_payload_t *this;
|
||||
u_int8_t mask;
|
||||
uint8_t mask;
|
||||
host_t *net;
|
||||
|
||||
this = (private_id_payload_t*)id_payload_create(PLV1_ID);
|
||||
@@ -419,7 +419,7 @@ id_payload_t *id_payload_create_from_ts(traffic_selector_t *ts)
|
||||
}
|
||||
else if (ts->to_subnet(ts, &net, &mask))
|
||||
{
|
||||
u_int8_t netmask[16], len, byte;
|
||||
uint8_t netmask[16], len, byte;
|
||||
|
||||
if (ts->get_type(ts) == TS_IPV4_ADDR_RANGE)
|
||||
{
|
||||
|
||||
@@ -37,31 +37,31 @@ struct private_ike_header_t {
|
||||
/**
|
||||
* SPI of the initiator.
|
||||
*/
|
||||
u_int64_t initiator_spi;
|
||||
uint64_t initiator_spi;
|
||||
|
||||
/**
|
||||
* SPI of the responder.
|
||||
*/
|
||||
u_int64_t responder_spi;
|
||||
uint64_t responder_spi;
|
||||
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
/**
|
||||
* IKE major version.
|
||||
*/
|
||||
u_int8_t maj_version;
|
||||
uint8_t maj_version;
|
||||
|
||||
/**
|
||||
* IKE minor version.
|
||||
*/
|
||||
u_int8_t min_version;
|
||||
uint8_t min_version;
|
||||
|
||||
/**
|
||||
* Exchange type .
|
||||
*/
|
||||
u_int8_t exchange_type;
|
||||
uint8_t exchange_type;
|
||||
|
||||
/**
|
||||
* Flags of the Message.
|
||||
@@ -106,12 +106,12 @@ struct private_ike_header_t {
|
||||
/**
|
||||
* Associated Message-ID.
|
||||
*/
|
||||
u_int32_t message_id;
|
||||
uint32_t message_id;
|
||||
|
||||
/**
|
||||
* Length of the whole IKEv2-Message (header and all payloads).
|
||||
*/
|
||||
u_int32_t length;
|
||||
uint32_t length;
|
||||
};
|
||||
|
||||
ENUM_BEGIN(exchange_type_names, ID_PROT, TRANSACTION,
|
||||
@@ -290,50 +290,50 @@ METHOD(payload_t, get_length, size_t,
|
||||
return this->length;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, get_initiator_spi, u_int64_t,
|
||||
METHOD(ike_header_t, get_initiator_spi, uint64_t,
|
||||
private_ike_header_t *this)
|
||||
{
|
||||
return this->initiator_spi;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, set_initiator_spi, void,
|
||||
private_ike_header_t *this, u_int64_t initiator_spi)
|
||||
private_ike_header_t *this, uint64_t initiator_spi)
|
||||
{
|
||||
this->initiator_spi = initiator_spi;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, get_responder_spi, u_int64_t,
|
||||
METHOD(ike_header_t, get_responder_spi, uint64_t,
|
||||
private_ike_header_t *this)
|
||||
{
|
||||
return this->responder_spi;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, set_responder_spi, void,
|
||||
private_ike_header_t *this, u_int64_t responder_spi)
|
||||
private_ike_header_t *this, uint64_t responder_spi)
|
||||
{
|
||||
this->responder_spi = responder_spi;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, get_maj_version, u_int8_t,
|
||||
METHOD(ike_header_t, get_maj_version, uint8_t,
|
||||
private_ike_header_t *this)
|
||||
{
|
||||
return this->maj_version;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, set_maj_version, void,
|
||||
private_ike_header_t *this, u_int8_t major)
|
||||
private_ike_header_t *this, uint8_t major)
|
||||
{
|
||||
this->maj_version = major;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, get_min_version, u_int8_t,
|
||||
METHOD(ike_header_t, get_min_version, uint8_t,
|
||||
private_ike_header_t *this)
|
||||
{
|
||||
return this->min_version;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, set_min_version, void,
|
||||
private_ike_header_t *this, u_int8_t minor)
|
||||
private_ike_header_t *this, uint8_t minor)
|
||||
{
|
||||
this->min_version = minor;
|
||||
}
|
||||
@@ -411,26 +411,26 @@ METHOD(ike_header_t, set_authonly_flag, void,
|
||||
this->flags.authonly = authonly;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, get_exchange_type, u_int8_t,
|
||||
METHOD(ike_header_t, get_exchange_type, uint8_t,
|
||||
private_ike_header_t *this)
|
||||
{
|
||||
return this->exchange_type;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, set_exchange_type, void,
|
||||
private_ike_header_t *this, u_int8_t exchange_type)
|
||||
private_ike_header_t *this, uint8_t exchange_type)
|
||||
{
|
||||
this->exchange_type = exchange_type;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, get_message_id, u_int32_t,
|
||||
METHOD(ike_header_t, get_message_id, uint32_t,
|
||||
private_ike_header_t *this)
|
||||
{
|
||||
return this->message_id;
|
||||
}
|
||||
|
||||
METHOD(ike_header_t, set_message_id, void,
|
||||
private_ike_header_t *this, u_int32_t message_id)
|
||||
private_ike_header_t *this, uint32_t message_id)
|
||||
{
|
||||
this->message_id = message_id;
|
||||
}
|
||||
|
||||
@@ -153,56 +153,56 @@ struct ike_header_t {
|
||||
*
|
||||
* @return initiator_spi
|
||||
*/
|
||||
u_int64_t (*get_initiator_spi) (ike_header_t *this);
|
||||
uint64_t (*get_initiator_spi) (ike_header_t *this);
|
||||
|
||||
/**
|
||||
* Set the initiator spi.
|
||||
*
|
||||
* @param initiator_spi initiator_spi
|
||||
*/
|
||||
void (*set_initiator_spi) (ike_header_t *this, u_int64_t initiator_spi);
|
||||
void (*set_initiator_spi) (ike_header_t *this, uint64_t initiator_spi);
|
||||
|
||||
/**
|
||||
* Get the responder spi.
|
||||
*
|
||||
* @return responder_spi
|
||||
*/
|
||||
u_int64_t (*get_responder_spi) (ike_header_t *this);
|
||||
uint64_t (*get_responder_spi) (ike_header_t *this);
|
||||
|
||||
/**
|
||||
* Set the responder spi.
|
||||
*
|
||||
* @param responder_spi responder_spi
|
||||
*/
|
||||
void (*set_responder_spi) (ike_header_t *this, u_int64_t responder_spi);
|
||||
void (*set_responder_spi) (ike_header_t *this, uint64_t responder_spi);
|
||||
|
||||
/**
|
||||
* Get the major version.
|
||||
*
|
||||
* @return major version
|
||||
*/
|
||||
u_int8_t (*get_maj_version) (ike_header_t *this);
|
||||
uint8_t (*get_maj_version) (ike_header_t *this);
|
||||
|
||||
/**
|
||||
* Set the major version.
|
||||
*
|
||||
* @param major major version
|
||||
*/
|
||||
void (*set_maj_version) (ike_header_t *this, u_int8_t major);
|
||||
void (*set_maj_version) (ike_header_t *this, uint8_t major);
|
||||
|
||||
/**
|
||||
* Get the minor version.
|
||||
*
|
||||
* @return minor version
|
||||
*/
|
||||
u_int8_t (*get_min_version) (ike_header_t *this);
|
||||
uint8_t (*get_min_version) (ike_header_t *this);
|
||||
|
||||
/**
|
||||
* Set the minor version.
|
||||
*
|
||||
* @param minor minor version
|
||||
*/
|
||||
void (*set_min_version) (ike_header_t *this, u_int8_t minor);
|
||||
void (*set_min_version) (ike_header_t *this, uint8_t minor);
|
||||
|
||||
/**
|
||||
* Get the response flag.
|
||||
@@ -293,28 +293,28 @@ struct ike_header_t {
|
||||
*
|
||||
* @return exchange type
|
||||
*/
|
||||
u_int8_t (*get_exchange_type) (ike_header_t *this);
|
||||
uint8_t (*get_exchange_type) (ike_header_t *this);
|
||||
|
||||
/**
|
||||
* Set the exchange type.
|
||||
*
|
||||
* @param exchange_type exchange type
|
||||
*/
|
||||
void (*set_exchange_type) (ike_header_t *this, u_int8_t exchange_type);
|
||||
void (*set_exchange_type) (ike_header_t *this, uint8_t exchange_type);
|
||||
|
||||
/**
|
||||
* Get the message id.
|
||||
*
|
||||
* @return message id
|
||||
*/
|
||||
u_int32_t (*get_message_id) (ike_header_t *this);
|
||||
uint32_t (*get_message_id) (ike_header_t *this);
|
||||
|
||||
/**
|
||||
* Set the message id.
|
||||
*
|
||||
* @param initiator_spi message id
|
||||
*/
|
||||
void (*set_message_id) (ike_header_t *this, u_int32_t message_id);
|
||||
void (*set_message_id) (ike_header_t *this, uint32_t message_id);
|
||||
|
||||
/**
|
||||
* Destroys a ike_header_t object.
|
||||
|
||||
@@ -36,7 +36,7 @@ struct private_ke_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -51,17 +51,17 @@ struct private_ke_payload_t {
|
||||
/**
|
||||
* Reserved bytes
|
||||
*/
|
||||
u_int8_t reserved_byte[2];
|
||||
uint8_t reserved_byte[2];
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* DH Group Number.
|
||||
*/
|
||||
u_int16_t dh_group_number;
|
||||
uint16_t dh_group_number;
|
||||
|
||||
/**
|
||||
* Key Exchange Data of this KE payload.
|
||||
|
||||
@@ -37,7 +37,7 @@ struct private_nonce_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -52,7 +52,7 @@ struct private_nonce_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* The contained nonce value.
|
||||
|
||||
@@ -260,7 +260,7 @@ struct private_notify_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -275,27 +275,27 @@ struct private_notify_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Domain of interpretation, IKEv1 only.
|
||||
*/
|
||||
u_int32_t doi;
|
||||
uint32_t doi;
|
||||
|
||||
/**
|
||||
* Protocol id.
|
||||
*/
|
||||
u_int8_t protocol_id;
|
||||
uint8_t protocol_id;
|
||||
|
||||
/**
|
||||
* Spi size.
|
||||
*/
|
||||
u_int8_t spi_size;
|
||||
uint8_t spi_size;
|
||||
|
||||
/**
|
||||
* Notify message type.
|
||||
*/
|
||||
u_int16_t notify_type;
|
||||
uint16_t notify_type;
|
||||
|
||||
/**
|
||||
* Security parameter index (spi).
|
||||
@@ -596,14 +596,14 @@ METHOD(payload_t, get_length, size_t,
|
||||
return this->payload_length;
|
||||
}
|
||||
|
||||
METHOD(notify_payload_t, get_protocol_id, u_int8_t,
|
||||
METHOD(notify_payload_t, get_protocol_id, uint8_t,
|
||||
private_notify_payload_t *this)
|
||||
{
|
||||
return this->protocol_id;
|
||||
}
|
||||
|
||||
METHOD(notify_payload_t, set_protocol_id, void,
|
||||
private_notify_payload_t *this, u_int8_t protocol_id)
|
||||
private_notify_payload_t *this, uint8_t protocol_id)
|
||||
{
|
||||
this->protocol_id = protocol_id;
|
||||
}
|
||||
@@ -620,7 +620,7 @@ METHOD(notify_payload_t, set_notify_type, void,
|
||||
this->notify_type = notify_type;
|
||||
}
|
||||
|
||||
METHOD(notify_payload_t, get_spi, u_int32_t,
|
||||
METHOD(notify_payload_t, get_spi, uint32_t,
|
||||
private_notify_payload_t *this)
|
||||
{
|
||||
switch (this->protocol_id)
|
||||
@@ -629,7 +629,7 @@ METHOD(notify_payload_t, get_spi, u_int32_t,
|
||||
case PROTO_ESP:
|
||||
if (this->spi.len == 4)
|
||||
{
|
||||
return *((u_int32_t*)this->spi.ptr);
|
||||
return *((uint32_t*)this->spi.ptr);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
@@ -638,7 +638,7 @@ METHOD(notify_payload_t, get_spi, u_int32_t,
|
||||
}
|
||||
|
||||
METHOD(notify_payload_t, set_spi, void,
|
||||
private_notify_payload_t *this, u_int32_t spi)
|
||||
private_notify_payload_t *this, uint32_t spi)
|
||||
{
|
||||
chunk_free(&this->spi);
|
||||
switch (this->protocol_id)
|
||||
@@ -646,7 +646,7 @@ METHOD(notify_payload_t, set_spi, void,
|
||||
case PROTO_AH:
|
||||
case PROTO_ESP:
|
||||
this->spi = chunk_alloc(4);
|
||||
*((u_int32_t*)this->spi.ptr) = spi;
|
||||
*((uint32_t*)this->spi.ptr) = spi;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -200,14 +200,14 @@ struct notify_payload_t {
|
||||
*
|
||||
* @return protocol id of this payload
|
||||
*/
|
||||
u_int8_t (*get_protocol_id) (notify_payload_t *this);
|
||||
uint8_t (*get_protocol_id) (notify_payload_t *this);
|
||||
|
||||
/**
|
||||
* Sets the protocol id of this payload.
|
||||
*
|
||||
* @param protocol_id protocol id to set
|
||||
*/
|
||||
void (*set_protocol_id) (notify_payload_t *this, u_int8_t protocol_id);
|
||||
void (*set_protocol_id) (notify_payload_t *this, uint8_t protocol_id);
|
||||
|
||||
/**
|
||||
* Gets the notify message type of this payload.
|
||||
@@ -230,7 +230,7 @@ struct notify_payload_t {
|
||||
*
|
||||
* @return SPI value
|
||||
*/
|
||||
u_int32_t (*get_spi) (notify_payload_t *this);
|
||||
uint32_t (*get_spi) (notify_payload_t *this);
|
||||
|
||||
/**
|
||||
* Sets the spi of this payload.
|
||||
@@ -239,7 +239,7 @@ struct notify_payload_t {
|
||||
*
|
||||
* @param spi SPI value
|
||||
*/
|
||||
void (*set_spi) (notify_payload_t *this, u_int32_t spi);
|
||||
void (*set_spi) (notify_payload_t *this, uint32_t spi);
|
||||
|
||||
/**
|
||||
* Returns the currently set spi of this payload.
|
||||
|
||||
@@ -268,7 +268,7 @@ payload_t *payload_create(payload_type_t type)
|
||||
/**
|
||||
* See header.
|
||||
*/
|
||||
bool payload_is_known(payload_type_t type, u_int8_t maj_ver)
|
||||
bool payload_is_known(payload_type_t type, uint8_t maj_ver)
|
||||
{
|
||||
if (type >= PL_HEADER)
|
||||
{
|
||||
|
||||
@@ -413,7 +413,7 @@ payload_t *payload_create(payload_type_t type);
|
||||
* @param maj_ver major IKE version (use 0 to skip version check)
|
||||
* @return FALSE if payload type handled as unknown payload
|
||||
*/
|
||||
bool payload_is_known(payload_type_t type, u_int8_t maj_ver);
|
||||
bool payload_is_known(payload_type_t type, uint8_t maj_ver);
|
||||
|
||||
/**
|
||||
* Get the value field in a payload using encoding rules.
|
||||
|
||||
@@ -45,37 +45,37 @@ struct private_proposal_substructure_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* reserved byte
|
||||
*/
|
||||
u_int8_t reserved;
|
||||
uint8_t reserved;
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t proposal_length;
|
||||
uint16_t proposal_length;
|
||||
|
||||
/**
|
||||
* Proposal number.
|
||||
*/
|
||||
u_int8_t proposal_number;
|
||||
uint8_t proposal_number;
|
||||
|
||||
/**
|
||||
* Protocol ID.
|
||||
*/
|
||||
u_int8_t protocol_id;
|
||||
uint8_t protocol_id;
|
||||
|
||||
/**
|
||||
* SPI size of the following SPI.
|
||||
*/
|
||||
u_int8_t spi_size;
|
||||
uint8_t spi_size;
|
||||
|
||||
/**
|
||||
* Number of transforms.
|
||||
*/
|
||||
u_int8_t transforms_count;
|
||||
uint8_t transforms_count;
|
||||
|
||||
/**
|
||||
* SPI is stored as chunk.
|
||||
@@ -479,24 +479,24 @@ METHOD(proposal_substructure_t, set_is_last_proposal, void,
|
||||
}
|
||||
|
||||
METHOD(proposal_substructure_t, set_proposal_number, void,
|
||||
private_proposal_substructure_t *this,u_int8_t proposal_number)
|
||||
private_proposal_substructure_t *this,uint8_t proposal_number)
|
||||
{
|
||||
this->proposal_number = proposal_number;
|
||||
}
|
||||
|
||||
METHOD(proposal_substructure_t, get_proposal_number, u_int8_t,
|
||||
METHOD(proposal_substructure_t, get_proposal_number, uint8_t,
|
||||
private_proposal_substructure_t *this)
|
||||
{
|
||||
return this->proposal_number;
|
||||
}
|
||||
|
||||
METHOD(proposal_substructure_t, set_protocol_id, void,
|
||||
private_proposal_substructure_t *this,u_int8_t protocol_id)
|
||||
private_proposal_substructure_t *this,uint8_t protocol_id)
|
||||
{
|
||||
this->protocol_id = protocol_id;
|
||||
}
|
||||
|
||||
METHOD(proposal_substructure_t, get_protocol_id, u_int8_t,
|
||||
METHOD(proposal_substructure_t, get_protocol_id, uint8_t,
|
||||
private_proposal_substructure_t *this)
|
||||
{
|
||||
return this->protocol_id;
|
||||
@@ -518,7 +518,7 @@ METHOD(proposal_substructure_t, get_spi, chunk_t,
|
||||
}
|
||||
|
||||
METHOD(proposal_substructure_t, get_cpi, bool,
|
||||
private_proposal_substructure_t *this, u_int16_t *cpi)
|
||||
private_proposal_substructure_t *this, uint16_t *cpi)
|
||||
{
|
||||
|
||||
transform_substructure_t *transform;
|
||||
@@ -554,7 +554,7 @@ static void add_to_proposal_v2(proposal_t *proposal,
|
||||
{
|
||||
transform_attribute_t *tattr;
|
||||
enumerator_t *enumerator;
|
||||
u_int16_t key_length = 0;
|
||||
uint16_t key_length = 0;
|
||||
|
||||
enumerator = transform->create_attribute_enumerator(transform);
|
||||
while (enumerator->enumerate(enumerator, &tattr))
|
||||
@@ -576,8 +576,8 @@ static void add_to_proposal_v2(proposal_t *proposal,
|
||||
* Map IKEv1 to IKEv2 algorithms
|
||||
*/
|
||||
typedef struct {
|
||||
u_int16_t ikev1;
|
||||
u_int16_t ikev2;
|
||||
uint16_t ikev1;
|
||||
uint16_t ikev2;
|
||||
} algo_map_t;
|
||||
|
||||
/**
|
||||
@@ -681,8 +681,8 @@ static algo_map_t map_auth[] = {
|
||||
/**
|
||||
* Map an IKEv1 to an IKEv2 identifier
|
||||
*/
|
||||
static u_int16_t ikev2_from_ikev1(algo_map_t *map, int count, u_int16_t def,
|
||||
u_int16_t value)
|
||||
static uint16_t ikev2_from_ikev1(algo_map_t *map, int count, uint16_t def,
|
||||
uint16_t value)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -699,7 +699,7 @@ static u_int16_t ikev2_from_ikev1(algo_map_t *map, int count, u_int16_t def,
|
||||
/**
|
||||
* Map an IKEv2 to an IKEv1 identifier
|
||||
*/
|
||||
static u_int16_t ikev1_from_ikev2(algo_map_t *map, int count, u_int16_t value)
|
||||
static uint16_t ikev1_from_ikev2(algo_map_t *map, int count, uint16_t value)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -716,7 +716,7 @@ static u_int16_t ikev1_from_ikev2(algo_map_t *map, int count, u_int16_t value)
|
||||
/**
|
||||
* Get IKEv2 algorithm from IKEv1 identifier
|
||||
*/
|
||||
static u_int16_t get_alg_from_ikev1(transform_type_t type, u_int16_t value)
|
||||
static uint16_t get_alg_from_ikev1(transform_type_t type, uint16_t value)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -737,7 +737,7 @@ static u_int16_t get_alg_from_ikev1(transform_type_t type, u_int16_t value)
|
||||
/**
|
||||
* Get IKEv1 algorithm from IKEv2 identifier
|
||||
*/
|
||||
static u_int16_t get_ikev1_from_alg(transform_type_t type, u_int16_t value)
|
||||
static uint16_t get_ikev1_from_alg(transform_type_t type, uint16_t value)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -755,8 +755,8 @@ static u_int16_t get_ikev1_from_alg(transform_type_t type, u_int16_t value)
|
||||
/**
|
||||
* Get IKEv2 algorithm from IKEv1 ESP/AH transform ID
|
||||
*/
|
||||
static u_int16_t get_alg_from_ikev1_transid(transform_type_t type,
|
||||
u_int16_t value)
|
||||
static uint16_t get_alg_from_ikev1_transid(transform_type_t type,
|
||||
uint16_t value)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -774,8 +774,8 @@ static u_int16_t get_alg_from_ikev1_transid(transform_type_t type,
|
||||
/**
|
||||
* Get IKEv1 ESP/AH transform ID from IKEv2 identifier
|
||||
*/
|
||||
static u_int16_t get_ikev1_transid_from_alg(transform_type_t type,
|
||||
u_int16_t value)
|
||||
static uint16_t get_ikev1_transid_from_alg(transform_type_t type,
|
||||
uint16_t value)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -791,7 +791,7 @@ static u_int16_t get_ikev1_transid_from_alg(transform_type_t type,
|
||||
/**
|
||||
* Get IKEv1 authentication algorithm from IKEv2 identifier
|
||||
*/
|
||||
static u_int16_t get_alg_from_ikev1_auth(u_int16_t value)
|
||||
static uint16_t get_alg_from_ikev1_auth(uint16_t value)
|
||||
{
|
||||
return ikev2_from_ikev1(map_auth, countof(map_auth), AUTH_UNDEFINED, value);
|
||||
}
|
||||
@@ -799,7 +799,7 @@ static u_int16_t get_alg_from_ikev1_auth(u_int16_t value)
|
||||
/**
|
||||
* Get IKEv1 authentication algorithm from IKEv2 identifier
|
||||
*/
|
||||
static u_int16_t get_ikev1_auth_from_alg(u_int16_t value)
|
||||
static uint16_t get_ikev1_auth_from_alg(uint16_t value)
|
||||
{
|
||||
return ikev1_from_ikev2(map_auth, countof(map_auth), value);
|
||||
}
|
||||
@@ -807,7 +807,7 @@ static u_int16_t get_ikev1_auth_from_alg(u_int16_t value)
|
||||
/**
|
||||
* Get IKEv1 authentication attribute from auth_method_t
|
||||
*/
|
||||
static u_int16_t get_ikev1_auth(auth_method_t method)
|
||||
static uint16_t get_ikev1_auth(auth_method_t method)
|
||||
{
|
||||
switch (method)
|
||||
{
|
||||
@@ -842,7 +842,7 @@ static u_int16_t get_ikev1_auth(auth_method_t method)
|
||||
/**
|
||||
* Get IKEv1 encapsulation mode
|
||||
*/
|
||||
static u_int16_t get_ikev1_mode(ipsec_mode_t mode, encap_t udp)
|
||||
static uint16_t get_ikev1_mode(ipsec_mode_t mode, encap_t udp)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
@@ -880,8 +880,8 @@ static void add_to_proposal_v1_ike(proposal_t *proposal,
|
||||
transform_attribute_type_t type;
|
||||
transform_attribute_t *tattr;
|
||||
enumerator_t *enumerator;
|
||||
u_int16_t value, key_length = 0;
|
||||
u_int16_t encr = ENCR_UNDEFINED;
|
||||
uint16_t value, key_length = 0;
|
||||
uint16_t encr = ENCR_UNDEFINED;
|
||||
|
||||
enumerator = transform->create_attribute_enumerator(transform);
|
||||
while (enumerator->enumerate(enumerator, &tattr))
|
||||
@@ -932,7 +932,7 @@ static void add_to_proposal_v1(proposal_t *proposal,
|
||||
transform_attribute_type_t type;
|
||||
transform_attribute_t *tattr;
|
||||
enumerator_t *enumerator;
|
||||
u_int16_t encr, value, key_length = 0;
|
||||
uint16_t encr, value, key_length = 0;
|
||||
|
||||
enumerator = transform->create_attribute_enumerator(transform);
|
||||
while (enumerator->enumerate(enumerator, &tattr))
|
||||
@@ -985,15 +985,15 @@ METHOD(proposal_substructure_t, get_proposals, void,
|
||||
transform_substructure_t *transform;
|
||||
enumerator_t *enumerator;
|
||||
proposal_t *proposal = NULL;
|
||||
u_int64_t spi = 0;
|
||||
uint64_t spi = 0;
|
||||
|
||||
switch (this->spi.len)
|
||||
{
|
||||
case 4:
|
||||
spi = *((u_int32_t*)this->spi.ptr);
|
||||
spi = *((uint32_t*)this->spi.ptr);
|
||||
break;
|
||||
case 8:
|
||||
spi = *((u_int64_t*)this->spi.ptr);
|
||||
spi = *((uint64_t*)this->spi.ptr);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1042,7 +1042,7 @@ METHOD(proposal_substructure_t, create_substructure_enumerator, enumerator_t*,
|
||||
/**
|
||||
* Get an attribute from any transform, 0 if not found
|
||||
*/
|
||||
static u_int64_t get_attr(private_proposal_substructure_t *this,
|
||||
static uint64_t get_attr(private_proposal_substructure_t *this,
|
||||
transform_attribute_type_t type)
|
||||
{
|
||||
enumerator_t *transforms, *attributes;
|
||||
@@ -1071,7 +1071,7 @@ static u_int64_t get_attr(private_proposal_substructure_t *this,
|
||||
/**
|
||||
* Look up a lifetime duration of a given kind in all transforms
|
||||
*/
|
||||
static u_int64_t get_life_duration(private_proposal_substructure_t *this,
|
||||
static uint64_t get_life_duration(private_proposal_substructure_t *this,
|
||||
transform_attribute_type_t type_attr, ikev1_life_type_t type,
|
||||
transform_attribute_type_t dur_attr)
|
||||
{
|
||||
@@ -1105,10 +1105,10 @@ static u_int64_t get_life_duration(private_proposal_substructure_t *this,
|
||||
return 0;
|
||||
}
|
||||
|
||||
METHOD(proposal_substructure_t, get_lifetime, u_int32_t,
|
||||
METHOD(proposal_substructure_t, get_lifetime, uint32_t,
|
||||
private_proposal_substructure_t *this)
|
||||
{
|
||||
u_int32_t duration;
|
||||
uint32_t duration;
|
||||
|
||||
switch (this->protocol_id)
|
||||
{
|
||||
@@ -1129,7 +1129,7 @@ METHOD(proposal_substructure_t, get_lifetime, u_int32_t,
|
||||
}
|
||||
}
|
||||
|
||||
METHOD(proposal_substructure_t, get_lifebytes, u_int64_t,
|
||||
METHOD(proposal_substructure_t, get_lifebytes, uint64_t,
|
||||
private_proposal_substructure_t *this)
|
||||
{
|
||||
switch (this->protocol_id)
|
||||
@@ -1259,11 +1259,11 @@ proposal_substructure_t *proposal_substructure_create(payload_type_t type)
|
||||
* Add an IKEv1 IKE proposal to the substructure
|
||||
*/
|
||||
static void set_from_proposal_v1_ike(private_proposal_substructure_t *this,
|
||||
proposal_t *proposal, u_int32_t lifetime,
|
||||
proposal_t *proposal, uint32_t lifetime,
|
||||
auth_method_t method, int number)
|
||||
{
|
||||
transform_substructure_t *transform;
|
||||
u_int16_t alg, key_size;
|
||||
uint16_t alg, key_size;
|
||||
enumerator_t *enumerator;
|
||||
|
||||
transform = transform_substructure_create_type(PLV1_TRANSFORM_SUBSTRUCTURE,
|
||||
@@ -1330,11 +1330,11 @@ static void set_from_proposal_v1_ike(private_proposal_substructure_t *this,
|
||||
* Add an IKEv1 ESP/AH proposal to the substructure
|
||||
*/
|
||||
static void set_from_proposal_v1(private_proposal_substructure_t *this,
|
||||
proposal_t *proposal, u_int32_t lifetime, u_int64_t lifebytes,
|
||||
proposal_t *proposal, uint32_t lifetime, uint64_t lifebytes,
|
||||
ipsec_mode_t mode, encap_t udp, int number)
|
||||
{
|
||||
transform_substructure_t *transform = NULL;
|
||||
u_int16_t alg, transid, key_size;
|
||||
uint16_t alg, transid, key_size;
|
||||
enumerator_t *enumerator;
|
||||
|
||||
enumerator = proposal->create_enumerator(proposal, ENCRYPTION_ALGORITHM);
|
||||
@@ -1420,7 +1420,7 @@ static void set_from_proposal_v2(private_proposal_substructure_t *this,
|
||||
proposal_t *proposal)
|
||||
{
|
||||
transform_substructure_t *transform;
|
||||
u_int16_t alg, key_size;
|
||||
uint16_t alg, key_size;
|
||||
enumerator_t *enumerator;
|
||||
|
||||
/* encryption algorithm is only available in ESP */
|
||||
@@ -1485,8 +1485,8 @@ static void set_from_proposal_v2(private_proposal_substructure_t *this,
|
||||
*/
|
||||
static void set_data(private_proposal_substructure_t *this, proposal_t *proposal)
|
||||
{
|
||||
u_int64_t spi64;
|
||||
u_int32_t spi32;
|
||||
uint64_t spi64;
|
||||
uint32_t spi32;
|
||||
|
||||
/* add SPI, if necessary */
|
||||
switch (proposal->get_protocol(proposal))
|
||||
@@ -1533,7 +1533,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v2(
|
||||
* See header.
|
||||
*/
|
||||
proposal_substructure_t *proposal_substructure_create_from_proposal_v1(
|
||||
proposal_t *proposal, u_int32_t lifetime, u_int64_t lifebytes,
|
||||
proposal_t *proposal, uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode, encap_t udp)
|
||||
{
|
||||
private_proposal_substructure_t *this;
|
||||
@@ -1562,7 +1562,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v1(
|
||||
* See header.
|
||||
*/
|
||||
proposal_substructure_t *proposal_substructure_create_from_proposals_v1(
|
||||
linked_list_t *proposals, u_int32_t lifetime, u_int64_t lifebytes,
|
||||
linked_list_t *proposals, uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode, encap_t udp)
|
||||
{
|
||||
private_proposal_substructure_t *this = NULL;
|
||||
@@ -1607,8 +1607,8 @@ proposal_substructure_t *proposal_substructure_create_from_proposals_v1(
|
||||
* See header.
|
||||
*/
|
||||
proposal_substructure_t *proposal_substructure_create_for_ipcomp_v1(
|
||||
u_int32_t lifetime, u_int64_t lifebytes, u_int16_t cpi,
|
||||
ipsec_mode_t mode, encap_t udp, u_int8_t proposal_number)
|
||||
uint32_t lifetime, uint64_t lifebytes, uint16_t cpi,
|
||||
ipsec_mode_t mode, encap_t udp, uint8_t proposal_number)
|
||||
{
|
||||
private_proposal_substructure_t *this;
|
||||
transform_substructure_t *transform;
|
||||
|
||||
@@ -59,13 +59,13 @@ struct proposal_substructure_t {
|
||||
* @param id proposal number to set
|
||||
*/
|
||||
void (*set_proposal_number) (proposal_substructure_t *this,
|
||||
u_int8_t proposal_number);
|
||||
uint8_t proposal_number);
|
||||
/**
|
||||
* get proposal number of current proposal.
|
||||
*
|
||||
* @return proposal number of current proposal substructure.
|
||||
*/
|
||||
u_int8_t (*get_proposal_number) (proposal_substructure_t *this);
|
||||
uint8_t (*get_proposal_number) (proposal_substructure_t *this);
|
||||
|
||||
/**
|
||||
* Sets the protocol id of current proposal.
|
||||
@@ -73,14 +73,14 @@ struct proposal_substructure_t {
|
||||
* @param id protocol id to set
|
||||
*/
|
||||
void (*set_protocol_id) (proposal_substructure_t *this,
|
||||
u_int8_t protocol_id);
|
||||
uint8_t protocol_id);
|
||||
|
||||
/**
|
||||
* get protocol id of current proposal.
|
||||
*
|
||||
* @return protocol id of current proposal substructure.
|
||||
*/
|
||||
u_int8_t (*get_protocol_id) (proposal_substructure_t *this);
|
||||
uint8_t (*get_protocol_id) (proposal_substructure_t *this);
|
||||
|
||||
/**
|
||||
* Sets the next_payload field of this substructure
|
||||
@@ -114,7 +114,7 @@ struct proposal_substructure_t {
|
||||
* @param cpi the CPI if a supported algorithm is proposed
|
||||
* @return TRUE if a supported algorithm is proposed
|
||||
*/
|
||||
bool (*get_cpi) (proposal_substructure_t *this, u_int16_t *cpi);
|
||||
bool (*get_cpi) (proposal_substructure_t *this, uint16_t *cpi);
|
||||
|
||||
/**
|
||||
* Get proposals contained in a propsal_substructure_t.
|
||||
@@ -135,14 +135,14 @@ struct proposal_substructure_t {
|
||||
*
|
||||
* @return lifetime, in seconds
|
||||
*/
|
||||
u_int32_t (*get_lifetime)(proposal_substructure_t *this);
|
||||
uint32_t (*get_lifetime)(proposal_substructure_t *this);
|
||||
|
||||
/**
|
||||
* Get the (shortest) life duration of a proposal (IKEv1 only).
|
||||
*
|
||||
* @return life duration, in bytes
|
||||
*/
|
||||
u_int64_t (*get_lifebytes)(proposal_substructure_t *this);
|
||||
uint64_t (*get_lifebytes)(proposal_substructure_t *this);
|
||||
|
||||
/**
|
||||
* Get the first authentication method from the proposal (IKEv1 only).
|
||||
@@ -193,7 +193,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v2(
|
||||
* @return proposal_substructure_t object PLV1_PROPOSAL_SUBSTRUCTURE
|
||||
*/
|
||||
proposal_substructure_t *proposal_substructure_create_from_proposal_v1(
|
||||
proposal_t *proposal, u_int32_t lifetime, u_int64_t lifebytes,
|
||||
proposal_t *proposal, uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode, encap_t udp);
|
||||
|
||||
/**
|
||||
@@ -208,7 +208,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposal_v1(
|
||||
* @return IKEv1 proposal_substructure_t PLV1_PROPOSAL_SUBSTRUCTURE
|
||||
*/
|
||||
proposal_substructure_t *proposal_substructure_create_from_proposals_v1(
|
||||
linked_list_t *proposals, u_int32_t lifetime, u_int64_t lifebytes,
|
||||
linked_list_t *proposals, uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode, encap_t udp);
|
||||
|
||||
/**
|
||||
@@ -224,7 +224,7 @@ proposal_substructure_t *proposal_substructure_create_from_proposals_v1(
|
||||
* @return IKEv1 proposal_substructure_t PLV1_PROPOSAL_SUBSTRUCTURE
|
||||
*/
|
||||
proposal_substructure_t *proposal_substructure_create_for_ipcomp_v1(
|
||||
u_int32_t lifetime, u_int64_t lifebytes, u_int16_t cpi,
|
||||
ipsec_mode_t mode, encap_t udp, u_int8_t proposal_number);
|
||||
uint32_t lifetime, uint64_t lifebytes, uint16_t cpi,
|
||||
ipsec_mode_t mode, encap_t udp, uint8_t proposal_number);
|
||||
|
||||
#endif /** PROPOSAL_SUBSTRUCTURE_H_ @}*/
|
||||
|
||||
@@ -41,7 +41,7 @@ struct private_sa_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -56,7 +56,7 @@ struct private_sa_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Proposals in this payload are stored in a linked_list_t.
|
||||
@@ -71,12 +71,12 @@ struct private_sa_payload_t {
|
||||
/**
|
||||
* IKEv1 DOI
|
||||
*/
|
||||
u_int32_t doi;
|
||||
uint32_t doi;
|
||||
|
||||
/**
|
||||
* IKEv1 situation
|
||||
*/
|
||||
u_int32_t situation;
|
||||
uint32_t situation;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -342,7 +342,7 @@ METHOD(sa_payload_t, get_proposals, linked_list_t*,
|
||||
}
|
||||
|
||||
METHOD(sa_payload_t, get_ipcomp_proposals, linked_list_t*,
|
||||
private_sa_payload_t *this, u_int16_t *cpi)
|
||||
private_sa_payload_t *this, uint16_t *cpi)
|
||||
{
|
||||
int current_proposal = -1, unsupported_proposal = -1;
|
||||
enumerator_t *enumerator;
|
||||
@@ -353,8 +353,8 @@ METHOD(sa_payload_t, get_ipcomp_proposals, linked_list_t*,
|
||||
enumerator = this->proposals->create_enumerator(this->proposals);
|
||||
while (enumerator->enumerate(enumerator, &substruct))
|
||||
{
|
||||
u_int8_t proposal_number = substruct->get_proposal_number(substruct);
|
||||
u_int8_t protocol_id = substruct->get_protocol_id(substruct);
|
||||
uint8_t proposal_number = substruct->get_proposal_number(substruct);
|
||||
uint8_t protocol_id = substruct->get_protocol_id(substruct);
|
||||
|
||||
if (proposal_number == unsupported_proposal)
|
||||
{
|
||||
@@ -403,12 +403,12 @@ METHOD(sa_payload_t, create_substructure_enumerator, enumerator_t*,
|
||||
return this->proposals->create_enumerator(this->proposals);
|
||||
}
|
||||
|
||||
METHOD(sa_payload_t, get_lifetime, u_int32_t,
|
||||
METHOD(sa_payload_t, get_lifetime, uint32_t,
|
||||
private_sa_payload_t *this)
|
||||
{
|
||||
proposal_substructure_t *substruct;
|
||||
enumerator_t *enumerator;
|
||||
u_int32_t lifetime = 0;
|
||||
uint32_t lifetime = 0;
|
||||
|
||||
enumerator = this->proposals->create_enumerator(this->proposals);
|
||||
if (enumerator->enumerate(enumerator, &substruct))
|
||||
@@ -420,12 +420,12 @@ METHOD(sa_payload_t, get_lifetime, u_int32_t,
|
||||
return lifetime;
|
||||
}
|
||||
|
||||
METHOD(sa_payload_t, get_lifebytes, u_int64_t,
|
||||
METHOD(sa_payload_t, get_lifebytes, uint64_t,
|
||||
private_sa_payload_t *this)
|
||||
{
|
||||
proposal_substructure_t *substruct;
|
||||
enumerator_t *enumerator;
|
||||
u_int64_t lifebytes = 0;
|
||||
uint64_t lifebytes = 0;
|
||||
|
||||
enumerator = this->proposals->create_enumerator(this->proposals);
|
||||
if (enumerator->enumerate(enumerator, &substruct))
|
||||
@@ -558,9 +558,9 @@ sa_payload_t *sa_payload_create_from_proposal_v2(proposal_t *proposal)
|
||||
* Described in header.
|
||||
*/
|
||||
sa_payload_t *sa_payload_create_from_proposals_v1(linked_list_t *proposals,
|
||||
u_int32_t lifetime, u_int64_t lifebytes,
|
||||
uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode,
|
||||
encap_t udp, u_int16_t cpi)
|
||||
encap_t udp, uint16_t cpi)
|
||||
{
|
||||
proposal_substructure_t *substruct;
|
||||
private_sa_payload_t *this;
|
||||
@@ -580,7 +580,7 @@ sa_payload_t *sa_payload_create_from_proposals_v1(linked_list_t *proposals,
|
||||
substruct->set_is_last_proposal(substruct, FALSE);
|
||||
if (cpi)
|
||||
{
|
||||
u_int8_t proposal_number = substruct->get_proposal_number(substruct);
|
||||
uint8_t proposal_number = substruct->get_proposal_number(substruct);
|
||||
|
||||
substruct = proposal_substructure_create_for_ipcomp_v1(lifetime,
|
||||
lifebytes, cpi, mode, udp, proposal_number);
|
||||
@@ -602,9 +602,9 @@ sa_payload_t *sa_payload_create_from_proposals_v1(linked_list_t *proposals,
|
||||
* Described in header.
|
||||
*/
|
||||
sa_payload_t *sa_payload_create_from_proposal_v1(proposal_t *proposal,
|
||||
u_int32_t lifetime, u_int64_t lifebytes,
|
||||
uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode,
|
||||
encap_t udp, u_int16_t cpi)
|
||||
encap_t udp, uint16_t cpi)
|
||||
{
|
||||
private_sa_payload_t *this;
|
||||
linked_list_t *proposals;
|
||||
|
||||
@@ -57,21 +57,21 @@ struct sa_payload_t {
|
||||
* @param cpi the CPI of the first IPComp (sub)proposal
|
||||
* @return a list containing proposal_ts
|
||||
*/
|
||||
linked_list_t *(*get_ipcomp_proposals) (sa_payload_t *this, u_int16_t *cpi);
|
||||
linked_list_t *(*get_ipcomp_proposals) (sa_payload_t *this, uint16_t *cpi);
|
||||
|
||||
/**
|
||||
* Get the (shortest) lifetime of a proposal (IKEv1 only).
|
||||
*
|
||||
* @return lifetime, in seconds
|
||||
*/
|
||||
u_int32_t (*get_lifetime)(sa_payload_t *this);
|
||||
uint32_t (*get_lifetime)(sa_payload_t *this);
|
||||
|
||||
/**
|
||||
* Get the (shortest) life duration of a proposal (IKEv1 only).
|
||||
*
|
||||
* @return life duration, in bytes
|
||||
*/
|
||||
u_int64_t (*get_lifebytes)(sa_payload_t *this);
|
||||
uint64_t (*get_lifebytes)(sa_payload_t *this);
|
||||
|
||||
/**
|
||||
* Get the first authentication method from the proposal (IKEv1 only).
|
||||
@@ -138,9 +138,9 @@ sa_payload_t *sa_payload_create_from_proposal_v2(proposal_t *proposal);
|
||||
* @return sa_payload_t object
|
||||
*/
|
||||
sa_payload_t *sa_payload_create_from_proposals_v1(linked_list_t *proposals,
|
||||
u_int32_t lifetime, u_int64_t lifebytes,
|
||||
uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode, encap_t udp,
|
||||
u_int16_t cpi);
|
||||
uint16_t cpi);
|
||||
|
||||
/**
|
||||
* Creates an IKEv1 sa_payload_t object from a single proposal.
|
||||
@@ -155,8 +155,8 @@ sa_payload_t *sa_payload_create_from_proposals_v1(linked_list_t *proposals,
|
||||
* @return sa_payload_t object
|
||||
*/
|
||||
sa_payload_t *sa_payload_create_from_proposal_v1(proposal_t *proposal,
|
||||
u_int32_t lifetime, u_int64_t lifebytes,
|
||||
uint32_t lifetime, uint64_t lifebytes,
|
||||
auth_method_t auth, ipsec_mode_t mode, encap_t udp,
|
||||
u_int16_t cpi);
|
||||
uint16_t cpi);
|
||||
|
||||
#endif /** SA_PAYLOAD_H_ @}*/
|
||||
|
||||
@@ -35,27 +35,27 @@ struct private_traffic_selector_substructure_t {
|
||||
/**
|
||||
* Type of traffic selector.
|
||||
*/
|
||||
u_int8_t ts_type;
|
||||
uint8_t ts_type;
|
||||
|
||||
/**
|
||||
* IP Protocol ID.
|
||||
*/
|
||||
u_int8_t ip_protocol_id;
|
||||
uint8_t ip_protocol_id;
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Start port number.
|
||||
*/
|
||||
u_int16_t start_port;
|
||||
uint16_t start_port;
|
||||
|
||||
/**
|
||||
* End port number.
|
||||
*/
|
||||
u_int16_t end_port;
|
||||
uint16_t end_port;
|
||||
|
||||
/**
|
||||
* Starting address.
|
||||
|
||||
@@ -62,7 +62,7 @@ struct traffic_selector_substructure_t {
|
||||
* @return type of traffic selector
|
||||
*
|
||||
*/
|
||||
u_int8_t (*get_protocol_id) (traffic_selector_substructure_t *this);
|
||||
uint8_t (*get_protocol_id) (traffic_selector_substructure_t *this);
|
||||
|
||||
/**
|
||||
* Set the IP protocol ID of Traffic selector
|
||||
@@ -70,7 +70,7 @@ struct traffic_selector_substructure_t {
|
||||
* @param protocol_id protocol ID of traffic selector
|
||||
*/
|
||||
void (*set_protocol_id) (traffic_selector_substructure_t *this,
|
||||
u_int8_t protocol_id);
|
||||
uint8_t protocol_id);
|
||||
|
||||
/**
|
||||
* Get the start port and address as host_t object.
|
||||
|
||||
@@ -85,12 +85,12 @@ struct private_transform_attribute_t {
|
||||
/**
|
||||
* Type of the attribute.
|
||||
*/
|
||||
u_int16_t attribute_type;
|
||||
uint16_t attribute_type;
|
||||
|
||||
/**
|
||||
* Attribute Length if attribute_format is 0, attribute Value otherwise.
|
||||
*/
|
||||
u_int16_t attribute_length_or_value;
|
||||
uint16_t attribute_length_or_value;
|
||||
|
||||
/**
|
||||
* Attribute value as chunk if attribute_format is 0 (FALSE).
|
||||
@@ -185,10 +185,10 @@ METHOD(transform_attribute_t, get_value_chunk, chunk_t,
|
||||
return this->attribute_value;
|
||||
}
|
||||
|
||||
METHOD(transform_attribute_t, get_value, u_int64_t,
|
||||
METHOD(transform_attribute_t, get_value, uint64_t,
|
||||
private_transform_attribute_t *this)
|
||||
{
|
||||
u_int64_t value = 0;
|
||||
uint64_t value = 0;
|
||||
|
||||
if (this->attribute_format)
|
||||
{
|
||||
@@ -203,7 +203,7 @@ METHOD(transform_attribute_t, get_value, u_int64_t,
|
||||
return untoh64((char*)&value);
|
||||
}
|
||||
|
||||
METHOD(transform_attribute_t, get_attribute_type, u_int16_t,
|
||||
METHOD(transform_attribute_t, get_attribute_type, uint16_t,
|
||||
private_transform_attribute_t *this)
|
||||
{
|
||||
return this->attribute_type;
|
||||
@@ -250,7 +250,7 @@ transform_attribute_t *transform_attribute_create(payload_type_t type)
|
||||
* Described in header.
|
||||
*/
|
||||
transform_attribute_t *transform_attribute_create_value(payload_type_t type,
|
||||
transform_attribute_type_t kind, u_int64_t value)
|
||||
transform_attribute_type_t kind, uint64_t value)
|
||||
{
|
||||
private_transform_attribute_t *this;
|
||||
|
||||
@@ -265,7 +265,7 @@ transform_attribute_t *transform_attribute_create_value(payload_type_t type,
|
||||
}
|
||||
else if (value <= UINT32_MAX)
|
||||
{
|
||||
u_int32_t val32;
|
||||
uint32_t val32;
|
||||
|
||||
val32 = htonl(value);
|
||||
this->attribute_value = chunk_clone(chunk_from_thing(val32));
|
||||
|
||||
@@ -109,14 +109,14 @@ struct transform_attribute_t {
|
||||
*
|
||||
* @return value
|
||||
*/
|
||||
u_int64_t (*get_value) (transform_attribute_t *this);
|
||||
uint64_t (*get_value) (transform_attribute_t *this);
|
||||
|
||||
/**
|
||||
* get the type of the attribute.
|
||||
*
|
||||
* @return type of the value
|
||||
*/
|
||||
u_int16_t (*get_attribute_type) (transform_attribute_t *this);
|
||||
uint16_t (*get_attribute_type) (transform_attribute_t *this);
|
||||
|
||||
/**
|
||||
* Destroys an transform_attribute_t object.
|
||||
@@ -141,6 +141,6 @@ transform_attribute_t *transform_attribute_create(payload_type_t type);
|
||||
* @return transform_attribute_t object
|
||||
*/
|
||||
transform_attribute_t *transform_attribute_create_value(payload_type_t type,
|
||||
transform_attribute_type_t kind, u_int64_t value);
|
||||
transform_attribute_type_t kind, uint64_t value);
|
||||
|
||||
#endif /** TRANSFORM_ATTRIBUTE_H_ @}*/
|
||||
|
||||
@@ -40,32 +40,32 @@ struct private_transform_substructure_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Reserved byte
|
||||
*/
|
||||
u_int8_t reserved[3];
|
||||
uint8_t reserved[3];
|
||||
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t transform_length;
|
||||
uint16_t transform_length;
|
||||
|
||||
/**
|
||||
* Type or number, Type of the transform in IKEv2, number in IKEv2.
|
||||
*/
|
||||
u_int8_t transform_ton;
|
||||
uint8_t transform_ton;
|
||||
|
||||
/**
|
||||
* Transform ID, as encoded in IKEv1.
|
||||
*/
|
||||
u_int8_t transform_id_v1;
|
||||
uint8_t transform_id_v1;
|
||||
|
||||
/**
|
||||
* Transform ID, as encoded in IKEv2.
|
||||
*/
|
||||
u_int16_t transform_id_v2;
|
||||
uint16_t transform_id_v2;
|
||||
|
||||
/**
|
||||
* Transforms Attributes are stored in a linked_list_t.
|
||||
@@ -235,13 +235,13 @@ METHOD(payload_t, set_next_type, void,
|
||||
{
|
||||
}
|
||||
|
||||
METHOD(transform_substructure_t, get_transform_type_or_number, u_int8_t,
|
||||
METHOD(transform_substructure_t, get_transform_type_or_number, uint8_t,
|
||||
private_transform_substructure_t *this)
|
||||
{
|
||||
return this->transform_ton;
|
||||
}
|
||||
|
||||
METHOD(transform_substructure_t, get_transform_id, u_int16_t,
|
||||
METHOD(transform_substructure_t, get_transform_id, uint16_t,
|
||||
private_transform_substructure_t *this)
|
||||
{
|
||||
if (this->type == PLV2_TRANSFORM_SUBSTRUCTURE)
|
||||
@@ -303,7 +303,7 @@ transform_substructure_t *transform_substructure_create(payload_type_t type)
|
||||
* Described in header
|
||||
*/
|
||||
transform_substructure_t *transform_substructure_create_type(payload_type_t type,
|
||||
u_int8_t type_or_number, u_int16_t id)
|
||||
uint8_t type_or_number, uint16_t id)
|
||||
{
|
||||
private_transform_substructure_t *this;
|
||||
|
||||
|
||||
@@ -72,14 +72,14 @@ struct transform_substructure_t {
|
||||
*
|
||||
* @return Transform type of current transform substructure.
|
||||
*/
|
||||
u_int8_t (*get_transform_type_or_number) (transform_substructure_t *this);
|
||||
uint8_t (*get_transform_type_or_number) (transform_substructure_t *this);
|
||||
|
||||
/**
|
||||
* Get transform id of the current transform.
|
||||
*
|
||||
* @return Transform id of current transform substructure.
|
||||
*/
|
||||
u_int16_t (*get_transform_id) (transform_substructure_t *this);
|
||||
uint16_t (*get_transform_id) (transform_substructure_t *this);
|
||||
|
||||
/**
|
||||
* Create an enumerator over transform attributes.
|
||||
@@ -111,6 +111,6 @@ transform_substructure_t *transform_substructure_create(payload_type_t type);
|
||||
* @return transform_substructure_t object
|
||||
*/
|
||||
transform_substructure_t *transform_substructure_create_type(payload_type_t type,
|
||||
u_int8_t type_or_number, u_int16_t id);
|
||||
uint8_t type_or_number, uint16_t id);
|
||||
|
||||
#endif /** TRANSFORM_SUBSTRUCTURE_H_ @}*/
|
||||
|
||||
@@ -42,7 +42,7 @@ struct private_ts_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -62,12 +62,12 @@ struct private_ts_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* Number of traffic selectors
|
||||
*/
|
||||
u_int8_t ts_num;
|
||||
uint8_t ts_num;
|
||||
|
||||
/**
|
||||
* Contains the traffic selectors of type traffic_selector_substructure_t.
|
||||
|
||||
@@ -39,7 +39,7 @@ struct private_unknown_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -54,7 +54,7 @@ struct private_unknown_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* The contained data.
|
||||
|
||||
@@ -34,7 +34,7 @@ struct private_vendor_id_payload_t {
|
||||
/**
|
||||
* Next payload type.
|
||||
*/
|
||||
u_int8_t next_payload;
|
||||
uint8_t next_payload;
|
||||
|
||||
/**
|
||||
* Critical flag.
|
||||
@@ -49,7 +49,7 @@ struct private_vendor_id_payload_t {
|
||||
/**
|
||||
* Length of this payload.
|
||||
*/
|
||||
u_int16_t payload_length;
|
||||
uint16_t payload_length;
|
||||
|
||||
/**
|
||||
* The contained data.
|
||||
|
||||
@@ -39,7 +39,7 @@ struct private_kernel_handler_t {
|
||||
/**
|
||||
* convert an IP protocol identifier to the IKEv2 specific protocol identifier.
|
||||
*/
|
||||
static inline protocol_id_t proto_ip2ike(u_int8_t protocol)
|
||||
static inline protocol_id_t proto_ip2ike(uint8_t protocol)
|
||||
{
|
||||
switch (protocol)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ static inline protocol_id_t proto_ip2ike(u_int8_t protocol)
|
||||
}
|
||||
|
||||
METHOD(kernel_listener_t, acquire, bool,
|
||||
private_kernel_handler_t *this, u_int32_t reqid,
|
||||
private_kernel_handler_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts)
|
||||
{
|
||||
if (src_ts && dst_ts)
|
||||
@@ -71,7 +71,7 @@ METHOD(kernel_listener_t, acquire, bool,
|
||||
}
|
||||
|
||||
METHOD(kernel_listener_t, expire, bool,
|
||||
private_kernel_handler_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
private_kernel_handler_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, bool hard)
|
||||
{
|
||||
protocol_id_t proto = proto_ip2ike(protocol);
|
||||
@@ -93,7 +93,7 @@ METHOD(kernel_listener_t, expire, bool,
|
||||
}
|
||||
|
||||
METHOD(kernel_listener_t, mapping, bool,
|
||||
private_kernel_handler_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
private_kernel_handler_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, host_t *remote)
|
||||
{
|
||||
protocol_id_t proto = proto_ip2ike(protocol);
|
||||
@@ -108,7 +108,7 @@ METHOD(kernel_listener_t, mapping, bool,
|
||||
}
|
||||
|
||||
METHOD(kernel_listener_t, migrate, bool,
|
||||
private_kernel_handler_t *this, u_int32_t reqid,
|
||||
private_kernel_handler_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts,
|
||||
policy_dir_t direction, host_t *local, host_t *remote)
|
||||
{
|
||||
|
||||
@@ -62,12 +62,12 @@ struct kernel_algorithm_t {
|
||||
/**
|
||||
* Identifier specified in IKE
|
||||
*/
|
||||
u_int16_t ike;
|
||||
uint16_t ike;
|
||||
|
||||
/**
|
||||
* Identifier as defined in pfkeyv2.h
|
||||
*/
|
||||
u_int16_t kernel;
|
||||
uint16_t kernel;
|
||||
|
||||
/**
|
||||
* Name of the algorithm in linux crypto API
|
||||
@@ -166,7 +166,7 @@ METHOD(kernel_interface_t, get_features, kernel_feature_t,
|
||||
|
||||
METHOD(kernel_interface_t, get_spi, status_t,
|
||||
private_kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int8_t protocol, u_int32_t *spi)
|
||||
uint8_t protocol, uint32_t *spi)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
{
|
||||
@@ -177,7 +177,7 @@ METHOD(kernel_interface_t, get_spi, status_t,
|
||||
|
||||
METHOD(kernel_interface_t, get_cpi, status_t,
|
||||
private_kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int16_t *cpi)
|
||||
uint16_t *cpi)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
{
|
||||
@@ -191,7 +191,7 @@ METHOD(kernel_interface_t, get_cpi, status_t,
|
||||
*/
|
||||
typedef struct {
|
||||
/** allocated reqid */
|
||||
u_int32_t reqid;
|
||||
uint32_t reqid;
|
||||
/** references to this entry */
|
||||
u_int refs;
|
||||
/** inbound mark used for SA */
|
||||
@@ -327,9 +327,9 @@ static array_t *array_from_ts_list(linked_list_t *list)
|
||||
METHOD(kernel_interface_t, alloc_reqid, status_t,
|
||||
private_kernel_interface_t *this,
|
||||
linked_list_t *local_ts, linked_list_t *remote_ts,
|
||||
mark_t mark_in, mark_t mark_out, u_int32_t *reqid)
|
||||
mark_t mark_in, mark_t mark_out, uint32_t *reqid)
|
||||
{
|
||||
static u_int32_t counter = 0;
|
||||
static uint32_t counter = 0;
|
||||
reqid_entry_t *entry = NULL, *tmpl;
|
||||
status_t status = SUCCESS;
|
||||
|
||||
@@ -379,7 +379,7 @@ METHOD(kernel_interface_t, alloc_reqid, status_t,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, release_reqid, status_t,
|
||||
private_kernel_interface_t *this, u_int32_t reqid,
|
||||
private_kernel_interface_t *this, uint32_t reqid,
|
||||
mark_t mark_in, mark_t mark_out)
|
||||
{
|
||||
reqid_entry_t *entry, tmpl = {
|
||||
@@ -416,10 +416,10 @@ METHOD(kernel_interface_t, release_reqid, status_t,
|
||||
|
||||
METHOD(kernel_interface_t, add_sa, status_t,
|
||||
private_kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, u_int8_t protocol, u_int32_t reqid, mark_t mark,
|
||||
u_int32_t tfc, lifetime_cfg_t *lifetime, u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key, ipsec_mode_t mode,
|
||||
u_int16_t ipcomp, u_int16_t cpi, u_int32_t replay_window,
|
||||
uint32_t spi, uint8_t protocol, uint32_t reqid, mark_t mark,
|
||||
uint32_t tfc, lifetime_cfg_t *lifetime, uint16_t enc_alg, chunk_t enc_key,
|
||||
uint16_t int_alg, chunk_t int_key, ipsec_mode_t mode,
|
||||
uint16_t ipcomp, uint16_t cpi, uint32_t replay_window,
|
||||
bool initiator, bool encap, bool esn, bool inbound, bool update,
|
||||
linked_list_t *src_ts, linked_list_t *dst_ts)
|
||||
{
|
||||
@@ -434,8 +434,8 @@ METHOD(kernel_interface_t, add_sa, status_t,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, update_sa, status_t,
|
||||
private_kernel_interface_t *this, u_int32_t spi, u_int8_t protocol,
|
||||
u_int16_t cpi, host_t *src, host_t *dst, host_t *new_src, host_t *new_dst,
|
||||
private_kernel_interface_t *this, uint32_t spi, uint8_t protocol,
|
||||
uint16_t cpi, host_t *src, host_t *dst, host_t *new_src, host_t *new_dst,
|
||||
bool encap, bool new_encap, mark_t mark)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
@@ -448,8 +448,8 @@ METHOD(kernel_interface_t, update_sa, status_t,
|
||||
|
||||
METHOD(kernel_interface_t, query_sa, status_t,
|
||||
private_kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, u_int8_t protocol, mark_t mark,
|
||||
u_int64_t *bytes, u_int64_t *packets, time_t *time)
|
||||
uint32_t spi, uint8_t protocol, mark_t mark,
|
||||
uint64_t *bytes, uint64_t *packets, time_t *time)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
{
|
||||
@@ -460,8 +460,8 @@ METHOD(kernel_interface_t, query_sa, status_t,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, del_sa, status_t,
|
||||
private_kernel_interface_t *this, host_t *src, host_t *dst, u_int32_t spi,
|
||||
u_int8_t protocol, u_int16_t cpi, mark_t mark)
|
||||
private_kernel_interface_t *this, host_t *src, host_t *dst, uint32_t spi,
|
||||
uint8_t protocol, uint16_t cpi, mark_t mark)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
{
|
||||
@@ -594,7 +594,7 @@ METHOD(kernel_interface_t, del_ip, status_t,
|
||||
|
||||
METHOD(kernel_interface_t, add_route, status_t,
|
||||
private_kernel_interface_t *this, chunk_t dst_net,
|
||||
u_int8_t prefixlen, host_t *gateway, host_t *src_ip, char *if_name)
|
||||
uint8_t prefixlen, host_t *gateway, host_t *src_ip, char *if_name)
|
||||
{
|
||||
if (!this->net)
|
||||
{
|
||||
@@ -606,7 +606,7 @@ METHOD(kernel_interface_t, add_route, status_t,
|
||||
|
||||
METHOD(kernel_interface_t, del_route, status_t,
|
||||
private_kernel_interface_t *this, chunk_t dst_net,
|
||||
u_int8_t prefixlen, host_t *gateway, host_t *src_ip, char *if_name)
|
||||
uint8_t prefixlen, host_t *gateway, host_t *src_ip, char *if_name)
|
||||
{
|
||||
if (!this->net)
|
||||
{
|
||||
@@ -627,7 +627,7 @@ METHOD(kernel_interface_t, bypass_socket, bool,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, enable_udp_decap, bool,
|
||||
private_kernel_interface_t *this, int fd, int family, u_int16_t port)
|
||||
private_kernel_interface_t *this, int fd, int family, uint16_t port)
|
||||
{
|
||||
if (!this->ipsec)
|
||||
{
|
||||
@@ -803,7 +803,7 @@ METHOD(kernel_interface_t, remove_listener, void,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, acquire, void,
|
||||
private_kernel_interface_t *this, u_int32_t reqid,
|
||||
private_kernel_interface_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts)
|
||||
{
|
||||
kernel_listener_t *listener;
|
||||
@@ -823,7 +823,7 @@ METHOD(kernel_interface_t, acquire, void,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, expire, void,
|
||||
private_kernel_interface_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
private_kernel_interface_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, bool hard)
|
||||
{
|
||||
kernel_listener_t *listener;
|
||||
@@ -844,7 +844,7 @@ METHOD(kernel_interface_t, expire, void,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, mapping, void,
|
||||
private_kernel_interface_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
private_kernel_interface_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, host_t *remote)
|
||||
{
|
||||
kernel_listener_t *listener;
|
||||
@@ -865,7 +865,7 @@ METHOD(kernel_interface_t, mapping, void,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, migrate, void,
|
||||
private_kernel_interface_t *this, u_int32_t reqid,
|
||||
private_kernel_interface_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts,
|
||||
policy_dir_t direction, host_t *local, host_t *remote)
|
||||
{
|
||||
@@ -919,8 +919,8 @@ METHOD(kernel_interface_t, tun, void,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, register_algorithm, void,
|
||||
private_kernel_interface_t *this, u_int16_t alg_id, transform_type_t type,
|
||||
u_int16_t kernel_id, char *kernel_name)
|
||||
private_kernel_interface_t *this, uint16_t alg_id, transform_type_t type,
|
||||
uint16_t kernel_id, char *kernel_name)
|
||||
{
|
||||
kernel_algorithm_t *algorithm;
|
||||
|
||||
@@ -937,8 +937,8 @@ METHOD(kernel_interface_t, register_algorithm, void,
|
||||
}
|
||||
|
||||
METHOD(kernel_interface_t, lookup_algorithm, bool,
|
||||
private_kernel_interface_t *this, u_int16_t alg_id, transform_type_t type,
|
||||
u_int16_t *kernel_id, char **kernel_name)
|
||||
private_kernel_interface_t *this, uint16_t alg_id, transform_type_t type,
|
||||
uint16_t *kernel_id, char **kernel_name)
|
||||
{
|
||||
kernel_algorithm_t *algorithm;
|
||||
enumerator_t *enumerator;
|
||||
|
||||
@@ -108,7 +108,7 @@ struct kernel_interface_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*get_spi)(kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int8_t protocol, u_int32_t *spi);
|
||||
uint8_t protocol, uint32_t *spi);
|
||||
|
||||
/**
|
||||
* Get a Compression Parameter Index (CPI) from the kernel.
|
||||
@@ -119,7 +119,7 @@ struct kernel_interface_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*get_cpi)(kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int16_t *cpi);
|
||||
uint16_t *cpi);
|
||||
|
||||
/**
|
||||
* Allocate or confirm a reqid to use for a given SA pair.
|
||||
@@ -141,7 +141,7 @@ struct kernel_interface_t {
|
||||
status_t (*alloc_reqid)(kernel_interface_t *this,
|
||||
linked_list_t *local_ts, linked_list_t *remote_ts,
|
||||
mark_t mark_in, mark_t mark_out,
|
||||
u_int32_t *reqid);
|
||||
uint32_t *reqid);
|
||||
|
||||
/**
|
||||
* Release a previously allocated reqid.
|
||||
@@ -151,7 +151,7 @@ struct kernel_interface_t {
|
||||
* @param mark_out outbound mark on SA
|
||||
* @return SUCCESS if reqid released
|
||||
*/
|
||||
status_t (*release_reqid)(kernel_interface_t *this, u_int32_t reqid,
|
||||
status_t (*release_reqid)(kernel_interface_t *this, uint32_t reqid,
|
||||
mark_t mark_in, mark_t mark_out);
|
||||
|
||||
/**
|
||||
@@ -186,13 +186,13 @@ struct kernel_interface_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*add_sa) (kernel_interface_t *this,
|
||||
host_t *src, host_t *dst, u_int32_t spi,
|
||||
u_int8_t protocol, u_int32_t reqid, mark_t mark,
|
||||
u_int32_t tfc, lifetime_cfg_t *lifetime,
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
|
||||
u_int32_t replay_window, bool initiator, bool encap,
|
||||
host_t *src, host_t *dst, uint32_t spi,
|
||||
uint8_t protocol, uint32_t reqid, mark_t mark,
|
||||
uint32_t tfc, lifetime_cfg_t *lifetime,
|
||||
uint16_t enc_alg, chunk_t enc_key,
|
||||
uint16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, uint16_t ipcomp, uint16_t cpi,
|
||||
uint32_t replay_window, bool initiator, bool encap,
|
||||
bool esn, bool inbound, bool update,
|
||||
linked_list_t *src_ts, linked_list_t *dst_ts);
|
||||
|
||||
@@ -218,7 +218,7 @@ struct kernel_interface_t {
|
||||
* the kernel interface can't update the SA
|
||||
*/
|
||||
status_t (*update_sa)(kernel_interface_t *this,
|
||||
u_int32_t spi, u_int8_t protocol, u_int16_t cpi,
|
||||
uint32_t spi, uint8_t protocol, uint16_t cpi,
|
||||
host_t *src, host_t *dst,
|
||||
host_t *new_src, host_t *new_dst,
|
||||
bool encap, bool new_encap, mark_t mark);
|
||||
@@ -237,8 +237,8 @@ struct kernel_interface_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*query_sa) (kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, u_int8_t protocol, mark_t mark,
|
||||
u_int64_t *bytes, u_int64_t *packets, time_t *time);
|
||||
uint32_t spi, uint8_t protocol, mark_t mark,
|
||||
uint64_t *bytes, uint64_t *packets, time_t *time);
|
||||
|
||||
/**
|
||||
* Delete a previously installed SA from the SAD.
|
||||
@@ -252,7 +252,7 @@ struct kernel_interface_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*del_sa) (kernel_interface_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, u_int8_t protocol, u_int16_t cpi,
|
||||
uint32_t spi, uint8_t protocol, uint16_t cpi,
|
||||
mark_t mark);
|
||||
|
||||
/**
|
||||
@@ -426,7 +426,7 @@ struct kernel_interface_t {
|
||||
* ALREADY_DONE if the route already exists
|
||||
*/
|
||||
status_t (*add_route) (kernel_interface_t *this, chunk_t dst_net,
|
||||
u_int8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
uint8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
char *if_name);
|
||||
|
||||
/**
|
||||
@@ -440,7 +440,7 @@ struct kernel_interface_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*del_route) (kernel_interface_t *this, chunk_t dst_net,
|
||||
u_int8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
uint8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
char *if_name);
|
||||
|
||||
/**
|
||||
@@ -461,7 +461,7 @@ struct kernel_interface_t {
|
||||
* @return TRUE if UDP decapsulation was enabled successfully
|
||||
*/
|
||||
bool (*enable_udp_decap)(kernel_interface_t *this, int fd, int family,
|
||||
u_int16_t port);
|
||||
uint16_t port);
|
||||
|
||||
|
||||
/**
|
||||
@@ -561,7 +561,7 @@ struct kernel_interface_t {
|
||||
* @param src_ts source traffic selector
|
||||
* @param dst_ts destination traffic selector
|
||||
*/
|
||||
void (*acquire)(kernel_interface_t *this, u_int32_t reqid,
|
||||
void (*acquire)(kernel_interface_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts);
|
||||
|
||||
/**
|
||||
@@ -572,7 +572,7 @@ struct kernel_interface_t {
|
||||
* @param dst destination address of expired SA
|
||||
* @param hard TRUE if it is a hard expire, FALSE otherwise
|
||||
*/
|
||||
void (*expire)(kernel_interface_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
void (*expire)(kernel_interface_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, bool hard);
|
||||
|
||||
/**
|
||||
@@ -583,7 +583,7 @@ struct kernel_interface_t {
|
||||
* @param dst original destination address of SA
|
||||
* @param remote new remote host
|
||||
*/
|
||||
void (*mapping)(kernel_interface_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
void (*mapping)(kernel_interface_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, host_t *remote);
|
||||
|
||||
/**
|
||||
@@ -596,7 +596,7 @@ struct kernel_interface_t {
|
||||
* @param local local host address to be used in the IKE_SA
|
||||
* @param remote remote host address to be used in the IKE_SA
|
||||
*/
|
||||
void (*migrate)(kernel_interface_t *this, u_int32_t reqid,
|
||||
void (*migrate)(kernel_interface_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts,
|
||||
policy_dir_t direction, host_t *local, host_t *remote);
|
||||
|
||||
@@ -623,8 +623,8 @@ struct kernel_interface_t {
|
||||
* @param kernel_id the kernel id of the algorithm
|
||||
* @param kernel_name the kernel name of the algorithm
|
||||
*/
|
||||
void (*register_algorithm)(kernel_interface_t *this, u_int16_t alg_id,
|
||||
transform_type_t type, u_int16_t kernel_id,
|
||||
void (*register_algorithm)(kernel_interface_t *this, uint16_t alg_id,
|
||||
transform_type_t type, uint16_t kernel_id,
|
||||
char *kernel_name);
|
||||
|
||||
/**
|
||||
@@ -637,8 +637,8 @@ struct kernel_interface_t {
|
||||
* @param kernel_name the kernel name of the algorithm (optional)
|
||||
* @return TRUE if algorithm was found
|
||||
*/
|
||||
bool (*lookup_algorithm)(kernel_interface_t *this, u_int16_t alg_id,
|
||||
transform_type_t type, u_int16_t *kernel_id,
|
||||
bool (*lookup_algorithm)(kernel_interface_t *this, uint16_t alg_id,
|
||||
transform_type_t type, uint16_t *kernel_id,
|
||||
char **kernel_name);
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,7 @@ struct kernel_ipsec_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*get_spi)(kernel_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int8_t protocol, u_int32_t *spi);
|
||||
uint8_t protocol, uint32_t *spi);
|
||||
|
||||
/**
|
||||
* Get a Compression Parameter Index (CPI) from the kernel.
|
||||
@@ -73,7 +73,7 @@ struct kernel_ipsec_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*get_cpi)(kernel_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int16_t *cpi);
|
||||
uint16_t *cpi);
|
||||
|
||||
/**
|
||||
* Add an SA to the SAD.
|
||||
@@ -107,13 +107,13 @@ struct kernel_ipsec_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*add_sa) (kernel_ipsec_t *this,
|
||||
host_t *src, host_t *dst, u_int32_t spi,
|
||||
u_int8_t protocol, u_int32_t reqid,
|
||||
mark_t mark, u_int32_t tfc, lifetime_cfg_t *lifetime,
|
||||
u_int16_t enc_alg, chunk_t enc_key,
|
||||
u_int16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, u_int16_t ipcomp, u_int16_t cpi,
|
||||
u_int32_t replay_window, bool initiator, bool encap,
|
||||
host_t *src, host_t *dst, uint32_t spi,
|
||||
uint8_t protocol, uint32_t reqid,
|
||||
mark_t mark, uint32_t tfc, lifetime_cfg_t *lifetime,
|
||||
uint16_t enc_alg, chunk_t enc_key,
|
||||
uint16_t int_alg, chunk_t int_key,
|
||||
ipsec_mode_t mode, uint16_t ipcomp, uint16_t cpi,
|
||||
uint32_t replay_window, bool initiator, bool encap,
|
||||
bool esn, bool inbound, bool update,
|
||||
linked_list_t *src_ts, linked_list_t *dst_ts);
|
||||
|
||||
@@ -139,7 +139,7 @@ struct kernel_ipsec_t {
|
||||
* the kernel interface can't update the SA
|
||||
*/
|
||||
status_t (*update_sa)(kernel_ipsec_t *this,
|
||||
u_int32_t spi, u_int8_t protocol, u_int16_t cpi,
|
||||
uint32_t spi, uint8_t protocol, uint16_t cpi,
|
||||
host_t *src, host_t *dst,
|
||||
host_t *new_src, host_t *new_dst,
|
||||
bool encap, bool new_encap, mark_t mark);
|
||||
@@ -158,8 +158,8 @@ struct kernel_ipsec_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*query_sa) (kernel_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, u_int8_t protocol, mark_t mark,
|
||||
u_int64_t *bytes, u_int64_t *packets, time_t *time);
|
||||
uint32_t spi, uint8_t protocol, mark_t mark,
|
||||
uint64_t *bytes, uint64_t *packets, time_t *time);
|
||||
|
||||
/**
|
||||
* Delete a previusly installed SA from the SAD.
|
||||
@@ -173,7 +173,7 @@ struct kernel_ipsec_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*del_sa) (kernel_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, u_int8_t protocol, u_int16_t cpi,
|
||||
uint32_t spi, uint8_t protocol, uint16_t cpi,
|
||||
mark_t mark);
|
||||
|
||||
/**
|
||||
@@ -272,7 +272,7 @@ struct kernel_ipsec_t {
|
||||
* @return TRUE if UDP decapsulation was enabled successfully
|
||||
*/
|
||||
bool (*enable_udp_decap)(kernel_ipsec_t *this, int fd, int family,
|
||||
u_int16_t port);
|
||||
uint16_t port);
|
||||
|
||||
/**
|
||||
* Destroy the implementation.
|
||||
|
||||
@@ -43,7 +43,7 @@ struct kernel_listener_t {
|
||||
* @param dst_ts destination traffic selector
|
||||
* @return TRUE to remain registered, FALSE to unregister
|
||||
*/
|
||||
bool (*acquire)(kernel_listener_t *this, u_int32_t reqid,
|
||||
bool (*acquire)(kernel_listener_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts);
|
||||
|
||||
/**
|
||||
@@ -55,7 +55,7 @@ struct kernel_listener_t {
|
||||
* @param hard TRUE if it is a hard expire, FALSE otherwise
|
||||
* @return TRUE to remain registered, FALSE to unregister
|
||||
*/
|
||||
bool (*expire)(kernel_listener_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
bool (*expire)(kernel_listener_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, bool hard);
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ struct kernel_listener_t {
|
||||
* @param remote new remote host
|
||||
* @return TRUE to remain registered, FALSE to unregister
|
||||
*/
|
||||
bool (*mapping)(kernel_listener_t *this, u_int8_t protocol, u_int32_t spi,
|
||||
bool (*mapping)(kernel_listener_t *this, uint8_t protocol, uint32_t spi,
|
||||
host_t *dst, host_t *remote);
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ struct kernel_listener_t {
|
||||
* @param remote remote host address to be used in the IKE_SA
|
||||
* @return TRUE to remain registered, FALSE to unregister
|
||||
*/
|
||||
bool (*migrate)(kernel_listener_t *this, u_int32_t reqid,
|
||||
bool (*migrate)(kernel_listener_t *this, uint32_t reqid,
|
||||
traffic_selector_t *src_ts, traffic_selector_t *dst_ts,
|
||||
policy_dir_t direction, host_t *local, host_t *remote);
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ struct kernel_net_t {
|
||||
* ALREADY_DONE if the route already exists
|
||||
*/
|
||||
status_t (*add_route) (kernel_net_t *this, chunk_t dst_net,
|
||||
u_int8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
uint8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
char *if_name);
|
||||
|
||||
/**
|
||||
@@ -170,7 +170,7 @@ struct kernel_net_t {
|
||||
* @return SUCCESS if operation completed
|
||||
*/
|
||||
status_t (*del_route) (kernel_net_t *this, chunk_t dst_net,
|
||||
u_int8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
uint8_t prefixlen, host_t *gateway, host_t *src_ip,
|
||||
char *if_name);
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,17 +81,17 @@ struct private_receiver_t {
|
||||
/**
|
||||
* how many times we have used "secret" so far
|
||||
*/
|
||||
u_int32_t secret_used;
|
||||
uint32_t secret_used;
|
||||
|
||||
/**
|
||||
* time we did the cookie switch
|
||||
*/
|
||||
u_int32_t secret_switch;
|
||||
uint32_t secret_switch;
|
||||
|
||||
/**
|
||||
* time offset to use, hides our system time
|
||||
*/
|
||||
u_int32_t secret_offset;
|
||||
uint32_t secret_offset;
|
||||
|
||||
/**
|
||||
* the RNG to use for secret generation
|
||||
@@ -106,7 +106,7 @@ struct private_receiver_t {
|
||||
/**
|
||||
* require cookies after this many half open IKE_SAs
|
||||
*/
|
||||
u_int32_t cookie_threshold;
|
||||
uint32_t cookie_threshold;
|
||||
|
||||
/**
|
||||
* timestamp of last cookie requested
|
||||
@@ -116,7 +116,7 @@ struct private_receiver_t {
|
||||
/**
|
||||
* how many half open IKE_SAs per peer before blocking
|
||||
*/
|
||||
u_int32_t block_threshold;
|
||||
uint32_t block_threshold;
|
||||
|
||||
/**
|
||||
* Drop IKE_SA_INIT requests if processor job load exceeds this limit
|
||||
@@ -192,9 +192,9 @@ static void send_notify(message_t *request, int major, exchange_type_t exchange,
|
||||
* build a cookie
|
||||
*/
|
||||
static bool cookie_build(private_receiver_t *this, message_t *message,
|
||||
u_int32_t t, chunk_t secret, chunk_t *cookie)
|
||||
uint32_t t, chunk_t secret, chunk_t *cookie)
|
||||
{
|
||||
u_int64_t spi = message->get_initiator_spi(message);
|
||||
uint64_t spi = message->get_initiator_spi(message);
|
||||
host_t *ip = message->get_source(message);
|
||||
chunk_t input, hash;
|
||||
|
||||
@@ -216,14 +216,14 @@ static bool cookie_build(private_receiver_t *this, message_t *message,
|
||||
static bool cookie_verify(private_receiver_t *this, message_t *message,
|
||||
chunk_t cookie)
|
||||
{
|
||||
u_int32_t t, now;
|
||||
uint32_t t, now;
|
||||
chunk_t reference;
|
||||
chunk_t secret;
|
||||
|
||||
now = time_monotonic(NULL);
|
||||
t = *(u_int32_t*)cookie.ptr;
|
||||
t = *(uint32_t*)cookie.ptr;
|
||||
|
||||
if (cookie.len != sizeof(u_int32_t) +
|
||||
if (cookie.len != sizeof(uint32_t) +
|
||||
this->hasher->get_hash_size(this->hasher) ||
|
||||
t < now - this->secret_offset - COOKIE_LIFETIME)
|
||||
{
|
||||
@@ -269,15 +269,15 @@ static bool check_cookie(private_receiver_t *this, message_t *message)
|
||||
data = message->get_packet_data(message);
|
||||
if (data.len <
|
||||
IKE_HEADER_LENGTH + NOTIFY_PAYLOAD_HEADER_LENGTH +
|
||||
sizeof(u_int32_t) + this->hasher->get_hash_size(this->hasher) ||
|
||||
sizeof(uint32_t) + this->hasher->get_hash_size(this->hasher) ||
|
||||
*(data.ptr + 16) != PLV2_NOTIFY ||
|
||||
*(u_int16_t*)(data.ptr + IKE_HEADER_LENGTH + 6) != htons(COOKIE))
|
||||
*(uint16_t*)(data.ptr + IKE_HEADER_LENGTH + 6) != htons(COOKIE))
|
||||
{
|
||||
/* no cookie found */
|
||||
return FALSE;
|
||||
}
|
||||
data.ptr += IKE_HEADER_LENGTH + NOTIFY_PAYLOAD_HEADER_LENGTH;
|
||||
data.len = sizeof(u_int32_t) + this->hasher->get_hash_size(this->hasher);
|
||||
data.len = sizeof(uint32_t) + this->hasher->get_hash_size(this->hasher);
|
||||
if (!cookie_verify(this, message, data))
|
||||
{
|
||||
DBG2(DBG_NET, "found cookie, but content invalid");
|
||||
@@ -290,7 +290,7 @@ static bool check_cookie(private_receiver_t *this, message_t *message)
|
||||
* Check if we currently require cookies
|
||||
*/
|
||||
static bool cookie_required(private_receiver_t *this,
|
||||
u_int half_open, u_int32_t now)
|
||||
u_int half_open, uint32_t now)
|
||||
{
|
||||
if (this->cookie_threshold && half_open >= this->cookie_threshold)
|
||||
{
|
||||
@@ -322,7 +322,7 @@ static bool cookie_required(private_receiver_t *this,
|
||||
static bool drop_ike_sa_init(private_receiver_t *this, message_t *message)
|
||||
{
|
||||
u_int half_open, half_open_r;
|
||||
u_int32_t now;
|
||||
uint32_t now;
|
||||
|
||||
now = time_monotonic(NULL);
|
||||
half_open = charon->ike_sa_manager->get_half_open_count(
|
||||
@@ -620,7 +620,7 @@ METHOD(receiver_t, destroy, void,
|
||||
receiver_t *receiver_create()
|
||||
{
|
||||
private_receiver_t *this;
|
||||
u_int32_t now = time_monotonic(NULL);
|
||||
uint32_t now = time_monotonic(NULL);
|
||||
|
||||
INIT(this,
|
||||
.public = {
|
||||
|
||||
@@ -99,7 +99,7 @@ struct socket_t {
|
||||
* @param nat_t TRUE to get the port used to float in case of NAT-T
|
||||
* @return the port
|
||||
*/
|
||||
u_int16_t (*get_port)(socket_t *this, bool nat_t);
|
||||
uint16_t (*get_port)(socket_t *this, bool nat_t);
|
||||
|
||||
/**
|
||||
* Get the address families this socket is listening on.
|
||||
|
||||
@@ -89,10 +89,10 @@ METHOD(socket_manager_t, sender, status_t,
|
||||
return status;
|
||||
}
|
||||
|
||||
METHOD(socket_manager_t, get_port, u_int16_t,
|
||||
METHOD(socket_manager_t, get_port, uint16_t,
|
||||
private_socket_manager_t *this, bool nat_t)
|
||||
{
|
||||
u_int16_t port = 0;
|
||||
uint16_t port = 0;
|
||||
this->lock->read_lock(this->lock);
|
||||
if (this->socket)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ struct socket_manager_t {
|
||||
* @param nat_t TRUE to get the port used to float in case of NAT-T
|
||||
* @return the port, or 0, if no socket is registered
|
||||
*/
|
||||
u_int16_t (*get_port)(socket_manager_t *this, bool nat_t);
|
||||
uint16_t (*get_port)(socket_manager_t *this, bool nat_t);
|
||||
|
||||
/**
|
||||
* Get the address families the registered socket is listening on.
|
||||
|
||||
@@ -272,10 +272,10 @@ static void load_entries(private_attr_provider_t *this)
|
||||
{
|
||||
if (family == AF_INET)
|
||||
{ /* IPv4 attributes contain a subnet mask */
|
||||
u_int32_t netmask = 0;
|
||||
uint32_t netmask = 0;
|
||||
|
||||
if (mask)
|
||||
{ /* shifting u_int32_t by 32 or more is undefined */
|
||||
{ /* shifting uint32_t by 32 or more is undefined */
|
||||
mask = 32 - mask;
|
||||
netmask = htonl((0xFFFFFFFF >> mask) << mask);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ struct private_connmark_listener_t {
|
||||
static bool ts2in(traffic_selector_t *ts,
|
||||
struct in_addr *addr, struct in_addr *mask)
|
||||
{
|
||||
u_int8_t bits;
|
||||
uint8_t bits;
|
||||
host_t *net;
|
||||
|
||||
if (ts->get_type(ts) == TS_IPV4_ADDR_RANGE &&
|
||||
@@ -120,15 +120,15 @@ static bool manage_rule(struct iptc_handle *ipth, const char *chain,
|
||||
*/
|
||||
static bool manage_pre_esp_in_udp(private_connmark_listener_t *this,
|
||||
struct iptc_handle *ipth, bool add,
|
||||
u_int mark, u_int32_t spi,
|
||||
u_int mark, uint32_t spi,
|
||||
host_t *dst, host_t *src)
|
||||
{
|
||||
u_int16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
uint16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
XT_ALIGN(sizeof(struct xt_udp));
|
||||
u_int16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
u_int16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
uint16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
uint16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
XT_ALIGN(sizeof(struct xt_mark_tginfo2));
|
||||
u_int16_t entry_size = target_offset + target_size;
|
||||
uint16_t entry_size = target_offset + target_size;
|
||||
u_char ipt[entry_size], *pos = ipt;
|
||||
struct ipt_entry *e;
|
||||
|
||||
@@ -178,15 +178,15 @@ static bool manage_pre_esp_in_udp(private_connmark_listener_t *this,
|
||||
*/
|
||||
static bool manage_pre_esp(private_connmark_listener_t *this,
|
||||
struct iptc_handle *ipth, bool add,
|
||||
u_int mark, u_int32_t spi,
|
||||
u_int mark, uint32_t spi,
|
||||
host_t *dst, host_t *src)
|
||||
{
|
||||
u_int16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
uint16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
XT_ALIGN(sizeof(struct xt_esp));
|
||||
u_int16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
u_int16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
uint16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
uint16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
XT_ALIGN(sizeof(struct xt_mark_tginfo2));
|
||||
u_int16_t entry_size = target_offset + target_size;
|
||||
uint16_t entry_size = target_offset + target_size;
|
||||
u_char ipt[entry_size], *pos = ipt;
|
||||
struct ipt_entry *e;
|
||||
|
||||
@@ -235,7 +235,7 @@ static bool manage_pre_esp(private_connmark_listener_t *this,
|
||||
*/
|
||||
static bool manage_pre(private_connmark_listener_t *this,
|
||||
struct iptc_handle *ipth, bool add,
|
||||
u_int mark, u_int32_t spi, bool encap,
|
||||
u_int mark, uint32_t spi, bool encap,
|
||||
host_t *dst, host_t *src)
|
||||
{
|
||||
if (encap)
|
||||
@@ -250,15 +250,15 @@ static bool manage_pre(private_connmark_listener_t *this,
|
||||
*/
|
||||
static bool manage_in(private_connmark_listener_t *this,
|
||||
struct iptc_handle *ipth, bool add,
|
||||
u_int mark, u_int32_t spi,
|
||||
u_int mark, uint32_t spi,
|
||||
traffic_selector_t *dst, traffic_selector_t *src)
|
||||
{
|
||||
u_int16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
uint16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
XT_ALIGN(sizeof(struct xt_policy_info));
|
||||
u_int16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
u_int16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
uint16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
uint16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
XT_ALIGN(sizeof(struct xt_connmark_tginfo1));
|
||||
u_int16_t entry_size = target_offset + target_size;
|
||||
uint16_t entry_size = target_offset + target_size;
|
||||
u_char ipt[entry_size], *pos = ipt;
|
||||
struct ipt_entry *e;
|
||||
|
||||
@@ -316,12 +316,12 @@ static bool manage_out(private_connmark_listener_t *this,
|
||||
struct iptc_handle *ipth, bool add,
|
||||
traffic_selector_t *dst, traffic_selector_t *src)
|
||||
{
|
||||
u_int16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
uint16_t match_size = XT_ALIGN(sizeof(struct ipt_entry_match)) +
|
||||
XT_ALIGN(sizeof(struct xt_mark_mtinfo1));
|
||||
u_int16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
u_int16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
uint16_t target_offset = XT_ALIGN(sizeof(struct ipt_entry)) + match_size;
|
||||
uint16_t target_size = XT_ALIGN(sizeof(struct ipt_entry_target)) +
|
||||
XT_ALIGN(sizeof(struct xt_connmark_tginfo1));
|
||||
u_int16_t entry_size = target_offset + target_size;
|
||||
uint16_t entry_size = target_offset + target_size;
|
||||
u_char ipt[entry_size], *pos = ipt;
|
||||
struct ipt_entry *e;
|
||||
|
||||
@@ -402,7 +402,7 @@ static bool manage_policies(private_connmark_listener_t *this,
|
||||
{
|
||||
traffic_selector_t *local, *remote;
|
||||
enumerator_t *enumerator;
|
||||
u_int32_t spi;
|
||||
uint32_t spi;
|
||||
u_int mark;
|
||||
bool done = TRUE;
|
||||
|
||||
|
||||
@@ -151,8 +151,8 @@ typedef enum {
|
||||
* DHCP option encoding, a TLV
|
||||
*/
|
||||
typedef struct __attribute__((packed)) {
|
||||
u_int8_t type;
|
||||
u_int8_t len;
|
||||
uint8_t type;
|
||||
uint8_t len;
|
||||
char data[];
|
||||
} dhcp_option_t;
|
||||
|
||||
@@ -160,22 +160,22 @@ typedef struct __attribute__((packed)) {
|
||||
* DHCP message format, with a maximum size options buffer
|
||||
*/
|
||||
typedef struct __attribute__((packed)) {
|
||||
u_int8_t opcode;
|
||||
u_int8_t hw_type;
|
||||
u_int8_t hw_addr_len;
|
||||
u_int8_t hop_count;
|
||||
u_int32_t transaction_id;
|
||||
u_int16_t number_of_seconds;
|
||||
u_int16_t flags;
|
||||
u_int32_t client_address;
|
||||
u_int32_t your_address;
|
||||
u_int32_t server_address;
|
||||
u_int32_t gateway_address;
|
||||
uint8_t opcode;
|
||||
uint8_t hw_type;
|
||||
uint8_t hw_addr_len;
|
||||
uint8_t hop_count;
|
||||
uint32_t transaction_id;
|
||||
uint16_t number_of_seconds;
|
||||
uint16_t flags;
|
||||
uint32_t client_address;
|
||||
uint32_t your_address;
|
||||
uint32_t server_address;
|
||||
uint32_t gateway_address;
|
||||
char client_hw_addr[6];
|
||||
char client_hw_padding[10];
|
||||
char server_hostname[64];
|
||||
char boot_filename[128];
|
||||
u_int32_t magic_cookie;
|
||||
uint32_t magic_cookie;
|
||||
char options[252];
|
||||
} dhcp_t;
|
||||
|
||||
@@ -191,7 +191,7 @@ static int prepare_dhcp(private_dhcp_socket_t *this,
|
||||
dhcp_option_t *option;
|
||||
int optlen = 0;
|
||||
host_t *src;
|
||||
u_int32_t id;
|
||||
uint32_t id;
|
||||
|
||||
memset(dhcp, 0, sizeof(*dhcp));
|
||||
dhcp->opcode = BOOTREQUEST;
|
||||
@@ -366,10 +366,10 @@ METHOD(dhcp_socket_t, enroll, dhcp_transaction_t*,
|
||||
private_dhcp_socket_t *this, identification_t *identity)
|
||||
{
|
||||
dhcp_transaction_t *transaction;
|
||||
u_int32_t id;
|
||||
uint32_t id;
|
||||
int try;
|
||||
|
||||
if (!this->rng->get_bytes(this->rng, sizeof(id), (u_int8_t*)&id))
|
||||
if (!this->rng->get_bytes(this->rng, sizeof(id), (uint8_t*)&id))
|
||||
{
|
||||
DBG1(DBG_CFG, "DHCP DISCOVER failed, no transaction ID");
|
||||
return NULL;
|
||||
|
||||
@@ -32,7 +32,7 @@ struct private_dhcp_transaction_t {
|
||||
/**
|
||||
* DHCP transaction ID
|
||||
*/
|
||||
u_int32_t id;
|
||||
uint32_t id;
|
||||
|
||||
/**
|
||||
* Peer identity
|
||||
@@ -63,7 +63,7 @@ typedef struct {
|
||||
chunk_t data;
|
||||
} attribute_entry_t;
|
||||
|
||||
METHOD(dhcp_transaction_t, get_id, u_int32_t,
|
||||
METHOD(dhcp_transaction_t, get_id, uint32_t,
|
||||
private_dhcp_transaction_t *this)
|
||||
{
|
||||
return this->id;
|
||||
@@ -157,7 +157,7 @@ METHOD(dhcp_transaction_t, destroy, void,
|
||||
/**
|
||||
* See header
|
||||
*/
|
||||
dhcp_transaction_t *dhcp_transaction_create(u_int32_t id,
|
||||
dhcp_transaction_t *dhcp_transaction_create(uint32_t id,
|
||||
identification_t *identity)
|
||||
{
|
||||
private_dhcp_transaction_t *this;
|
||||
|
||||
@@ -37,7 +37,7 @@ struct dhcp_transaction_t {
|
||||
*
|
||||
* @return DHCP transaction identifier
|
||||
*/
|
||||
u_int32_t (*get_id)(dhcp_transaction_t *this);
|
||||
uint32_t (*get_id)(dhcp_transaction_t *this);
|
||||
|
||||
/**
|
||||
* Get the peer identity this transaction is used for.
|
||||
@@ -103,7 +103,7 @@ struct dhcp_transaction_t {
|
||||
* @param identity peer identity this transaction is used for
|
||||
* @return transaction instance
|
||||
*/
|
||||
dhcp_transaction_t *dhcp_transaction_create(u_int32_t id,
|
||||
dhcp_transaction_t *dhcp_transaction_create(uint32_t id,
|
||||
identification_t *identity);
|
||||
|
||||
#endif /** DHCP_TRANSACTION_H_ @}*/
|
||||
|
||||
@@ -41,17 +41,17 @@ struct private_dnscert_t {
|
||||
/**
|
||||
* Certificate type
|
||||
*/
|
||||
u_int16_t cert_type;
|
||||
uint16_t cert_type;
|
||||
|
||||
/**
|
||||
* Key tag
|
||||
*/
|
||||
u_int16_t key_tag;
|
||||
uint16_t key_tag;
|
||||
|
||||
/**
|
||||
* Algorithm
|
||||
*/
|
||||
u_int8_t algorithm;
|
||||
uint8_t algorithm;
|
||||
|
||||
/**
|
||||
* Certificate
|
||||
@@ -65,7 +65,7 @@ METHOD(dnscert_t, get_cert_type, dnscert_type_t,
|
||||
return this->cert_type;
|
||||
}
|
||||
|
||||
METHOD(dnscert_t, get_key_tag, u_int16_t,
|
||||
METHOD(dnscert_t, get_key_tag, uint16_t,
|
||||
private_dnscert_t *this)
|
||||
{
|
||||
return this->key_tag;
|
||||
|
||||
@@ -119,7 +119,7 @@ struct dnscert_t {
|
||||
*
|
||||
* @return keytag
|
||||
*/
|
||||
u_int16_t (*get_key_tag)(dnscert_t *this);
|
||||
uint16_t (*get_key_tag)(dnscert_t *this);
|
||||
|
||||
/**
|
||||
* Get the algorithm.
|
||||
|
||||
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
char buf[128];
|
||||
int fd, len;
|
||||
u_int16_t msglen;
|
||||
uint16_t msglen;
|
||||
|
||||
fd = make_connection();
|
||||
if (fd < 0)
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct duplicheck_msg_t duplicheck_msg_t;
|
||||
*/
|
||||
struct duplicheck_msg_t {
|
||||
/** length of the identity following, in network order (excluding len). */
|
||||
u_int16_t len;
|
||||
uint16_t len;
|
||||
/** identity string, not null terminated */
|
||||
char identity[];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
@@ -75,7 +75,7 @@ METHOD(duplicheck_notify_t, send_, void,
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
stream_t *stream;
|
||||
u_int16_t nlen;
|
||||
uint16_t nlen;
|
||||
char buf[512];
|
||||
int len;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ struct private_eap_aka_peer_t {
|
||||
/**
|
||||
* EAP message identifier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
|
||||
/**
|
||||
* MSK
|
||||
@@ -77,7 +77,7 @@ struct private_eap_aka_peer_t {
|
||||
/**
|
||||
* Counter value if reauthentication is used
|
||||
*/
|
||||
u_int16_t counter;
|
||||
uint16_t counter;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -105,7 +105,7 @@ static bool create_client_error(private_eap_aka_peer_t *this,
|
||||
eap_payload_t **out)
|
||||
{
|
||||
simaka_message_t *message;
|
||||
u_int16_t encoded;
|
||||
uint16_t encoded;
|
||||
|
||||
DBG1(DBG_IKE, "sending client error '%N'",
|
||||
simaka_client_error_names, AKA_UNABLE_TO_PROCESS);
|
||||
@@ -347,7 +347,7 @@ static status_t process_challenge(private_eap_aka_peer_t *this,
|
||||
*/
|
||||
static bool counter_too_small(private_eap_aka_peer_t *this, chunk_t chunk)
|
||||
{
|
||||
u_int16_t counter;
|
||||
uint16_t counter;
|
||||
|
||||
memcpy(&counter, chunk.ptr, sizeof(counter));
|
||||
counter = htons(counter);
|
||||
@@ -483,7 +483,7 @@ static status_t process_notification(private_eap_aka_peer_t *this,
|
||||
{
|
||||
if (type == AT_NOTIFICATION)
|
||||
{
|
||||
u_int16_t code;
|
||||
uint16_t code;
|
||||
|
||||
memcpy(&code, data.ptr, sizeof(code));
|
||||
code = ntohs(code);
|
||||
@@ -594,7 +594,7 @@ METHOD(eap_method_t, initiate, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_aka_peer_t *this, u_int32_t *vendor)
|
||||
private_eap_aka_peer_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = 0;
|
||||
return EAP_AKA;
|
||||
@@ -611,14 +611,14 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_aka_peer_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_aka_peer_t *this, u_int8_t identifier)
|
||||
private_eap_aka_peer_t *this, uint8_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ struct private_eap_aka_server_t {
|
||||
/**
|
||||
* EAP message identifier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
|
||||
/**
|
||||
* Expected Result XRES
|
||||
@@ -238,7 +238,7 @@ static status_t challenge(private_eap_aka_server_t *this, eap_payload_t **out)
|
||||
* Initiate EAP-AKA/Request/Re-authentication message
|
||||
*/
|
||||
static status_t reauthenticate(private_eap_aka_server_t *this,
|
||||
char mk[HASH_SIZE_SHA1], u_int16_t counter,
|
||||
char mk[HASH_SIZE_SHA1], uint16_t counter,
|
||||
eap_payload_t **out)
|
||||
{
|
||||
simaka_message_t *message;
|
||||
@@ -341,7 +341,7 @@ static status_t process_identity(private_eap_aka_server_t *this,
|
||||
if (this->use_reauth)
|
||||
{
|
||||
char mk[HASH_SIZE_SHA1];
|
||||
u_int16_t counter;
|
||||
uint16_t counter;
|
||||
|
||||
permanent = this->mgr->provider_is_reauth(this->mgr, id, mk, &counter);
|
||||
if (permanent)
|
||||
@@ -564,7 +564,7 @@ static status_t process_client_error(private_eap_aka_server_t *this,
|
||||
{
|
||||
if (type == AT_CLIENT_ERROR_CODE)
|
||||
{
|
||||
u_int16_t code;
|
||||
uint16_t code;
|
||||
|
||||
memcpy(&code, data.ptr, sizeof(code));
|
||||
DBG1(DBG_IKE, "received EAP-AKA client error '%N'",
|
||||
@@ -637,7 +637,7 @@ METHOD(eap_method_t, process, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_aka_server_t *this, u_int32_t *vendor)
|
||||
private_eap_aka_server_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = 0;
|
||||
return EAP_AKA;
|
||||
@@ -654,14 +654,14 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_aka_server_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_aka_server_t *this, u_int8_t identifier)
|
||||
private_eap_aka_server_t *this, uint8_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ static chunk_t fmk = chunk_from_chars(0x41, 0x48, 0x41, 0x47);
|
||||
/**
|
||||
* Binary represnation of the polynom T^160 + T^5 + T^3 + T^2 + 1
|
||||
*/
|
||||
static u_int8_t g[] = {
|
||||
static uint8_t g[] = {
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2d
|
||||
@@ -63,7 +63,7 @@ static u_int8_t g[] = {
|
||||
/**
|
||||
* Predefined random bits from the RAND Corporation book
|
||||
*/
|
||||
static u_int8_t a[] = {
|
||||
static uint8_t a[] = {
|
||||
0x9d, 0xe9, 0xc9, 0xc8, 0xef, 0xd5, 0x78, 0x11,
|
||||
0x48, 0x23, 0x14, 0x01, 0x90, 0x1f, 0x2d, 0x49,
|
||||
0x3f, 0x4c, 0x63, 0x65
|
||||
@@ -72,7 +72,7 @@ static u_int8_t a[] = {
|
||||
/**
|
||||
* Predefined random bits from the RAND Corporation book
|
||||
*/
|
||||
static u_int8_t b[] = {
|
||||
static uint8_t b[] = {
|
||||
0x75, 0xef, 0xd1, 0x5c, 0x4b, 0x8f, 0x8f, 0x51,
|
||||
0x4e, 0xf3, 0xbc, 0xc3, 0x79, 0x4a, 0x76, 0x5e,
|
||||
0x7e, 0xec, 0x45, 0xe0
|
||||
@@ -171,7 +171,7 @@ static void mpz_mod_poly(mpz_t r, mpz_t a, mpz_t b)
|
||||
* XOR the key into the SHA1 IV
|
||||
*/
|
||||
static bool step3(prf_t *prf, u_char k[AKA_K_LEN],
|
||||
u_char payload[AKA_PAYLOAD_LEN], u_int8_t h[HASH_SIZE_SHA1])
|
||||
u_char payload[AKA_PAYLOAD_LEN], uint8_t h[HASH_SIZE_SHA1])
|
||||
{
|
||||
/* use the keyed hasher to build the hash */
|
||||
return prf->set_key(prf, chunk_create(k, AKA_K_LEN)) &&
|
||||
@@ -243,7 +243,7 @@ static bool fx(prf_t *prf, u_char f, u_char k[AKA_K_LEN],
|
||||
/**
|
||||
* Calculation function of f1() and f1star()
|
||||
*/
|
||||
static bool f1x(prf_t *prf, u_int8_t f, u_char k[AKA_K_LEN],
|
||||
static bool f1x(prf_t *prf, uint8_t f, u_char k[AKA_K_LEN],
|
||||
u_char rand[AKA_RAND_LEN], u_char sqn[AKA_SQN_LEN],
|
||||
u_char amf[AKA_AMF_LEN], u_char mac[AKA_MAC_LEN])
|
||||
{
|
||||
|
||||
@@ -73,7 +73,7 @@ static bool entry_matches(eap_vendor_type_t *item, eap_vendor_type_t *other)
|
||||
* Load the given EAP method
|
||||
*/
|
||||
static eap_method_t *load_method(private_eap_dynamic_t *this,
|
||||
eap_type_t type, u_int32_t vendor)
|
||||
eap_type_t type, uint32_t vendor)
|
||||
{
|
||||
eap_method_t *method;
|
||||
|
||||
@@ -171,7 +171,7 @@ METHOD(eap_method_t, process, status_t,
|
||||
private_eap_dynamic_t *this, eap_payload_t *in, eap_payload_t **out)
|
||||
{
|
||||
eap_type_t received_type, type;
|
||||
u_int32_t received_vendor, vendor;
|
||||
uint32_t received_vendor, vendor;
|
||||
|
||||
received_type = in->get_type(in, &received_vendor);
|
||||
if (received_vendor == 0 && received_type == EAP_NAK)
|
||||
@@ -225,7 +225,7 @@ METHOD(eap_method_t, process, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_dynamic_t *this, u_int32_t *vendor)
|
||||
private_eap_dynamic_t *this, uint32_t *vendor)
|
||||
{
|
||||
if (this->method)
|
||||
{
|
||||
@@ -245,7 +245,7 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_dynamic_t *this)
|
||||
{
|
||||
if (this->method)
|
||||
@@ -256,7 +256,7 @@ METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_dynamic_t *this, u_int8_t identifier)
|
||||
private_eap_dynamic_t *this, uint8_t identifier)
|
||||
{
|
||||
if (this->method)
|
||||
{
|
||||
@@ -335,7 +335,7 @@ static void get_supported_eap_types(private_eap_dynamic_t *this)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
eap_type_t type;
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
|
||||
enumerator = charon->eap->create_enumerator(charon->eap, EAP_SERVER);
|
||||
while (enumerator->enumerate(enumerator, &type, &vendor))
|
||||
|
||||
@@ -46,7 +46,7 @@ struct private_eap_gtc_t {
|
||||
/**
|
||||
* EAP message identififier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
};
|
||||
|
||||
typedef struct eap_gtc_header_t eap_gtc_header_t;
|
||||
@@ -56,15 +56,15 @@ typedef struct eap_gtc_header_t eap_gtc_header_t;
|
||||
*/
|
||||
struct eap_gtc_header_t {
|
||||
/** EAP code (REQUEST/RESPONSE) */
|
||||
u_int8_t code;
|
||||
uint8_t code;
|
||||
/** unique message identifier */
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
/** length of whole message */
|
||||
u_int16_t length;
|
||||
uint16_t length;
|
||||
/** EAP type */
|
||||
u_int8_t type;
|
||||
uint8_t type;
|
||||
/** type data */
|
||||
u_int8_t data[];
|
||||
uint8_t data[];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
METHOD(eap_method_t, initiate_peer, status_t,
|
||||
@@ -186,7 +186,7 @@ METHOD(eap_method_t, process_server, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_gtc_t *this, u_int32_t *vendor)
|
||||
private_eap_gtc_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = 0;
|
||||
return EAP_GTC;
|
||||
@@ -198,14 +198,14 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_gtc_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_gtc_t *this, u_int8_t identifier)
|
||||
private_eap_gtc_t *this, uint8_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ struct private_eap_identity_t {
|
||||
/**
|
||||
* EAP identifier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
};
|
||||
|
||||
typedef struct eap_identity_header_t eap_identity_header_t;
|
||||
@@ -53,15 +53,15 @@ typedef struct eap_identity_header_t eap_identity_header_t;
|
||||
*/
|
||||
struct eap_identity_header_t {
|
||||
/** EAP code (REQUEST/RESPONSE) */
|
||||
u_int8_t code;
|
||||
uint8_t code;
|
||||
/** unique message identifier */
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
/** length of whole message */
|
||||
u_int16_t length;
|
||||
uint16_t length;
|
||||
/** EAP type */
|
||||
u_int8_t type;
|
||||
uint8_t type;
|
||||
/** identity data */
|
||||
u_int8_t data[];
|
||||
uint8_t data[];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
METHOD(eap_method_t, process_peer, status_t,
|
||||
@@ -124,7 +124,7 @@ METHOD(eap_method_t, initiate_server, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_identity_t *this, u_int32_t *vendor)
|
||||
private_eap_identity_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = 0;
|
||||
return EAP_IDENTITY;
|
||||
@@ -141,14 +141,14 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_identity_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_identity_t *this, u_int8_t identifier)
|
||||
private_eap_identity_t *this, uint8_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ struct private_eap_md5_t {
|
||||
/**
|
||||
* EAP message identifier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
};
|
||||
|
||||
typedef struct eap_md5_header_t eap_md5_header_t;
|
||||
@@ -59,17 +59,17 @@ typedef struct eap_md5_header_t eap_md5_header_t;
|
||||
*/
|
||||
struct eap_md5_header_t {
|
||||
/** EAP code (REQUEST/RESPONSE) */
|
||||
u_int8_t code;
|
||||
uint8_t code;
|
||||
/** unique message identifier */
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
/** length of whole message */
|
||||
u_int16_t length;
|
||||
uint16_t length;
|
||||
/** EAP type */
|
||||
u_int8_t type;
|
||||
uint8_t type;
|
||||
/** length of value (challenge) */
|
||||
u_int8_t value_size;
|
||||
uint8_t value_size;
|
||||
/** actual value */
|
||||
u_int8_t value[];
|
||||
uint8_t value[];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
#define CHALLENGE_LEN 16
|
||||
@@ -204,7 +204,7 @@ METHOD(eap_method_t, process_server, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_md5_t *this, u_int32_t *vendor)
|
||||
private_eap_md5_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = 0;
|
||||
return EAP_MD5;
|
||||
@@ -222,14 +222,14 @@ METHOD(eap_method_t, is_mutual, bool,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_md5_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_md5_t *this, u_int8_t identifier)
|
||||
private_eap_md5_t *this, uint8_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -70,12 +70,12 @@ struct private_eap_mschapv2_t
|
||||
/**
|
||||
* EAP message identifier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
|
||||
/**
|
||||
* MS-CHAPv2-ID (session ID, increases with each retry)
|
||||
*/
|
||||
u_int8_t mschapv2id;
|
||||
uint8_t mschapv2id;
|
||||
|
||||
/**
|
||||
* Number of retries
|
||||
@@ -179,21 +179,21 @@ typedef struct eap_mschapv2_response_t eap_mschapv2_response_t;
|
||||
struct eap_mschapv2_header_t
|
||||
{
|
||||
/** EAP code (REQUEST/RESPONSE) */
|
||||
u_int8_t code;
|
||||
uint8_t code;
|
||||
/** unique message identifier */
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
/** length of whole message */
|
||||
u_int16_t length;
|
||||
uint16_t length;
|
||||
/** EAP type */
|
||||
u_int8_t type;
|
||||
uint8_t type;
|
||||
/** MS-CHAPv2 OpCode */
|
||||
u_int8_t opcode;
|
||||
uint8_t opcode;
|
||||
/** MS-CHAPv2-ID (equals identifier) */
|
||||
u_int8_t ms_chapv2_id;
|
||||
uint8_t ms_chapv2_id;
|
||||
/** MS-Length (defined as length - 5) */
|
||||
u_int16_t ms_length;
|
||||
uint16_t ms_length;
|
||||
/** packet data (determined by OpCode) */
|
||||
u_int8_t data[];
|
||||
uint8_t data[];
|
||||
}__attribute__((__packed__));
|
||||
|
||||
/**
|
||||
@@ -202,11 +202,11 @@ struct eap_mschapv2_header_t
|
||||
struct eap_mschapv2_challenge_t
|
||||
{
|
||||
/** Value-Size */
|
||||
u_int8_t value_size;
|
||||
uint8_t value_size;
|
||||
/** Challenge */
|
||||
u_int8_t challenge[CHALLENGE_LEN];
|
||||
uint8_t challenge[CHALLENGE_LEN];
|
||||
/** Name */
|
||||
u_int8_t name[];
|
||||
uint8_t name[];
|
||||
}__attribute__((__packed__));
|
||||
|
||||
/**
|
||||
@@ -215,21 +215,21 @@ struct eap_mschapv2_challenge_t
|
||||
struct eap_mschapv2_response_t
|
||||
{
|
||||
/** Value-Size */
|
||||
u_int8_t value_size;
|
||||
uint8_t value_size;
|
||||
/** Response */
|
||||
struct
|
||||
{
|
||||
/* Peer-Challenge*/
|
||||
u_int8_t peer_challenge[CHALLENGE_LEN];
|
||||
uint8_t peer_challenge[CHALLENGE_LEN];
|
||||
/* Reserved (=zero) */
|
||||
u_int8_t peer_reserved[8];
|
||||
uint8_t peer_reserved[8];
|
||||
/* NT-Response */
|
||||
u_int8_t nt_response[24];
|
||||
uint8_t nt_response[24];
|
||||
/* Flags (=zero) */
|
||||
u_int8_t flags;
|
||||
uint8_t flags;
|
||||
} response;
|
||||
/** Name */
|
||||
u_int8_t name[];
|
||||
uint8_t name[];
|
||||
}__attribute__((__packed__));
|
||||
|
||||
/**
|
||||
@@ -597,10 +597,10 @@ static chunk_t extract_username(chunk_t id)
|
||||
/**
|
||||
* Set the ms_length field using aligned write
|
||||
*/
|
||||
static void set_ms_length(eap_mschapv2_header_t *eap, u_int16_t len)
|
||||
static void set_ms_length(eap_mschapv2_header_t *eap, uint16_t len)
|
||||
{
|
||||
len = htons(len - 5);
|
||||
memcpy(&eap->ms_length, &len, sizeof(u_int16_t));
|
||||
memcpy(&eap->ms_length, &len, sizeof(uint16_t));
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, initiate_peer, status_t,
|
||||
@@ -617,7 +617,7 @@ METHOD(eap_method_t, initiate_server, status_t,
|
||||
eap_mschapv2_header_t *eap;
|
||||
eap_mschapv2_challenge_t *cha;
|
||||
const char *name = MSCHAPV2_HOST_NAME;
|
||||
u_int16_t len = CHALLENGE_PAYLOAD_LEN + sizeof(MSCHAPV2_HOST_NAME) - 1;
|
||||
uint16_t len = CHALLENGE_PAYLOAD_LEN + sizeof(MSCHAPV2_HOST_NAME) - 1;
|
||||
|
||||
rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK);
|
||||
if (!rng || !rng->allocate_bytes(rng, CHALLENGE_LEN, &this->challenge))
|
||||
@@ -690,7 +690,7 @@ static status_t process_peer_challenge(private_eap_mschapv2_t *this,
|
||||
eap_mschapv2_challenge_t *cha;
|
||||
eap_mschapv2_response_t *res;
|
||||
chunk_t data, peer_challenge, userid, username, nt_hash;
|
||||
u_int16_t len = RESPONSE_PAYLOAD_LEN;
|
||||
uint16_t len = RESPONSE_PAYLOAD_LEN;
|
||||
|
||||
data = in->get_data(in);
|
||||
eap = (eap_mschapv2_header_t*)data.ptr;
|
||||
@@ -779,7 +779,7 @@ static status_t process_peer_success(private_eap_mschapv2_t *this,
|
||||
chunk_t data, auth_string = chunk_empty;
|
||||
char *message, *token, *msg = NULL;
|
||||
int message_len;
|
||||
u_int16_t len = SHORT_HEADER_LEN;
|
||||
uint16_t len = SHORT_HEADER_LEN;
|
||||
|
||||
data = in->get_data(in);
|
||||
eap = (eap_mschapv2_header_t*)data.ptr;
|
||||
@@ -1011,7 +1011,7 @@ static status_t process_server_retry(private_eap_mschapv2_t *this,
|
||||
rng_t *rng;
|
||||
chunk_t hex;
|
||||
char msg[FAILURE_MESSAGE_LEN];
|
||||
u_int16_t len = HEADER_LEN + FAILURE_MESSAGE_LEN - 1; /* no null byte */
|
||||
uint16_t len = HEADER_LEN + FAILURE_MESSAGE_LEN - 1; /* no null byte */
|
||||
|
||||
if (++this->retries > MAX_RETRIES)
|
||||
{
|
||||
@@ -1127,7 +1127,7 @@ static status_t process_server_response(private_eap_mschapv2_t *this,
|
||||
{
|
||||
chunk_t hex;
|
||||
char msg[AUTH_RESPONSE_LEN + sizeof(SUCCESS_MESSAGE)];
|
||||
u_int16_t len = HEADER_LEN + AUTH_RESPONSE_LEN + sizeof(SUCCESS_MESSAGE);
|
||||
uint16_t len = HEADER_LEN + AUTH_RESPONSE_LEN + sizeof(SUCCESS_MESSAGE);
|
||||
|
||||
eap = alloca(len);
|
||||
eap->code = EAP_REQUEST;
|
||||
@@ -1213,7 +1213,7 @@ METHOD(eap_method_t, process_server, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_mschapv2_t *this, u_int32_t *vendor)
|
||||
private_eap_mschapv2_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = 0;
|
||||
return EAP_MSCHAPV2;
|
||||
@@ -1230,14 +1230,14 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_mschapv2_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_mschapv2_t *this, u_int8_t identifier)
|
||||
private_eap_mschapv2_t *this, uint8_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ METHOD(eap_method_t, process, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_peap_t *this, u_int32_t *vendor)
|
||||
private_eap_peap_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = 0;
|
||||
return EAP_PEAP;
|
||||
@@ -93,14 +93,14 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_peap_t *this)
|
||||
{
|
||||
return this->tls_eap->get_identifier(this->tls_eap);
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_peap_t *this, u_int8_t identifier)
|
||||
private_eap_peap_t *this, uint8_t identifier)
|
||||
{
|
||||
this->tls_eap->set_identifier(this->tls_eap, identifier);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ struct private_eap_peap_avp_t {
|
||||
METHOD(eap_peap_avp_t, build, void,
|
||||
private_eap_peap_avp_t *this, bio_writer_t *writer, chunk_t data)
|
||||
{
|
||||
u_int8_t code;
|
||||
uint8_t code;
|
||||
eap_packet_t *pkt;
|
||||
chunk_t avp_data;
|
||||
|
||||
@@ -71,10 +71,10 @@ METHOD(eap_peap_avp_t, build, void,
|
||||
|
||||
METHOD(eap_peap_avp_t, process, status_t,
|
||||
private_eap_peap_avp_t* this, bio_reader_t *reader, chunk_t *data,
|
||||
u_int8_t identifier)
|
||||
uint8_t identifier)
|
||||
{
|
||||
u_int8_t code;
|
||||
u_int16_t len;
|
||||
uint8_t code;
|
||||
uint16_t len;
|
||||
eap_packet_t *pkt;
|
||||
chunk_t avp_data;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ struct eap_peap_avp_t {
|
||||
* - NEED_MORE if another invocation of process/build needed
|
||||
*/
|
||||
status_t (*process)(eap_peap_avp_t *this, bio_reader_t *reader,
|
||||
chunk_t *data, u_int8_t identifier);
|
||||
chunk_t *data, uint8_t identifier);
|
||||
|
||||
/**
|
||||
* Build EAP-PEAP Message AVP to send out.
|
||||
|
||||
@@ -71,7 +71,7 @@ METHOD(tls_application_t, process, status_t,
|
||||
eap_payload_t *in;
|
||||
eap_code_t code;
|
||||
eap_type_t type, received_type;
|
||||
u_int32_t vendor, received_vendor;
|
||||
uint32_t vendor, received_vendor;
|
||||
|
||||
status = this->avp->process(this->avp, reader, &data,
|
||||
this->ph1_method->get_identifier(this->ph1_method));
|
||||
@@ -191,7 +191,7 @@ METHOD(tls_application_t, build, status_t,
|
||||
chunk_t data;
|
||||
eap_code_t code;
|
||||
eap_type_t type;
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
|
||||
if (this->out)
|
||||
{
|
||||
|
||||
@@ -167,7 +167,7 @@ METHOD(tls_application_t, process, status_t,
|
||||
eap_payload_t *in;
|
||||
eap_code_t code;
|
||||
eap_type_t type = EAP_NAK, received_type;
|
||||
u_int32_t vendor, received_vendor;
|
||||
uint32_t vendor, received_vendor;
|
||||
|
||||
status = this->avp->process(this->avp, reader, &data,
|
||||
this->ph1_method->get_identifier(this->ph1_method));
|
||||
@@ -336,7 +336,7 @@ METHOD(tls_application_t, build, status_t,
|
||||
chunk_t data;
|
||||
eap_code_t code;
|
||||
eap_type_t type;
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
|
||||
if (this->ph2_method == NULL && this->start_phase2 && this->start_phase2_id)
|
||||
{
|
||||
|
||||
@@ -55,12 +55,12 @@ struct private_eap_radius_t {
|
||||
/**
|
||||
* EAP vendor, if any
|
||||
*/
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
|
||||
/**
|
||||
* EAP message identifier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
|
||||
/**
|
||||
* RADIUS client instance
|
||||
@@ -86,15 +86,15 @@ static void add_eap_identity(private_eap_radius_t *this,
|
||||
{
|
||||
struct {
|
||||
/** EAP code (REQUEST/RESPONSE) */
|
||||
u_int8_t code;
|
||||
uint8_t code;
|
||||
/** unique message identifier */
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
/** length of whole message */
|
||||
u_int16_t length;
|
||||
uint16_t length;
|
||||
/** EAP type */
|
||||
u_int8_t type;
|
||||
uint8_t type;
|
||||
/** identity data */
|
||||
u_int8_t data[];
|
||||
uint8_t data[];
|
||||
} __attribute__((__packed__)) *hdr;
|
||||
chunk_t id, prefix;
|
||||
size_t len;
|
||||
@@ -156,7 +156,7 @@ void eap_radius_build_attributes(radius_message_t *request)
|
||||
ike_sa_t *ike_sa;
|
||||
host_t *host;
|
||||
char buf[40], *station_id_fmt;;
|
||||
u_int32_t value;
|
||||
uint32_t value;
|
||||
chunk_t chunk;
|
||||
|
||||
/* virtual NAS-Port-Type */
|
||||
@@ -314,8 +314,8 @@ static void process_filter_id(radius_message_t *msg)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
int type;
|
||||
u_int8_t tunnel_tag;
|
||||
u_int32_t tunnel_type;
|
||||
uint8_t tunnel_tag;
|
||||
uint32_t tunnel_type;
|
||||
chunk_t filter_id = chunk_empty, data;
|
||||
bool is_esp_tunnel = FALSE;
|
||||
|
||||
@@ -395,7 +395,7 @@ static void process_timeout(radius_message_t *msg)
|
||||
/**
|
||||
* Add a Cisco Unity configuration attribute
|
||||
*/
|
||||
static void add_unity_attribute(eap_radius_provider_t *provider, u_int32_t id,
|
||||
static void add_unity_attribute(eap_radius_provider_t *provider, uint32_t id,
|
||||
int type, chunk_t data)
|
||||
{
|
||||
switch (type)
|
||||
@@ -417,7 +417,7 @@ static void add_unity_attribute(eap_radius_provider_t *provider, u_int32_t id,
|
||||
* Add a DNS/NBNS configuration attribute
|
||||
*/
|
||||
static void add_nameserver_attribute(eap_radius_provider_t *provider,
|
||||
u_int32_t id, int type, chunk_t data)
|
||||
uint32_t id, int type, chunk_t data)
|
||||
{
|
||||
/* these are from different vendors, but there is currently no conflict */
|
||||
switch (type)
|
||||
@@ -444,7 +444,7 @@ static void add_nameserver_attribute(eap_radius_provider_t *provider,
|
||||
* Add a UNITY_LOCAL_LAN or UNITY_SPLIT_INCLUDE attribute
|
||||
*/
|
||||
static void add_unity_split_attribute(eap_radius_provider_t *provider,
|
||||
u_int32_t id, configuration_attribute_type_t type,
|
||||
uint32_t id, configuration_attribute_type_t type,
|
||||
chunk_t data)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
@@ -701,7 +701,7 @@ METHOD(eap_method_t, process, status_t,
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_type, eap_type_t,
|
||||
private_eap_radius_t *this, u_int32_t *vendor)
|
||||
private_eap_radius_t *this, uint32_t *vendor)
|
||||
{
|
||||
*vendor = this->vendor;
|
||||
return this->type;
|
||||
@@ -721,14 +721,14 @@ METHOD(eap_method_t, get_msk, status_t,
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, get_identifier, u_int8_t,
|
||||
METHOD(eap_method_t, get_identifier, uint8_t,
|
||||
private_eap_radius_t *this)
|
||||
{
|
||||
return this->identifier;
|
||||
}
|
||||
|
||||
METHOD(eap_method_t, set_identifier, void,
|
||||
private_eap_radius_t *this, u_int8_t identifier)
|
||||
private_eap_radius_t *this, uint8_t identifier)
|
||||
{
|
||||
this->identifier = identifier;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ struct private_eap_radius_accounting_t {
|
||||
/**
|
||||
* Session ID prefix
|
||||
*/
|
||||
u_int32_t prefix;
|
||||
uint32_t prefix;
|
||||
|
||||
/**
|
||||
* Format string we use for Called/Calling-Station-Id for a host
|
||||
@@ -101,8 +101,8 @@ typedef enum {
|
||||
*/
|
||||
typedef struct {
|
||||
struct {
|
||||
u_int64_t sent;
|
||||
u_int64_t received;
|
||||
uint64_t sent;
|
||||
uint64_t received;
|
||||
} bytes, packets;
|
||||
} usage_t;
|
||||
|
||||
@@ -133,7 +133,7 @@ static inline void sub_usage(usage_t *a, usage_t b)
|
||||
*/
|
||||
typedef struct {
|
||||
/** unique CHILD_SA identifier */
|
||||
u_int32_t id;
|
||||
uint32_t id;
|
||||
/** usage stats for this SA */
|
||||
usage_t usage;
|
||||
} sa_entry_t;
|
||||
@@ -172,7 +172,7 @@ typedef struct {
|
||||
radius_acct_terminate_cause_t cause;
|
||||
/* interim interval and timestamp of last update */
|
||||
struct {
|
||||
u_int32_t interval;
|
||||
uint32_t interval;
|
||||
time_t last;
|
||||
} interim;
|
||||
/** did we send Accounting-Start */
|
||||
@@ -237,7 +237,7 @@ static int sa_find(const void *a, const void *b)
|
||||
/**
|
||||
* Update or create usage counters of a cached SA
|
||||
*/
|
||||
static void update_sa(entry_t *entry, u_int32_t id, usage_t usage)
|
||||
static void update_sa(entry_t *entry, uint32_t id, usage_t usage)
|
||||
{
|
||||
sa_entry_t *sa, lookup;
|
||||
|
||||
@@ -402,7 +402,7 @@ static void add_ike_sa_parameters(private_eap_radius_accounting_t *this,
|
||||
host_t *vip, *host;
|
||||
char buf[MAX_RADIUS_ATTRIBUTE_SIZE + 1];
|
||||
chunk_t data;
|
||||
u_int32_t value;
|
||||
uint32_t value;
|
||||
|
||||
/* virtual NAS-Port-Type */
|
||||
value = htonl(5);
|
||||
@@ -461,7 +461,7 @@ static void add_ike_sa_parameters(private_eap_radius_accounting_t *this,
|
||||
* Get an existing or create a new entry from the locked session table
|
||||
*/
|
||||
static entry_t* get_or_create_entry(private_eap_radius_accounting_t *this,
|
||||
ike_sa_id_t *id, u_int32_t unique)
|
||||
ike_sa_id_t *id, uint32_t unique)
|
||||
{
|
||||
entry_t *entry;
|
||||
time_t now;
|
||||
@@ -520,7 +520,7 @@ static job_requeue_t send_interim(interim_data_t *data)
|
||||
enumerator_t *enumerator;
|
||||
ike_sa_t *ike_sa;
|
||||
entry_t *entry;
|
||||
u_int32_t value;
|
||||
uint32_t value;
|
||||
array_t *stats;
|
||||
sa_entry_t *sa, *found;
|
||||
|
||||
@@ -681,7 +681,7 @@ static void send_start(private_eap_radius_accounting_t *this, ike_sa_t *ike_sa)
|
||||
{
|
||||
radius_message_t *message;
|
||||
entry_t *entry;
|
||||
u_int32_t value;
|
||||
uint32_t value;
|
||||
|
||||
if (this->acct_req_vip && !has_vip(ike_sa))
|
||||
{
|
||||
@@ -735,7 +735,7 @@ static void send_stop(private_eap_radius_accounting_t *this, ike_sa_t *ike_sa)
|
||||
enumerator_t *enumerator;
|
||||
entry_t *entry;
|
||||
sa_entry_t *sa;
|
||||
u_int32_t value;
|
||||
uint32_t value;
|
||||
|
||||
this->mutex->lock(this->mutex);
|
||||
entry = this->sessions->remove(this->sessions, ike_sa->get_id(ike_sa));
|
||||
@@ -931,7 +931,7 @@ METHOD(listener_t, child_rekey, bool,
|
||||
|
||||
METHOD(listener_t, children_migrate, bool,
|
||||
private_eap_radius_accounting_t *this, ike_sa_t *ike_sa, ike_sa_id_t *new,
|
||||
u_int32_t unique)
|
||||
uint32_t unique)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
sa_entry_t *sa, *sa_new, *cached;
|
||||
@@ -1020,7 +1020,7 @@ eap_radius_accounting_t *eap_radius_accounting_create()
|
||||
.destroy = _destroy,
|
||||
},
|
||||
/* use system time as Session ID prefix */
|
||||
.prefix = (u_int32_t)time(NULL),
|
||||
.prefix = (uint32_t)time(NULL),
|
||||
.sessions = hashtable_create((hashtable_hash_t)hash,
|
||||
(hashtable_equals_t)equals, 32),
|
||||
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
|
||||
@@ -1050,7 +1050,7 @@ eap_radius_accounting_t *eap_radius_accounting_create()
|
||||
/**
|
||||
* See header
|
||||
*/
|
||||
void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, u_int32_t interval)
|
||||
void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, uint32_t interval)
|
||||
{
|
||||
if (singleton)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,6 @@ eap_radius_accounting_t *eap_radius_accounting_create();
|
||||
* @param ike_sa IKE_SA to send updates for
|
||||
* @param interval interval for interim updates
|
||||
*/
|
||||
void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, u_int32_t interval);
|
||||
void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, uint32_t interval);
|
||||
|
||||
#endif /** EAP_RADIUS_ACCOUNTING_H_ @}*/
|
||||
|
||||
@@ -293,7 +293,7 @@ static void process_disconnect(private_eap_radius_dae_t *this,
|
||||
* Apply a new lifetime to an IKE_SA
|
||||
*/
|
||||
static void apply_lifetime(private_eap_radius_dae_t *this, ike_sa_id_t *id,
|
||||
u_int32_t lifetime)
|
||||
uint32_t lifetime)
|
||||
{
|
||||
ike_sa_t *ike_sa;
|
||||
|
||||
@@ -323,7 +323,7 @@ static void process_coa(private_eap_radius_dae_t *this,
|
||||
ike_sa_id_t *id;
|
||||
chunk_t data;
|
||||
int type;
|
||||
u_int32_t lifetime = 0;
|
||||
uint32_t lifetime = 0;
|
||||
bool lifetime_seen = FALSE;
|
||||
|
||||
ids = get_matching_ike_sas(this, request, client);
|
||||
|
||||
@@ -63,9 +63,9 @@ struct private_eap_radius_forward_t {
|
||||
*/
|
||||
typedef struct {
|
||||
/** vendor ID, 0 for standard attributes */
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
/** attribute type */
|
||||
u_int8_t type;
|
||||
uint8_t type;
|
||||
} attr_t;
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ static bool is_attribute_selected(linked_list_t *selector,
|
||||
radius_attribute_type_t type, chunk_t data)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
u_int32_t vendor = 0;
|
||||
uint32_t vendor = 0;
|
||||
attr_t *sel;
|
||||
bool found = FALSE;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user