Changeset 121

Show
Ignore:
Timestamp:
05/07/04 15:59:03 (9 years ago)
Author:
aprilp
Message:

* Now we store both incoming and outgoing counters on server and expire if no activity at all on both
* Changed the structure of nodes a little

Location:
trunk/wifidog
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/ChangeLog

    r120 r121  
    11# $Header$ 
     22004-05-07  Philippe April <wifidog@philippeapril.com> 
     3    * Now we store both incoming and outgoing counters on server 
     4    and expire if no activity at all on both 
     5    * Changed the structure of nodes a little 
     6 
    272004-05-07  Philippe April <wifidog@philippeapril.com> 
    38    * New parameter ExternalInterface 
  • trunk/wifidog/src/auth.c

    r119 r121  
    102102        pthread_mutex_unlock(&nodes_mutex); 
    103103                 
    104         authenticate(&auth_response, ip, mac, token, 0); 
     104        authenticate(&auth_response, ip, mac, token, 0, 0); 
    105105         
    106106        pthread_mutex_lock(&nodes_mutex); 
     
    143143         
    144144    p1 = node_find_by_ip(node->ip); 
    145     p1->noactivity = time(NULL); 
    146145    switch(auth_response.authcode) { 
    147146        case AUTH_VALIDATION: 
  • trunk/wifidog/src/centralserver.c

    r119 r121  
    4949 
    5050int 
    51 authenticate(t_authresponse *authresponse, char *ip, char *mac, char *token, long int stats) 
     51authenticate(t_authresponse *authresponse, char *ip, char *mac, char *token, long int incoming, long int outgoing) 
    5252{ 
    5353        int sockfd, numbytes; 
     
    8181                return(-1); /* non-fatal */ 
    8282        } 
    83         sprintf(buf, "GET %s?ip=%s&mac=%s&token=%s&stats=%ld HTTP/1.1" 
     83        sprintf(buf, "GET %s?ip=%s&mac=%s&token=%s&incoming=%ld&outgoing=%ld HTTP/1.1" 
    8484                "\nHost: %s\n\n", config.authserv_path, ip, mac, token, 
    85                 stats, config.authserv_hostname); 
     85                incoming, outgoing, config.authserv_hostname); 
    8686        send(sockfd, buf, strlen(buf), 0); 
    8787 
  • trunk/wifidog/src/centralserver.h

    r95 r121  
    2828#define _CENTRALSERVER_H_ 
    2929 
    30 int authenticate(t_authresponse *authresponse, char *ip, char *mac, char *token, long int stats); 
     30int authenticate(t_authresponse *authresponse, char *ip, char *mac, char *token, long int incoming, long int outgoing); 
    3131 
    3232#endif /* _CENTRALSERVER_H_ */ 
  • trunk/wifidog/src/firewall.c

    r119 r121  
    200200fw_counter(void) 
    201201{ 
    202     FILE           *output; 
    203     unsigned long int counter; 
    204202    t_authresponse  authresponse; 
    205     unsigned int    tag, rc; 
    206     char            ip[255], 
    207                     mac[255], 
    208                     *script, 
    209                     *token; 
    210     t_node         *p1; 
    211  
    212     /* FIXME make iptables a DEFINE or something */ 
    213     asprintf(&script, "%s %s", "iptables", "-v -x -t mangle -L " TABLE_WIFIDOG_MARK); 
    214  
    215     if (!(output = popen(script, "r"))) { 
    216         debug(LOG_ERR, "popen(): %s", strerror(errno)); 
     203    char            *token, *ip; 
     204    t_node         *p1, *p2; 
     205 
     206    if (-1 == iptables_fw_counters()) { 
     207        debug(LOG_ERR, "Could not get counters from firewall!"); 
    217208        return; 
    218209    } 
    219210 
    220     free(script); 
    221  
    222     /* skip the first two lines */ 
    223     while (('\n' != fgetc(output)) && !feof(output)) 
    224         ; 
    225     while (('\n' != fgetc(output)) && !feof(output)) 
    226         ; 
    227     while (output && !(feof(output))) { 
    228         rc = fscanf(output, "%*s %lu %*s %*s %*s %*s %*s %s %*s %*s %s %*s %*s 0x%u", &counter, ip, mac, &tag); 
    229         if (4 == rc && EOF != rc) { 
    230             pthread_mutex_lock(&nodes_mutex); 
    231  
    232             p1 = node_find_by_ip(ip); 
    233  
    234             if (p1) { 
    235                 token = strdup(p1->token); 
    236  
    237                 pthread_mutex_unlock(&nodes_mutex); 
    238                 authenticate(&authresponse, ip, mac, token, counter); 
    239                 pthread_mutex_lock(&nodes_mutex); 
    240  
    241                 free(token); 
    242  
    243                 p1 = node_find_by_ip(ip); 
    244                 if (p1 == NULL) { 
    245                     /* FIXME We should not continue for this entry past this point */ 
    246                     debug(LOG_DEBUG, "Node %s was freed while being re-validated!", ip); 
     211    p1 = firstnode; 
     212 
     213    pthread_mutex_lock(&nodes_mutex); 
     214    p2 = firstnode; 
     215    while (NULL != (p1 = p2)) { 
     216        p2 = p1->next; 
     217        ip = strdup(p1->ip); 
     218        token = strdup(p1->token); 
     219        pthread_mutex_unlock(&nodes_mutex); 
     220        authenticate(&authresponse, p1->ip, p1->mac, token, p1->counters.incoming, p1->counters.outgoing); 
     221        pthread_mutex_lock(&nodes_mutex); 
     222 
     223        if (!(p1 = node_find_by_ip(ip))) { 
     224            debug(LOG_ERR, "Node %s was freed while being re-validated!", ip); 
     225        } else { 
     226            if (p1->counters.last_updated + 
     227                (config.checkinterval * config.clienttimeout) 
     228                <= time(NULL)) { 
     229                /* Timing out user */ 
     230                debug(LOG_INFO, "%s - Inactive for %ld seconds, removing node and denying in firewall", p1->ip, config.checkinterval * config.clienttimeout); 
     231                fw_deny(p1->ip, p1->mac, p1->tag); 
     232                node_delete(p1); 
     233            } else { 
     234                /* 
     235                 * This handles any change in 
     236                 * the status this allows us 
     237                 * to change the status of a 
     238                 * user while he's connected 
     239                 */ 
     240                switch (authresponse.authcode) { 
     241                    case AUTH_DENIED: 
     242 
     243                    case AUTH_VALIDATION_FAILED: 
     244                        debug(LOG_NOTICE, "%s - Validation timeout, now denied. Removing node and firewall rules", p1->ip); 
     245                        fw_deny(p1->ip, p1->mac, p1->tag); 
     246                        node_delete(p1); 
     247                        break; 
     248 
     249                    case AUTH_ALLOWED: 
     250                        if (p1->tag != MARK_KNOWN) { 
     251                            debug(LOG_INFO, "%s - Access has changed, refreshing firewall and clearing counters", p1->ip); 
     252                            fw_deny(p1->ip, p1->mac, p1->tag); 
     253                            p1->tag = MARK_KNOWN; 
     254                            p1->counters.incoming = p1->counters.outgoing = 0; 
     255                            fw_allow(p1->ip, p1->mac, p1->tag); 
     256                        } 
     257                        break; 
     258 
     259                    case AUTH_VALIDATION: 
     260                        /* 
     261                         * Do nothing, user 
     262                         * is in validation 
     263                         * period 
     264                         */ 
     265                        debug(LOG_INFO, "%s - User in validation period", p1->ip); 
     266                        break; 
     267 
     268                    default: 
     269                        debug(LOG_DEBUG, "I do not know about authentication code %d", authresponse.authcode); 
     270                        break; 
    247271                } 
    248                 debug(LOG_DEBUG, "%s - Counter currently %ld, new counter %ld", p1->ip, p1->counter, counter); 
    249                 if (counter > p1->counter) { 
    250                     p1->counter = counter; 
    251                     debug(LOG_INFO, "%s - Updated counter to %ld bytes", p1->ip, p1->counter); 
    252                     p1->noactivity = time(NULL); 
    253                 } else { 
    254                     debug(LOG_INFO, "%s - Recorded no activity since %ld", p1->ip, p1->noactivity); 
    255                 } 
    256                 if (p1->noactivity + 
    257                     (config.checkinterval * config.clienttimeout) 
    258                     <= time(NULL)) { 
    259                     /* Timing out user */ 
    260                     debug(LOG_INFO, "%s - Inactive for %ld seconds, removing node and denying in firewall", ip, config.checkinterval * config.clienttimeout); 
    261                     fw_deny(p1->ip, p1->mac, p1->tag); 
    262                     node_delete(p1); 
    263                 } else { 
    264                     /* 
    265                      * This handles any change in 
    266                      * the status this allows us 
    267                      * to change the status of a 
    268                      * user while he's connected 
    269                      */ 
    270                     switch (authresponse.authcode) { 
    271                         case AUTH_DENIED: 
    272  
    273                         case AUTH_VALIDATION_FAILED: 
    274                             debug(LOG_NOTICE, "%s - Validation timeout, now denied. Removing node and firewall rules", ip); 
    275                             fw_deny(p1->ip, p1->mac, p1->tag); 
    276                             node_delete(p1); 
    277                             break; 
    278  
    279                         case AUTH_ALLOWED: 
    280                             if (p1->tag != MARK_KNOWN) { 
    281                                 debug(LOG_INFO, "%s - Access has changed, refreshing firewall and clearing counters", ip); 
    282                                 fw_deny(p1->ip, p1->mac, p1->tag); 
    283                                 p1->tag = MARK_KNOWN; 
    284                                 p1->counter = 0; 
    285                                 fw_allow(p1->ip, p1->mac, p1->tag); 
    286                             } 
    287                             break; 
    288  
    289                         case AUTH_VALIDATION: 
    290                             /* 
    291                              * Do nothing, user 
    292                              * is in validation 
    293                              * period 
    294                              */ 
    295                             debug(LOG_INFO, "%s - User in validation period", ip); 
    296                             break; 
    297  
    298                         default: 
    299                             debug(LOG_DEBUG, "I do not know about authentication code %d", authresponse.authcode); 
    300                             break; 
    301                     } 
    302                 } 
    303                 pthread_mutex_unlock(&nodes_mutex); 
    304             } else { 
    305                 /* Node was not found in list, FIXME remove from firewall rules */ 
    306                 debug(LOG_NOTICE, "Node %s was not found in list", ip); 
    307272            } 
    308273        } 
    309     } 
    310     pclose(output); 
     274 
     275        free(token); 
     276        free(ip); 
     277    } 
     278    pthread_mutex_unlock(&nodes_mutex); 
     279 
     280 
     281//            debug(LOG_DEBUG, "%s - Counter currently %ld, new counter %ld", p1->ip, p1->counter, counters[i]->outgoing); 
     282// 
     283//                if (counters[i]->outgoing > p1->counter) { 
     284//                    p1->counter = counters[i]->outgoing; 
     285//                    debug(LOG_INFO, "%s - Updated counter to %ld bytes", p1->ip, p1->counter); 
     286//                    p1->noactivity = time(NULL); 
     287//                } else { 
     288//                    debug(LOG_INFO, "%s - Recorded no activity since %ld", p1->ip, p1->noactivity); 
     289//                } 
     290//                if (p1->noactivity + 
     291//                    (config.checkinterval * config.clienttimeout) 
     292//                    <= time(NULL)) { 
     293//                    /* Timing out user */ 
     294//                    debug(LOG_INFO, "%s - Inactive for %ld seconds, removing node and denying in firewall", p1->ip, config.checkinterval * config.clienttimeout); 
     295//                    fw_deny(p1->ip, p1->mac, p1->tag); 
     296//                    node_delete(p1); 
     297//                } else { 
     298//                    /* 
     299//                     * This handles any change in 
     300//                     * the status this allows us 
     301//                     * to change the status of a 
     302//                     * user while he's connected 
     303//                     */ 
     304//                    switch (authresponse.authcode) { 
     305//                        case AUTH_DENIED: 
     306// 
     307//                        case AUTH_VALIDATION_FAILED: 
     308//                            debug(LOG_NOTICE, "%s - Validation timeout, now denied. Removing node and firewall rules", p1->ip); 
     309//                            fw_deny(p1->ip, p1->mac, p1->tag); 
     310//                            node_delete(p1); 
     311//                            break; 
     312// 
     313//                        case AUTH_ALLOWED: 
     314//                            if (p1->tag != MARK_KNOWN) { 
     315//                                debug(LOG_INFO, "%s - Access has changed, refreshing firewall and clearing counters", p1->ip); 
     316//                                fw_deny(p1->ip, p1->mac, p1->tag); 
     317//                                p1->tag = MARK_KNOWN; 
     318//                                p1->counter = 0; 
     319//                                fw_allow(p1->ip, p1->mac, p1->tag); 
     320//                            } 
     321//                            break; 
     322// 
     323//                        case AUTH_VALIDATION: 
     324//                            /* 
     325//                             * Do nothing, user 
     326//                             * is in validation 
     327//                             * period 
     328//                             */ 
     329//                            debug(LOG_INFO, "%s - User in validation period", p1->ip); 
     330//                            break; 
     331// 
     332//                        default: 
     333//                            debug(LOG_DEBUG, "I do not know about authentication code %d", authresponse.authcode); 
     334//                            break; 
     335//                    } 
     336//                } 
     337//        } else { 
     338//            /* Node was not found in list, FIXME remove from firewall rules */ 
     339//            debug(LOG_NOTICE, "Node %s was not found in list", counters[i]->ip); 
     340//        } 
     341//        pthread_mutex_unlock(&nodes_mutex); 
     342//    } 
     343 
    311344} 
    312345 
     
    331364 * @param token Token 
    332365 * @param counter Value of the counter at creation (usually 0) 
    333  * @param active Is the node active, or not 
    334366 * @return Pointer to the node we just created 
    335367 */ 
    336368t_node         * 
    337 node_add(char *ip, char *mac, char *token, long int counter, int active) 
     369node_add(char *ip, char *mac, char *token) 
    338370{ 
    339371    t_node         *curnode, *prevnode; 
     
    358390    curnode->mac = strdup(mac); 
    359391    curnode->token = strdup(token); 
    360     curnode->counter = counter; 
    361     curnode->active = active; 
     392    curnode->counters.incoming = curnode->counters.outgoing = 0; 
     393    curnode->counters.last_updated = time(NULL); 
    362394 
    363395    if (prevnode == NULL) { 
  • trunk/wifidog/src/firewall.h

    r114 r121  
    3434} t_marks; 
    3535 
     36typedef struct counters_t_ { 
     37    long int incoming; 
     38    long int outgoing; 
     39    long int last_updated; 
     40} counters_t; 
     41 
    3642typedef struct _t_node { 
    3743        struct  _t_node *next; 
    38         char    *ip, 
    39                 *mac, 
    40                 *token; 
    41         int     active, /* boolean */ 
    42         noactivity, /* seconds since there has not been activity */ 
    43         tag, /* the MARK in the firewall */ 
    44                 fd;     /* socket */ 
    45         long    int     counter; 
     44        char *ip; 
     45    char *mac; 
     46        char *token; 
     47 
     48    /* the MARK in the firewall */ 
     49    unsigned int tag; 
     50 
     51    /* socket */ 
     52        int     fd; 
     53 
     54    /* the counters */ 
     55        counters_t counters; 
    4656} t_node; 
    4757 
     
    5565 
    5666void node_init(void); 
    57 t_node *node_add(char *ip, char *mac, char *token, long int counter, 
    58                 int active); 
     67t_node *node_add(char *ip, char *mac, char *token); 
    5968t_node *node_find_by_ip(char *ip); 
    6069t_node *node_find_by_token(char *token); 
  • trunk/wifidog/src/http.c

    r119 r121  
    111111                                debug(LOG_DEBUG, "New node for %s", 
    112112                                        webserver->clientAddr); 
    113                                 node_add(webserver->clientAddr, mac, 
    114                                         token->value, 0, 0); 
     113                                node_add(webserver->clientAddr, mac, token->value); 
    115114                        } else { 
    116115                                debug(LOG_DEBUG, "Node for %s already " 
     
    130129                         
    131130                        /* start sub process */ 
    132                         pthread_create(&tid, NULL, (void *)auth_thread, 
    133                                         (void *)ip); 
     131                        pthread_create(&tid, NULL, (void *)auth_thread, (void *)ip); 
    134132                        pthread_detach(tid); 
    135133 
  • trunk/wifidog/src/iptables.c

    r120 r121  
    3131#include <stdlib.h> 
    3232#include <stdarg.h> 
     33#include <syslog.h> 
     34#include <errno.h> 
     35#include <string.h> 
     36#include <pthread.h> 
    3337 
    3438#include "conf.h" 
    3539#include "iptables.h" 
    3640#include "firewall.h" 
    37  
     41#include "debug.h" 
     42 
     43extern pthread_mutex_t  nodes_mutex; 
    3844extern s_config config; 
    3945extern int fw_quiet; 
     
    100106    iptables_do_command("-t nat -I PREROUTING 1 -i %s -j " TABLE_WIFIDOG_CLASS, config.gw_interface); 
    101107 
    102     iptables_do_command("-t mangle -N " TABLE_WIFIDOG_MARK); 
    103     iptables_do_command("-t mangle -I PREROUTING 1 -i %s -j " TABLE_WIFIDOG_MARK, config.gw_interface); 
    104  
    105     iptables_do_command("-t mangle -N " TABLE_WIFIDOG_TRAFFIC); 
    106     iptables_do_command("-t mangle -I FORWARD 1 -i %s -j " TABLE_WIFIDOG_TRAFFIC, config.external_interface); 
     108    iptables_do_command("-t mangle -N " TABLE_WIFIDOG_OUTGOING); 
     109    iptables_do_command("-t mangle -I PREROUTING 1 -i %s -j " TABLE_WIFIDOG_OUTGOING, config.gw_interface); 
     110 
     111    iptables_do_command("-t mangle -N " TABLE_WIFIDOG_INCOMING); 
     112    iptables_do_command("-t mangle -I FORWARD 1 -i %s -j " TABLE_WIFIDOG_INCOMING, config.external_interface); 
    107113 
    108114    return 1; 
     
    123129    fw_quiet = 1; 
    124130    iptables_do_command("-t nat -F " TABLE_WIFIDOG_CLASS); 
    125     iptables_do_command("-t mangle -F " TABLE_WIFIDOG_MARK); 
    126     iptables_do_command("-t mangle -F " TABLE_WIFIDOG_TRAFFIC); 
     131    iptables_do_command("-t mangle -F " TABLE_WIFIDOG_OUTGOING); 
     132    iptables_do_command("-t mangle -F " TABLE_WIFIDOG_INCOMING); 
    127133 
    128134    iptables_do_command("-t nat -F " TABLE_WIFIDOG_VALIDATE); 
     
    146152    rc = 0; 
    147153    for (tries = 0; tries < 10 && rc == 0; tries++) { 
    148         rc = iptables_do_command("-t mangle -D PREROUTING -i %s -j " TABLE_WIFIDOG_MARK, config.gw_interface); 
    149     } 
    150     iptables_do_command("-t mangle -X " TABLE_WIFIDOG_MARK); 
     154        rc = iptables_do_command("-t mangle -D PREROUTING -i %s -j " TABLE_WIFIDOG_OUTGOING, config.gw_interface); 
     155    } 
     156    iptables_do_command("-t mangle -X " TABLE_WIFIDOG_OUTGOING); 
    151157 
    152158    rc = 0; 
    153159    for (tries = 0; tries < 10 && rc == 0; tries++) { 
    154         rc = iptables_do_command("-t mangle -D FORWARD -i %s -j " TABLE_WIFIDOG_TRAFFIC, config.external_interface); 
    155     } 
    156     iptables_do_command("-t mangle -X " TABLE_WIFIDOG_TRAFFIC); 
     160        rc = iptables_do_command("-t mangle -D FORWARD -i %s -j " TABLE_WIFIDOG_INCOMING, config.external_interface); 
     161    } 
     162    iptables_do_command("-t mangle -X " TABLE_WIFIDOG_INCOMING); 
    157163 
    158164    return 1; 
     
    167173    switch(type) { 
    168174        case FW_ACCESS_ALLOW: 
    169             iptables_do_command("-t mangle -A " TABLE_WIFIDOG_MARK " -s %s -m mac --mac-source %s -j MARK --set-mark %d", ip, mac, tag); 
    170             rc = iptables_do_command("-t mangle -A " TABLE_WIFIDOG_TRAFFIC " -d %s -j ACCEPT", ip); 
     175            iptables_do_command("-t mangle -A " TABLE_WIFIDOG_OUTGOING " -s %s -m mac --mac-source %s -j MARK --set-mark %d", ip, mac, tag); 
     176            rc = iptables_do_command("-t mangle -A " TABLE_WIFIDOG_INCOMING " -d %s -j ACCEPT", ip); 
    171177            break; 
    172178        case FW_ACCESS_DENY: 
    173             iptables_do_command("-t mangle -D " TABLE_WIFIDOG_MARK " -s %s -m mac --mac-source %s -j MARK --set-mark %d", ip, mac, tag); 
    174             rc = iptables_do_command("-t mangle -D " TABLE_WIFIDOG_TRAFFIC " -d %s -j ACCEPT", ip); 
     179            iptables_do_command("-t mangle -D " TABLE_WIFIDOG_OUTGOING " -s %s -m mac --mac-source %s -j MARK --set-mark %d", ip, mac, tag); 
     180            rc = iptables_do_command("-t mangle -D " TABLE_WIFIDOG_INCOMING " -d %s -j ACCEPT", ip); 
    175181            break; 
    176182        default: 
     
    182188} 
    183189 
     190int 
     191iptables_fw_counters(void) 
     192{ 
     193    FILE *output; 
     194    char *script, 
     195        ip[16], 
     196        rc; 
     197    unsigned long int counter; 
     198    t_node *p1; 
     199 
     200    /* Look for outgoing traffic */ 
     201    asprintf(&script, "%s %s", "iptables", "-v -x -t mangle -L " TABLE_WIFIDOG_OUTGOING); 
     202    if (!(output = popen(script, "r"))) { 
     203        debug(LOG_ERR, "popen(): %s", strerror(errno)); 
     204        return -1; 
     205    } 
     206    free(script); 
     207 
     208    /* skip the first two lines */ 
     209    while (('\n' != fgetc(output)) && !feof(output)) 
     210        ; 
     211    while (('\n' != fgetc(output)) && !feof(output)) 
     212        ; 
     213    while (output && !(feof(output))) { 
     214        rc = fscanf(output, "%*s %lu %*s %*s %*s %*s %*s %s %*s %*s %*s %*s %*s 0x%*u", &counter, ip); 
     215        if (2 == rc && EOF != rc) { 
     216            debug(LOG_DEBUG, "Outgoing %s Bytes=%ld", ip, counter); 
     217            pthread_mutex_lock(&nodes_mutex); 
     218            if ((p1 = node_find_by_ip(ip))) { 
     219                if (p1->counters.outgoing < counter) { 
     220                    p1->counters.outgoing = counter; 
     221                    p1->counters.last_updated = time(NULL); 
     222                    debug(LOG_DEBUG, "%s - Updated counter to %ld bytes", ip, counter); 
     223                } 
     224            } else { 
     225                debug(LOG_ERR, "Could not find %s in node list", ip); 
     226            } 
     227            pthread_mutex_unlock(&nodes_mutex); 
     228        } 
     229    } 
     230    pclose(output); 
     231 
     232    /* Look for incoming traffic */ 
     233    asprintf(&script, "%s %s", "iptables", "-v -x -t mangle -L " TABLE_WIFIDOG_INCOMING); 
     234    if (!(output = popen(script, "r"))) { 
     235        debug(LOG_ERR, "popen(): %s", strerror(errno)); 
     236        return -1; 
     237    } 
     238    free(script); 
     239 
     240    /* skip the first two lines */ 
     241    while (('\n' != fgetc(output)) && !feof(output)) 
     242        ; 
     243    while (('\n' != fgetc(output)) && !feof(output)) 
     244        ; 
     245    while (output && !(feof(output))) { 
     246        rc = fscanf(output, "%*s %lu %*s %*s %*s %*s %*s %*s %s", &counter, ip); 
     247        if (2 == rc && EOF != rc) { 
     248            debug(LOG_DEBUG, "Incoming %s Bytes=%ld", ip, counter); 
     249            pthread_mutex_lock(&nodes_mutex); 
     250            if ((p1 = node_find_by_ip(ip))) { 
     251                if (p1->counters.incoming < counter) { 
     252                    p1->counters.incoming = counter; 
     253                    p1->counters.last_updated = time(NULL); 
     254                    debug(LOG_DEBUG, "%s - Updated counter to %ld bytes", ip, counter); 
     255                } 
     256            } else { 
     257                debug(LOG_ERR, "Could not find %s in node list", ip); 
     258            } 
     259            pthread_mutex_unlock(&nodes_mutex); 
     260        } 
     261    } 
     262    pclose(output); 
     263 
     264    return 1; 
     265} 
     266 
  • trunk/wifidog/src/iptables.h

    r120 r121  
    2828#define _IPTABLES_H_ 
    2929 
    30 #define TABLE_WIFIDOG_MARK      "WiFiDog_Mark" 
     30#include "firewall.h" 
     31 
    3132#define TABLE_WIFIDOG_CLASS     "WiFiDog_Class" 
    32 #define TABLE_WIFIDOG_TRAFFIC   "WiFiDog_Traffic" 
     33#define TABLE_WIFIDOG_OUTGOING  "WiFiDog_Outgoing" 
     34#define TABLE_WIFIDOG_INCOMING  "WiFiDog_Incoming" 
    3335 
    3436#define TABLE_WIFIDOG_VALIDATE  "WiFiDog_Validate" 
     
    4648int iptables_fw_destroy(void); 
    4749int iptables_fw_access(fw_access_t type, char *ip, char *mac, int tag); 
     50int iptables_fw_counters(void); 
    4851 
    4952#endif /* _IPTABLES_H_ */