big int to stdint switch

This commit is contained in:
van Hauser 2017-07-05 08:48:00 +02:00
commit f124c26fc6
73 changed files with 1364 additions and 1235 deletions

View file

@ -3,7 +3,7 @@
extern char *HYDRA_EXIT;
char *buf;
int start_redis(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) {
int32_t start_redis(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE * fp) {
char *pass, buffer[510];
char *empty = "";
@ -11,7 +11,7 @@ int start_redis(int s, char *ip, int port, unsigned char options, char *miscptr,
pass = empty;
char pass_num[50];
int pass_len = strlen(pass);
int32_t pass_len = strlen(pass);
snprintf(pass_num, 50, "%d", pass_len);
memset(buffer, 0, sizeof(buffer));
@ -51,9 +51,9 @@ int start_redis(int s, char *ip, int port, unsigned char options, char *miscptr,
return 1;
}
void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname, int tls) {
int run = 1, next_run = 1, sock = -1;
int myport = PORT_REDIS, mysslport = PORT_REDIS_SSL;
void service_redis_core(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE * fp, int32_t port, char *hostname, int32_t tls) {
int32_t run = 1, next_run = 1, sock = -1;
int32_t myport = PORT_REDIS, mysslport = PORT_REDIS_SSL;
hydra_register_socket(sp);
if (memcmp(hydra_get_next_pair(), &HYDRA_EXIT, sizeof(HYDRA_EXIT)) == 0)
@ -77,7 +77,7 @@ void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr,
}
if (sock < 0) {
if (verbose || debug)
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int) getpid());
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int32_t) getpid());
hydra_child_exit(1);
}
usleepn(250);
@ -103,7 +103,7 @@ void service_redis_core(char *ip, int sp, unsigned char options, char *miscptr,
}
}
void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
void service_redis(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE * fp, int32_t port, char *hostname) {
service_redis_core(ip, sp, options, miscptr, fp, port, hostname, 0);
}
@ -122,7 +122,7 @@ void service_redis(char *ip, int sp, unsigned char options, char *miscptr, FILE
* (error) ERR operation not permitted (for older redis versions)
* That is used for initial password authentication and redis server response tests in service_redis_init
*/
int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
int32_t service_redis_init(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE * fp, int32_t port, char *hostname) {
// called before the childrens are forked off, so this is the function
// which should be filled if initial connections and service setup has to be
// performed once only.
@ -130,8 +130,8 @@ int service_redis_init(char *ip, int sp, unsigned char options, char *miscptr, F
// 0 - when the server is redis and it requires password
// 1 - when the server is not redis or when the server does not require password
int sock = -1;
int myport = PORT_REDIS, mysslport = PORT_REDIS_SSL;
int32_t sock = -1;
int32_t myport = PORT_REDIS, mysslport = PORT_REDIS_SSL;
char buffer[] = "*1\r\n$4\r\nping\r\n";
hydra_register_socket(sp);