#include <stdlib.h>
#include <string.h>
#include "hiredis/hiredis.h"
#include "config.h"
#include "repsheet.h"
- Author
- Aaron Bedra
- Date
- 5/19/2014
int actor_status |
( |
redisContext * |
context, |
|
|
const char * |
actor, |
|
|
int |
type, |
|
|
char * |
reason |
|
) |
| |
Top level API for determining the status of an actor
- Parameters
-
context | the Redis connection |
actor | the IP address or user value of the actor |
type | IP or USER |
reason | return the reason if whitelisted, blacklisted, or marked. |
- Returns
- an integer status
int check_connection |
( |
redisContext * |
context | ) |
|
Tests the connection to ensure it is working properly
- Parameters
-
context | the Redis connection |
- Returns
- an integer response with the connection status
redisContext* get_redis_context |
( |
const char * |
host, |
|
|
int |
port, |
|
|
int |
timeout |
|
) |
| |
This function establishes a connection to Redis with a connect time out
- Parameters
-
host | the hostname of the Redis server |
port | the port number of the Redis server |
timeout | the length in milliseconds before the connection times out |
- Returns
- a Redis connection
redisContext* repsheet_connect |
( |
const char * |
host, |
|
|
int |
port, |
|
|
int |
connect_timeout, |
|
|
int |
read_timeout |
|
) |
| |
This function establishes a connection to Redis with a connect and request time out
- Parameters
-
host | the hostname of the Redis server |
port | the port number of the Redis server |
connect_timeout | the length in milliseconds before the connection times out |
read_timeout | the length in milliseconds before a request times out |
- Returns
- a Redis connection
int repsheet_reconnect |
( |
redisContext * |
context | ) |
|
Tests the connection to ensure it is working properly
- Parameters
-
context | the Redis connection |
- Returns
- an integer response with the connection status