Skip to content
This repository was archived by the owner on Aug 4, 2019. It is now read-only.

Commit 1cbcdfe

Browse files
committed
exposed whitelist and blacklist functions from repsheet.h
1 parent 45fc5d4 commit 1cbcdfe

File tree

10 files changed

+7
-27
lines changed

10 files changed

+7
-27
lines changed

src/blacklist.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "common.h"
44
#include "cidr.h"
55

6-
#include "blacklist.h"
76
#include "check_cidr.h"
87

98
/**

src/blacklist.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/librepsheet.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
#include "config.h"
77
#include "repsheet.h"
8-
#include "whitelist.h"
9-
#include "blacklist.h"
108

119
/**
1210
* @file librepsheet.c

src/repsheet.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ int actor_status(redisContext *context, const char *actor, int type, char *reaso
3131
int remote_address(char *connected_address, char *xff_header, char *address);
3232

3333
int blacklist(redisContext *context, const char *actor, int type, const char *reason);
34+
int is_ip_blacklisted(redisContext *context, const char *actor, char *reason);
35+
int is_user_blacklisted(redisContext *context, const char *actor, char *reason);
36+
3437
int whitelist(redisContext *context, const char *actor, int type, const char *reason);
38+
int is_ip_whitelisted(redisContext *context, const char *actor, char *reason);
39+
int is_user_whitelisted(redisContext *context, const char *actor, char *reason);
40+
int is_country_whitelisted(redisContext *context, const char *country_code);
41+
3542
int mark(redisContext *context, const char *actor, int type, const char *reason);
3643
int is_ip_marked(redisContext *context, const char *actor, char *reason);
3744
int is_user_marked(redisContext *context, const char *actor, char *reason);

src/whitelist.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "common.h"
44
#include "cidr.h"
55
#include "check_cidr.h"
6-
#include "whitelist.h"
76

87

98
/**

src/whitelist.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ test_runner_SOURCES = librepsheet_test.c \
1616
../src/check_cidr.h \
1717
../src/check_cidr.c \
1818
../src/blacklist.c \
19-
../src/blacklist.h \
2019
../src/whitelist.c \
21-
../src/whitelist.h \
2220
../src/marked.c \
2321
../src/xff.c \
2422
../src/xff.h \

test/blacklist_test.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <hiredis/hiredis.h>
22
#include "../src/repsheet.h"
3-
#include "../src/blacklist.h"
43
#include "check.h"
54

65
redisContext *context;

test/librepsheet_test.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#include <hiredis/hiredis.h>
22
#include "../src/repsheet.h"
3-
#include "../src/whitelist.h"
4-
#include "../src/blacklist.h"
53
#include "check.h"
64
#include <unistd.h>
75

test/whitelist_test.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <hiredis/hiredis.h>
22
#include "../src/repsheet.h"
3-
#include "../src/whitelist.h"
43
#include "check.h"
54

65
redisContext *context;

0 commit comments

Comments
 (0)