Use standard unsigned integer types
This commit is contained in:
@@ -95,7 +95,7 @@ static void socket_destroy(proxy_socket_t *this)
|
||||
*/
|
||||
static u_int socket_hash(host_t *src)
|
||||
{
|
||||
u_int16_t port = src->get_port(src);
|
||||
uint16_t port = src->get_port(src);
|
||||
return chunk_hash_inc(src->get_address(src),
|
||||
chunk_hash(chunk_from_thing(port)));
|
||||
}
|
||||
@@ -222,14 +222,14 @@ CALLBACK(handle_timeout, job_requeue_t,
|
||||
* DNS header and masks to access flags
|
||||
*/
|
||||
typedef struct __attribute__((packed)) {
|
||||
u_int16_t id;
|
||||
u_int16_t flags;
|
||||
uint16_t id;
|
||||
uint16_t flags;
|
||||
#define DNS_QR_MASK 0x8000
|
||||
#define DNS_OPCODE_MASK 0x7800
|
||||
u_int16_t qdcount;
|
||||
u_int16_t ancount;
|
||||
u_int16_t nscount;
|
||||
u_int16_t arcount;
|
||||
uint16_t qdcount;
|
||||
uint16_t ancount;
|
||||
uint16_t nscount;
|
||||
uint16_t arcount;
|
||||
} dns_header_t;
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ typedef struct __attribute__((packed)) {
|
||||
static char *extract_hostname(chunk_t data)
|
||||
{
|
||||
char *hostname, *pos, *end;
|
||||
u_int8_t label;
|
||||
uint8_t label;
|
||||
|
||||
if (!data.len || data.len > 255)
|
||||
{
|
||||
|
||||
@@ -208,7 +208,7 @@ static job_requeue_t handle_plain(private_android_service_t *this)
|
||||
* Add a route to the TUN device builder
|
||||
*/
|
||||
static bool add_route(vpnservice_builder_t *builder, host_t *net,
|
||||
u_int8_t prefix)
|
||||
uint8_t prefix)
|
||||
{
|
||||
/* if route is 0.0.0.0/0, split it into two routes 0.0.0.0/1 and
|
||||
* 128.0.0.0/1 because otherwise it would conflict with the current default
|
||||
@@ -246,7 +246,7 @@ static bool add_routes(vpnservice_builder_t *builder, child_sa_t *child_sa)
|
||||
while (success && enumerator->enumerate(enumerator, &src_ts, &dst_ts))
|
||||
{
|
||||
host_t *net;
|
||||
u_int8_t prefix;
|
||||
uint8_t prefix;
|
||||
|
||||
dst_ts->to_subnet(dst_ts, &net, &prefix);
|
||||
success = add_route(builder, net, prefix);
|
||||
@@ -399,7 +399,7 @@ static void close_tun_device(private_android_service_t *this)
|
||||
* Terminate the IKE_SA with the given unique ID
|
||||
*/
|
||||
CALLBACK(terminate, job_requeue_t,
|
||||
u_int32_t *id)
|
||||
uint32_t *id)
|
||||
{
|
||||
charon->controller->terminate_ike(charon->controller, *id,
|
||||
controller_cb_empty, NULL, 0);
|
||||
@@ -410,7 +410,7 @@ CALLBACK(terminate, job_requeue_t,
|
||||
* Reestablish the IKE_SA with the given unique ID
|
||||
*/
|
||||
CALLBACK(reestablish, job_requeue_t,
|
||||
u_int32_t *id)
|
||||
uint32_t *id)
|
||||
{
|
||||
ike_sa_t *ike_sa;
|
||||
|
||||
@@ -498,7 +498,7 @@ METHOD(listener_t, alert, bool,
|
||||
break;
|
||||
case ALERT_KEEP_ON_CHILD_SA_FAILURE:
|
||||
{
|
||||
u_int32_t *id = malloc_thing(u_int32_t);
|
||||
uint32_t *id = malloc_thing(uint32_t);
|
||||
|
||||
/* because close_ike_on_child_failure is set this is only
|
||||
* triggered when CHILD_SA rekeying failed. reestablish it in
|
||||
@@ -514,7 +514,7 @@ METHOD(listener_t, alert, bool,
|
||||
this->lock->read_lock(this->lock);
|
||||
if (this->tunfd < 0)
|
||||
{
|
||||
u_int32_t *id = malloc_thing(u_int32_t);
|
||||
uint32_t *id = malloc_thing(uint32_t);
|
||||
|
||||
/* always fail if we are not able to initiate the IKE_SA
|
||||
* initially */
|
||||
@@ -531,14 +531,14 @@ METHOD(listener_t, alert, bool,
|
||||
else
|
||||
{
|
||||
peer_cfg_t *peer_cfg;
|
||||
u_int32_t tries, try;
|
||||
uint32_t tries, try;
|
||||
|
||||
/* when reestablishing and if keyingtries is not %forever
|
||||
* the IKE_SA is destroyed after the set number of tries,
|
||||
* so notify the GUI */
|
||||
peer_cfg = ike_sa->get_peer_cfg(ike_sa);
|
||||
tries = peer_cfg->get_keyingtries(peer_cfg);
|
||||
try = va_arg(args, u_int32_t);
|
||||
try = va_arg(args, uint32_t);
|
||||
if (tries != 0 && try == tries-1)
|
||||
{
|
||||
charonservice->update_status(charonservice,
|
||||
|
||||
@@ -404,8 +404,8 @@ static void handle_tcg_attribute(imc_android_state_t *state,
|
||||
tcg_pts_attr_req_file_meas_t *attr_cast;
|
||||
pts_file_meas_t *measurements;
|
||||
pts_error_code_t pts_error;
|
||||
u_int32_t delim;
|
||||
u_int16_t req_id;
|
||||
uint32_t delim;
|
||||
uint16_t req_id;
|
||||
bool is_dir;
|
||||
char *path;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ struct private_imc_android_state_t {
|
||||
/**
|
||||
* Maximum PA-TNC message size for this TNCCS connection
|
||||
*/
|
||||
u_int32_t max_msg_len;
|
||||
uint32_t max_msg_len;
|
||||
|
||||
/**
|
||||
* PA-TNC attribute segmentation contracts associated with TNCCS connection
|
||||
@@ -99,12 +99,12 @@ METHOD(imc_state_t, set_flags, void,
|
||||
}
|
||||
|
||||
METHOD(imc_state_t, set_max_msg_len, void,
|
||||
private_imc_android_state_t *this, u_int32_t max_msg_len)
|
||||
private_imc_android_state_t *this, uint32_t max_msg_len)
|
||||
{
|
||||
this->max_msg_len = max_msg_len;
|
||||
}
|
||||
|
||||
METHOD(imc_state_t, get_max_msg_len, u_int32_t,
|
||||
METHOD(imc_state_t, get_max_msg_len, uint32_t,
|
||||
private_imc_android_state_t *this)
|
||||
{
|
||||
return this->max_msg_len;
|
||||
|
||||
@@ -40,31 +40,31 @@ struct private_kernel_android_ipsec_t {
|
||||
/**
|
||||
* Callback registrered with libipsec.
|
||||
*/
|
||||
static void expire(u_int8_t protocol, u_int32_t spi, host_t *dst, bool hard)
|
||||
static void expire(uint8_t protocol, uint32_t spi, host_t *dst, bool hard)
|
||||
{
|
||||
charon->kernel->expire(charon->kernel, protocol, spi, dst, hard);
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, get_spi, status_t,
|
||||
private_kernel_android_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int8_t protocol, u_int32_t *spi)
|
||||
uint8_t protocol, uint32_t *spi)
|
||||
{
|
||||
return ipsec->sas->get_spi(ipsec->sas, src, dst, protocol, spi);
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, get_cpi, status_t,
|
||||
private_kernel_android_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int16_t *cpi)
|
||||
uint16_t *cpi)
|
||||
{
|
||||
return NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, add_sa, status_t,
|
||||
private_kernel_android_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,
|
||||
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)
|
||||
{
|
||||
@@ -75,8 +75,8 @@ METHOD(kernel_ipsec_t, add_sa, status_t,
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, update_sa, status_t,
|
||||
private_kernel_android_ipsec_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_android_ipsec_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)
|
||||
{
|
||||
return ipsec->sas->update_sa(ipsec->sas, spi, protocol, cpi, src, dst,
|
||||
@@ -85,8 +85,8 @@ METHOD(kernel_ipsec_t, update_sa, status_t,
|
||||
|
||||
METHOD(kernel_ipsec_t, query_sa, status_t,
|
||||
private_kernel_android_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)
|
||||
{
|
||||
return ipsec->sas->query_sa(ipsec->sas, src, dst, spi, protocol, mark,
|
||||
bytes, packets, time);
|
||||
@@ -94,7 +94,7 @@ METHOD(kernel_ipsec_t, query_sa, status_t,
|
||||
|
||||
METHOD(kernel_ipsec_t, del_sa, status_t,
|
||||
private_kernel_android_ipsec_t *this, host_t *src, host_t *dst,
|
||||
u_int32_t spi, u_int8_t protocol, u_int16_t cpi, mark_t mark)
|
||||
uint32_t spi, uint8_t protocol, uint16_t cpi, mark_t mark)
|
||||
{
|
||||
return ipsec->sas->del_sa(ipsec->sas, src, dst, spi, protocol, cpi, mark);
|
||||
}
|
||||
@@ -149,7 +149,7 @@ METHOD(kernel_ipsec_t, bypass_socket, bool,
|
||||
}
|
||||
|
||||
METHOD(kernel_ipsec_t, enable_udp_decap, bool,
|
||||
private_kernel_android_ipsec_t *this, int fd, int family, u_int16_t port)
|
||||
private_kernel_android_ipsec_t *this, int fd, int family, uint16_t port)
|
||||
{
|
||||
return NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
@@ -246,14 +246,14 @@ METHOD(kernel_net_t, del_ip, status_t,
|
||||
}
|
||||
|
||||
METHOD(kernel_net_t, add_route, status_t,
|
||||
private_android_net_t *this, chunk_t dst_net, u_int8_t prefixlen,
|
||||
private_android_net_t *this, chunk_t dst_net, uint8_t prefixlen,
|
||||
host_t *gateway, host_t *src_ip, char *if_name)
|
||||
{
|
||||
return NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
METHOD(kernel_net_t, del_route, status_t,
|
||||
private_android_net_t *this, chunk_t dst_net, u_int8_t prefixlen,
|
||||
private_android_net_t *this, chunk_t dst_net, uint8_t prefixlen,
|
||||
host_t *gateway, host_t *src_ip, char *if_name)
|
||||
{
|
||||
return NOT_SUPPORTED;
|
||||
|
||||
Reference in New Issue
Block a user