Permalink
Browse files

Replace some typedefs

Patch by: michaelortmann
  • Loading branch information...
michaelortmann authored and vanosg committed Sep 26, 2018
1 parent d9e6c60 commit c616f0c1cbe8a2213def0783ee8b1438dabd943c
View
@@ -37,21 +37,21 @@
#ifndef HAVE_STRUCT_IN6_ADDR
struct in6_addr {
union {
u_8bit_t __u6_addr8[16];
u_16bit_t __u6_addr16[8];
u_32bit_t __u6_addr32[4];
uint8_t __u6_addr8[16];
uint16_t __u6_addr16[8];
uint32_t __u6_addr32[4];
} __u6_addr;
#define s6_addr __u6_addr.__u6_addr8
};
#endif
#ifndef HAVE_STRUCT_SOCKADDR_IN6
struct sockaddr_in6 {
u_16bit_t sin6_family;
u_16bit_t sin6_port;
u_32bit_t sin6_flowinfo;
uint16_t sin6_family;
uint16_t sin6_port;
uint32_t sin6_flowinfo;
struct in6_addr sin6_addr;
u_32bit_t sin6_scope_id;
uint32_t sin6_scope_id;
};
#endif
@@ -77,33 +77,33 @@ extern const struct in6_addr in6addr_loopback;
#ifndef IN6_IS_ADDR_UNSPECIFIED
# define IN6_IS_ADDR_UNSPECIFIED(a) \
(((const u_32bit_t *) (a))[0] == 0 \
&& ((const u_32bit_t *) (a))[1] == 0 \
&& ((const u_32bit_t *) (a))[2] == 0 \
&& ((const u_32bit_t *) (a))[3] == 0)
(((const uint32_t *) (a))[0] == 0 \
&& ((const uint32_t *) (a))[1] == 0 \
&& ((const uint32_t *) (a))[2] == 0 \
&& ((const uint32_t *) (a))[3] == 0)
#endif
#ifndef IN6_IS_ADDR_LOOPBACK
# define IN6_IS_ADDR_LOOPBACK(a) \
(((const u_32bit_t *) (a))[0] == 0 \
&& ((const u_32bit_t *) (a))[1] == 0 \
&& ((const u_32bit_t *) (a))[2] == 0 \
&& ((const u_32bit_t *) (a))[3] == htonl (1))
(((const uint32_t *) (a))[0] == 0 \
&& ((const uint32_t *) (a))[1] == 0 \
&& ((const uint32_t *) (a))[2] == 0 \
&& ((const uint32_t *) (a))[3] == htonl (1))
#endif
#ifndef IN6_IS_ADDR_V4MAPPED
# define IN6_IS_ADDR_V4MAPPED(a) \
((((const u_32bit_t *) (a))[0] == 0) \
&& (((const u_32bit_t *) (a))[1] == 0) \
&& (((const u_32bit_t *) (a))[2] == htonl (0xffff)))
((((const uint32_t *) (a))[0] == 0) \
&& (((const uint32_t *) (a))[1] == 0) \
&& (((const uint32_t *) (a))[2] == htonl (0xffff)))
#endif
#ifndef IN6_ARE_ADDR_EQUAL
# define IN6_ARE_ADDR_EQUAL(a,b) \
((((const u_32bit_t *) (a))[0] == ((const u_32bit_t *) (b))[0]) \
&& (((const u_32bit_t *) (a))[1] == ((const u_32bit_t *) (b))[1]) \
&& (((const u_32bit_t *) (a))[2] == ((const u_32bit_t *) (b))[2]) \
&& (((const u_32bit_t *) (a))[3] == ((const u_32bit_t *) (b))[3]))
((((const uint32_t *) (a))[0] == ((const uint32_t *) (b))[0]) \
&& (((const uint32_t *) (a))[1] == ((const uint32_t *) (b))[1]) \
&& (((const uint32_t *) (a))[2] == ((const uint32_t *) (b))[2]) \
&& (((const uint32_t *) (a))[3] == ((const uint32_t *) (b))[3]))
#endif
#endif /* IPV6 */
View
@@ -103,13 +103,13 @@ int egg_inet_aton(cp, addr)
const char *cp;
struct in_addr *addr;
{
static const u_32bit_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
u_32bit_t val; /* changed from u_long --david */
static const uint32_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
uint32_t val; /* changed from u_long --david */
int base;
int n;
char c;
u_32bit_t parts[4];
u_32bit_t *pp = parts;
uint32_t parts[4];
uint32_t *pp = parts;
egg_bzero(parts, sizeof(parts));
View
@@ -40,7 +40,7 @@ typedef struct {
typedef struct devent_str {
struct devent_str *next; /* Pointer to next dns_event */
devent_type *type;
u_8bit_t lookup; /* RES_IPBYHOST or RES_HOSTBYIP */
uint8_t lookup; /* RES_IPBYHOST or RES_HOSTBYIP */
union {
sockname_t *ip_addr; /* Pointer to address placeholder */
char *hostname; /* Hostname */
View
@@ -308,12 +308,8 @@ typedef int socklen_t;
# define free(x) dont_use_old_free(x)
#endif /* !COMPILING_MEM */
typedef uint8_t u_8bit_t;
typedef uint16_t u_16bit_t;
typedef uint32_t u_32bit_t;
/* IP type */
typedef u_32bit_t IP;
typedef uint32_t IP;
/* Debug logging macros */
#define debug0(x) putlog(LOG_DEBUG,"*",x)
View
@@ -798,7 +798,7 @@ int ssl_init();
static void garbage_collect(void)
{
static u_8bit_t run_cnt = 0;
static uint8_t run_cnt = 0;
if (run_cnt == 3)
garbage_collect_tclhash();
View
@@ -339,7 +339,7 @@ int cidr_match(char *m, char *n, int count)
{
#ifdef IPV6
int c, af = AF_INET, rest;
u_8bit_t block[16], addr[16];
uint8_t block[16], addr[16];
if (strchr(m, ':') || strchr(n, ':')) {
af = AF_INET6;
@@ -23,14 +23,14 @@
#ifndef _EGG_MOD_BLOWFISH_BF_TAB_H
#define _EGG_MOD_BLOWFISH_BF_TAB_H
static u_32bit_t initbf_P[bf_N + 2] = {
static uint32_t initbf_P[bf_N + 2] = {
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b,
};
static u_32bit_t initbf_S[4][256] = {
static uint32_t initbf_S[4][256] = {
{
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
@@ -49,32 +49,32 @@ static char bf_mode[4];
/* Keep a set of rotating P & S boxes */
static struct box_t {
u_32bit_t *P;
u_32bit_t **S;
uint32_t *P;
uint32_t **S;
char key[81];
char keybytes;
time_t lastuse;
} box[BOXES];
/* static u_32bit_t bf_P[bf_N+2]; */
/* static u_32bit_t bf_S[4][256]; */
static u_32bit_t *bf_P;
static u_32bit_t **bf_S;
/* static uint32_t bf_P[bf_N+2]; */
/* static uint32_t bf_S[4][256]; */
static uint32_t *bf_P;
static uint32_t **bf_S;
static int blowfish_expmem()
{
int i, tot = 0;
for (i = 0; i < BOXES; i++)
if (box[i].P != NULL) {
tot += ((bf_N + 2) * sizeof(u_32bit_t));
tot += (4 * sizeof(u_32bit_t *));
tot += (4 * 256 * sizeof(u_32bit_t));
tot += ((bf_N + 2) * sizeof(uint32_t));
tot += (4 * sizeof(uint32_t *));
tot += (4 * 256 * sizeof(uint32_t));
}
return tot;
}
static void blowfish_encipher(u_32bit_t *xl, u_32bit_t *xr)
static void blowfish_encipher(uint32_t *xl, uint32_t *xr)
{
union aword Xl;
union aword Xr;
@@ -105,7 +105,7 @@ static void blowfish_encipher(u_32bit_t *xl, u_32bit_t *xr)
*xl = Xr.word;
}
static void blowfish_decipher(u_32bit_t *xl, u_32bit_t *xr)
static void blowfish_decipher(uint32_t *xl, uint32_t *xr)
{
union aword Xl;
union aword Xr;
@@ -158,13 +158,13 @@ static void blowfish_report(int idx, int details)
}
}
static void blowfish_init(u_8bit_t *key, int keybytes)
static void blowfish_init(uint8_t *key, int keybytes)
{
int i, j, bx;
time_t lowest;
u_32bit_t data;
u_32bit_t datal;
u_32bit_t datar;
uint32_t data;
uint32_t datal;
uint32_t datar;
union aword temp;
/* drummer: Fixes crash if key is longer than 80 char. This may cause the key
@@ -209,10 +209,10 @@ static void blowfish_init(u_8bit_t *key, int keybytes)
}
/* Initialize new buffer */
/* uh... this is over 4k */
box[bx].P = nmalloc((bf_N + 2) * sizeof(u_32bit_t));
box[bx].S = nmalloc(4 * sizeof(u_32bit_t *));
box[bx].P = nmalloc((bf_N + 2) * sizeof(uint32_t));
box[bx].S = nmalloc(4 * sizeof(uint32_t *));
for (i = 0; i < 4; i++)
box[bx].S[i] = nmalloc(256 * sizeof(u_32bit_t));
box[bx].S[i] = nmalloc(256 * sizeof(uint32_t));
bf_P = box[bx].P;
bf_S = box[bx].S;
box[bx].keybytes = keybytes;
@@ -288,7 +288,7 @@ static int cbcbase64dec(char c)
static void blowfish_encrypt_pass(char *text, char *new)
{
u_32bit_t left, right;
uint32_t left, right;
int n;
char *p;
@@ -317,7 +317,7 @@ static void blowfish_encrypt_pass(char *text, char *new)
*/
static char *encrypt_string_ecb(char *key, char *str)
{
u_32bit_t left, right;
uint32_t left, right;
unsigned char *p;
char *s, *dest, *d;
int i;
@@ -364,7 +364,7 @@ static char *encrypt_string_ecb(char *key, char *str)
*/
static char *encrypt_string_cbc(char *key, char *str)
{
u_32bit_t left, right, prevleft = 0, prevright = 0;
uint32_t left, right, prevleft = 0, prevright = 0;
unsigned char *p;
char *s, *dest;
int i, slen;
@@ -478,7 +478,7 @@ static char *encrypt_string(char *key, char *str)
*/
static char *decrypt_string_ecb(char *key, char *str)
{
u_32bit_t left, right;
uint32_t left, right;
char *p, *s, *dest, *d;
int i;
@@ -518,7 +518,7 @@ static char *decrypt_string_ecb(char *key, char *str)
*/
static char *decrypt_string_cbc(char *key, char *str)
{
u_32bit_t left, right, prevleft = 0, prevright = 0, prevencleft, prevencright;
uint32_t left, right, prevleft = 0, prevright = 0, prevencleft, prevencright;
unsigned char *p;
char *s, *dest;
int i, slen, dlen;
@@ -30,8 +30,8 @@
#define KEYBYTES 8
union aword {
u_32bit_t word;
u_8bit_t byte[4];
uint32_t word;
uint8_t byte[4];
struct {
#ifdef WORDS_BIGENDIAN
unsigned int byte0:8;
Oops, something went wrong.

0 comments on commit c616f0c

Please sign in to comment.