| 1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
|---|
| 2 |
|
|---|
| 3 |
/* Cherokee |
|---|
| 4 |
* |
|---|
| 5 |
* Authors: |
|---|
| 6 |
* Alvaro Lopez Ortega <alvaro@alobbs.com> |
|---|
| 7 |
* |
|---|
| 8 |
* Copyright (C) 2001-2008 Alvaro Lopez Ortega |
|---|
| 9 |
* |
|---|
| 10 |
* This program is free software; you can redistribute it and/or |
|---|
| 11 |
* modify it under the terms of version 2 of the GNU General Public |
|---|
| 12 |
* License as published by the Free Software Foundation. |
|---|
| 13 |
* |
|---|
| 14 |
* This program is distributed in the hope that it will be useful, |
|---|
| 15 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 |
* GNU General Public License for more details. |
|---|
| 18 |
* |
|---|
| 19 |
* You should have received a copy of the GNU General Public License |
|---|
| 20 |
* along with this program; if not, write to the Free Software |
|---|
| 21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|---|
| 22 |
* USA |
|---|
| 23 |
*/ |
|---|
| 24 |
|
|---|
| 25 |
#ifndef CHEROKEE_ACCESS_H |
|---|
| 26 |
#define CHEROKEE_ACCESS_H |
|---|
| 27 |
|
|---|
| 28 |
#include "common-internal.h" |
|---|
| 29 |
#include "list.h" |
|---|
| 30 |
#include "socket.h" |
|---|
| 31 |
|
|---|
| 32 |
typedef struct { |
|---|
| 33 |
cherokee_list_t list_ips; |
|---|
| 34 |
cherokee_list_t list_subnets; |
|---|
| 35 |
} cherokee_access_t; |
|---|
| 36 |
|
|---|
| 37 |
ret_t cherokee_access_new (cherokee_access_t **entry); |
|---|
| 38 |
ret_t cherokee_access_free (cherokee_access_t *entry); |
|---|
| 39 |
|
|---|
| 40 |
ret_t cherokee_access_add (cherokee_access_t *entry, char *ip_or_subnet); |
|---|
| 41 |
ret_t cherokee_access_ip_match (cherokee_access_t *entry, cherokee_socket_t *sock); |
|---|
| 42 |
|
|---|
| 43 |
ret_t cherokee_access_print_debug (cherokee_access_t *entry); |
|---|
| 44 |
|
|---|
| 45 |
#endif /* CHEROKEE_ACCESS_H */ |
|---|