gods

a simple blocklist for ssh
Log | Files | Refs | README | LICENSE

commit 008cdacd3f1d2117cf8e562a17001449205467ce
parent 278996e4b98821cf9c2ea5b19b5253a247e3c7cf
Author: Naveen Narayanan <zerous@nocebo.space>
Date:   Mon, 27 Sep 2021 21:56:20 +0200

Implement init()

Diffstat:
Mmain.c | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/main.c b/main.c @@ -1,9 +1,11 @@ #include <errno.h> #include <stdio.h> #include <string.h> +#include <time.h> #include "attack.h" #include "fw.h" +#include "parser.h" #include "queue.h" #define BUFSZ 512 @@ -34,6 +36,17 @@ unban(struct attacker *a, struct lhead *headp) fw_unblock(ap->ip); } +void +init(struct attacker *a) +{ + printf("attacker: %p\n", a); + strcpy(a->ip, ip); + a->nban = -1; + a->last = time(NULL); + printf("init: %s %d %ld\n", + a->ip, a->nban, a->last); +} + int main(int argc, char **argv) {