Use standard unsigned integer types
This commit is contained in:
@@ -200,7 +200,7 @@ METHOD(radius_config_t, destroy, void,
|
||||
* See header
|
||||
*/
|
||||
radius_config_t *radius_config_create(char *name, char *address,
|
||||
u_int16_t auth_port, u_int16_t acct_port,
|
||||
uint16_t auth_port, uint16_t acct_port,
|
||||
char *nas_identifier, char *secret,
|
||||
int sockets, int preference,
|
||||
u_int tries, double timeout, double base)
|
||||
|
||||
@@ -118,7 +118,7 @@ struct radius_config_t {
|
||||
* @param base base to calculate retransmission timeout
|
||||
*/
|
||||
radius_config_t *radius_config_create(char *name, char *address,
|
||||
u_int16_t auth_port, u_int16_t acct_port,
|
||||
uint16_t auth_port, uint16_t acct_port,
|
||||
char *nas_identifier, char *secret,
|
||||
int sockets, int preference,
|
||||
u_int tries, double timeout, double base);
|
||||
|
||||
@@ -28,15 +28,15 @@ typedef struct rattr_t rattr_t;
|
||||
*/
|
||||
struct rmsg_t {
|
||||
/** message code, radius_message_code_t */
|
||||
u_int8_t code;
|
||||
uint8_t code;
|
||||
/** message identifier */
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
/** length of Code, Identifier, Length, Authenticator and Attributes */
|
||||
u_int16_t length;
|
||||
uint16_t length;
|
||||
/** message authenticator, MD5 hash */
|
||||
u_int8_t authenticator[HASH_SIZE_MD5];
|
||||
uint8_t authenticator[HASH_SIZE_MD5];
|
||||
/** variable list of packed attributes */
|
||||
u_int8_t attributes[];
|
||||
uint8_t attributes[];
|
||||
} __attribute__((packed));
|
||||
|
||||
/**
|
||||
@@ -44,11 +44,11 @@ struct rmsg_t {
|
||||
*/
|
||||
struct rattr_t {
|
||||
/** attribute type, radius_attribute_type_t */
|
||||
u_int8_t type;
|
||||
uint8_t type;
|
||||
/** length of the attriubte, including the Type, Length and Value fields */
|
||||
u_int8_t length;
|
||||
uint8_t length;
|
||||
/** variable length attribute value */
|
||||
u_int8_t value[];
|
||||
uint8_t value[];
|
||||
} __attribute__((packed));
|
||||
|
||||
/**
|
||||
@@ -293,7 +293,7 @@ typedef struct {
|
||||
/** inner attribute enumerator */
|
||||
enumerator_t *inner;
|
||||
/** current vendor ID */
|
||||
u_int32_t vendor;
|
||||
uint32_t vendor;
|
||||
/** reader for current vendor ID */
|
||||
bio_reader_t *reader;
|
||||
} vendor_enumerator_t;
|
||||
@@ -303,7 +303,7 @@ METHOD(enumerator_t, vendor_enumerate, bool,
|
||||
{
|
||||
chunk_t inner_data;
|
||||
int inner_type;
|
||||
u_int8_t type8, len;
|
||||
uint8_t type8, len;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
@@ -449,7 +449,7 @@ METHOD(radius_message_t, crypt, bool,
|
||||
}
|
||||
|
||||
METHOD(radius_message_t, sign, bool,
|
||||
private_radius_message_t *this, u_int8_t *req_auth, chunk_t secret,
|
||||
private_radius_message_t *this, uint8_t *req_auth, chunk_t secret,
|
||||
hasher_t *hasher, signer_t *signer, rng_t *rng, bool msg_auth)
|
||||
{
|
||||
if (rng)
|
||||
@@ -516,7 +516,7 @@ METHOD(radius_message_t, sign, bool,
|
||||
}
|
||||
|
||||
METHOD(radius_message_t, verify, bool,
|
||||
private_radius_message_t *this, u_int8_t *req_auth, chunk_t secret,
|
||||
private_radius_message_t *this, uint8_t *req_auth, chunk_t secret,
|
||||
hasher_t *hasher, signer_t *signer)
|
||||
{
|
||||
char buf[HASH_SIZE_MD5], res_auth[HASH_SIZE_MD5];
|
||||
@@ -606,19 +606,19 @@ METHOD(radius_message_t, get_code, radius_message_code_t,
|
||||
return this->msg->code;
|
||||
}
|
||||
|
||||
METHOD(radius_message_t, get_identifier, u_int8_t,
|
||||
METHOD(radius_message_t, get_identifier, uint8_t,
|
||||
private_radius_message_t *this)
|
||||
{
|
||||
return this->msg->identifier;
|
||||
}
|
||||
|
||||
METHOD(radius_message_t, set_identifier, void,
|
||||
private_radius_message_t *this, u_int8_t identifier)
|
||||
private_radius_message_t *this, uint8_t identifier)
|
||||
{
|
||||
this->msg->identifier = identifier;
|
||||
}
|
||||
|
||||
METHOD(radius_message_t, get_authenticator, u_int8_t*,
|
||||
METHOD(radius_message_t, get_authenticator, uint8_t*,
|
||||
private_radius_message_t *this)
|
||||
{
|
||||
return this->msg->authenticator;
|
||||
|
||||
@@ -241,21 +241,21 @@ struct radius_message_t {
|
||||
*
|
||||
* @return message identifier
|
||||
*/
|
||||
u_int8_t (*get_identifier)(radius_message_t *this);
|
||||
uint8_t (*get_identifier)(radius_message_t *this);
|
||||
|
||||
/**
|
||||
* Set the message identifier.
|
||||
*
|
||||
* @param identifier message identifier
|
||||
*/
|
||||
void (*set_identifier)(radius_message_t *this, u_int8_t identifier);
|
||||
void (*set_identifier)(radius_message_t *this, uint8_t identifier);
|
||||
|
||||
/**
|
||||
* Get the 16 byte authenticator.
|
||||
*
|
||||
* @return pointer to the Authenticator field
|
||||
*/
|
||||
u_int8_t* (*get_authenticator)(radius_message_t *this);
|
||||
uint8_t* (*get_authenticator)(radius_message_t *this);
|
||||
|
||||
/**
|
||||
* Get the RADIUS message in its encoded form.
|
||||
@@ -275,7 +275,7 @@ struct radius_message_t {
|
||||
* @param msg_auth calculate and add Message-Authenticator
|
||||
* @return TRUE if signed successfully
|
||||
*/
|
||||
bool (*sign)(radius_message_t *this, u_int8_t *req_auth, chunk_t secret,
|
||||
bool (*sign)(radius_message_t *this, uint8_t *req_auth, chunk_t secret,
|
||||
hasher_t *hasher, signer_t *signer, rng_t *rng, bool msg_auth);
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ struct radius_message_t {
|
||||
* @param signer HMAC-MD5 signer with secret set
|
||||
* @param hasher MD5 hasher
|
||||
*/
|
||||
bool (*verify)(radius_message_t *this, u_int8_t *req_auth, chunk_t secret,
|
||||
bool (*verify)(radius_message_t *this, uint8_t *req_auth, chunk_t secret,
|
||||
hasher_t *hasher, signer_t *signer);
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
typedef struct mppe_key_t mppe_key_t;
|
||||
|
||||
struct mppe_key_t {
|
||||
u_int32_t id;
|
||||
u_int8_t type;
|
||||
u_int8_t length;
|
||||
u_int16_t salt;
|
||||
u_int8_t key[];
|
||||
uint32_t id;
|
||||
uint8_t type;
|
||||
uint8_t length;
|
||||
uint16_t salt;
|
||||
uint8_t key[];
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif /** RADIUS_MPPE_H_ @}*/
|
||||
|
||||
@@ -60,7 +60,7 @@ struct private_radius_socket_t {
|
||||
/**
|
||||
* Server port for authentication
|
||||
*/
|
||||
u_int16_t auth_port;
|
||||
uint16_t auth_port;
|
||||
|
||||
/**
|
||||
* socket file descriptor for authentication
|
||||
@@ -70,7 +70,7 @@ struct private_radius_socket_t {
|
||||
/**
|
||||
* Server port for accounting
|
||||
*/
|
||||
u_int16_t acct_port;
|
||||
uint16_t acct_port;
|
||||
|
||||
/**
|
||||
* socket file descriptor for accounting
|
||||
@@ -85,7 +85,7 @@ struct private_radius_socket_t {
|
||||
/**
|
||||
* current RADIUS identifier
|
||||
*/
|
||||
u_int8_t identifier;
|
||||
uint8_t identifier;
|
||||
|
||||
/**
|
||||
* hasher to use for response verification
|
||||
@@ -127,7 +127,7 @@ struct private_radius_socket_t {
|
||||
* Check or establish RADIUS connection
|
||||
*/
|
||||
static bool check_connection(private_radius_socket_t *this,
|
||||
int *fd, u_int16_t port)
|
||||
int *fd, uint16_t port)
|
||||
{
|
||||
if (*fd == -1)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ static bool check_connection(private_radius_socket_t *this,
|
||||
/**
|
||||
* Receive the response to the message with the given ID
|
||||
*/
|
||||
static status_t receive_response(int fd, int timeout, u_int8_t id,
|
||||
static status_t receive_response(int fd, int timeout, uint8_t id,
|
||||
radius_message_t **response)
|
||||
{
|
||||
radius_message_t *msg;
|
||||
@@ -224,7 +224,7 @@ METHOD(radius_socket_t, request, radius_message_t*,
|
||||
radius_message_t *response;
|
||||
chunk_t data;
|
||||
int *fd, retransmit = 0, timeout;
|
||||
u_int16_t port;
|
||||
uint16_t port;
|
||||
rng_t *rng = NULL;
|
||||
|
||||
if (request->get_code(request) == RMC_ACCOUNTING_REQUEST)
|
||||
@@ -299,7 +299,7 @@ METHOD(radius_socket_t, request, radius_message_t*,
|
||||
/**
|
||||
* Decrypt a MS-MPPE-Send/Recv-Key
|
||||
*/
|
||||
static chunk_t decrypt_mppe_key(private_radius_socket_t *this, u_int16_t salt,
|
||||
static chunk_t decrypt_mppe_key(private_radius_socket_t *this, uint16_t salt,
|
||||
chunk_t C, radius_message_t *request)
|
||||
{
|
||||
chunk_t decrypted;
|
||||
@@ -375,8 +375,8 @@ METHOD(radius_socket_t, destroy, void,
|
||||
/**
|
||||
* See header
|
||||
*/
|
||||
radius_socket_t *radius_socket_create(char *address, u_int16_t auth_port,
|
||||
u_int16_t acct_port, chunk_t secret,
|
||||
radius_socket_t *radius_socket_create(char *address, uint16_t auth_port,
|
||||
uint16_t acct_port, chunk_t secret,
|
||||
u_int tries, double timeout, double base)
|
||||
{
|
||||
private_radius_socket_t *this;
|
||||
|
||||
@@ -96,8 +96,8 @@ struct radius_socket_t {
|
||||
* @param timeout retransmission timeout
|
||||
* @param base base to calculate retransmission timeout
|
||||
*/
|
||||
radius_socket_t *radius_socket_create(char *address, u_int16_t auth_port,
|
||||
u_int16_t acct_port, chunk_t secret,
|
||||
radius_socket_t *radius_socket_create(char *address, uint16_t auth_port,
|
||||
uint16_t acct_port, chunk_t secret,
|
||||
u_int tries, double timeout, double base);
|
||||
|
||||
#endif /** RADIUS_SOCKET_H_ @}*/
|
||||
|
||||
Reference in New Issue
Block a user