root/trunk/wifidog/src/firewall.h @ 64

Revision 64, 2.2 KB (checked in by alexcv, 9 years ago)

Switched to threads

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/********************************************************************\
2 * This program is free software; you can redistribute it and/or    *
3 * modify it under the terms of the GNU General Public License as   *
4 * published by the Free Software Foundation; either version 2 of   *
5 * the License, or (at your option) any later version.              *
6 *                                                                  *
7 * This program is distributed in the hope that it will be useful,  *
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
10 * GNU General Public License for more details.                     *
11 *                                                                  *
12 * You should have received a copy of the GNU General Public License*
13 * along with this program; if not, contact:                        *
14 *                                                                  *
15 * Free Software Foundation           Voice:  +1-617-542-5942       *
16 * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
17 * Boston, MA  02111-1307,  USA       gnu@gnu.org                   *
18 *                                                                  *
19\********************************************************************/
20
21/* $Header$ */
22/** @file firewall.h
23    @brief Firewall update functions
24    @author Copyright (C) 2004 Philippe April <papril777@yahoo.com>
25*/
26
27#ifndef _FIREWALL_H_
28#define _FIREWALL_H_
29
30typedef struct _t_node {
31        struct  _t_node *next;
32        char    *ip,
33                *mac,
34                *token;
35        int     active, /* boolean */
36                fd;     /* socket */
37        long    int     counter;
38        UserRights      *rights;
39} t_node;
40
41int fw_init(void);
42int fw_destroy(void);
43int fw_allow(char *ip, char *mac, int profile);
44int fw_deny(char *ip, char *mac, int profile);
45void fw_counter(void);
46int execute(char **argv);
47char *arp_get(char *req_ip);
48
49void node_init(void);
50t_node *node_add(char *ip, char *mac, char *token, long int counter,
51                int active);
52t_node *node_find_by_ip(char *ip);
53t_node *node_find_by_token(char *token);
54void node_delete(t_node *node);
55void free_node(t_node *node);
56
57int check_userrights(t_node *node);
58
59#endif /* _FIREWALL_H_ */
Note: See TracBrowser for help on using the browser.