Changeset 81

Show
Ignore:
Timestamp:
04/17/04 15:03:54 (9 years ago)
Author:
alexcv
Message:

Updated documentation in friewall.c

Location:
trunk/wifidog
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/ChangeLog

    r80 r81  
     1# $Header$ 
     2 
     32004-04-16  Alexandre Carmel-Veilleux <acv@acv.ca> 
     4        * Updated documentation in firewall.c 
     5 
    162004-04-17  Philippe April <papril777@yahoo.com> 
    27        * Fixed path returning to gateway in phpauth/login/index.php 
     
    611 
    7122004-04-16  Philippe April <papril777@yahoo.com> 
    8     * Fixed CRLF/formatting in phpauth/login/index.php 
    9     * Added some documentation for firewall.c, commandline.c 
    10     * Removed an unnecessary line dist_sysconf_DATA from Makefile.am 
     13        * Fixed CRLF/formatting in phpauth/login/index.php 
     14        * Added some documentation for firewall.c, commandline.c 
     15        * Removed an unnecessary line dist_sysconf_DATA from Makefile.am 
    1116 
    12172004-04-15  Alexandre Carmel-Veilleux <acv@acv.ca> 
     
    6772 
    68732004-03-13  Philippe April <papril777@yahoo.com> 
    69     * Modified the way firewall scripts are called so we can configure 
    70     them in the config file (a bit more modular than it was) 
    71     * Added simple linked list to keep track of clients and to 
    72     keep a counter of the utilization and send it to the auth 
    73     server 
    74     * Fixed CRLF/formatting in phpauth/auth/index.php 
    75     * Hacked phpauth/auth/index.php to handle very basic utilization tracking 
     74        * Modified the way firewall scripts are called so we can configure 
     75        them in the config file (a bit more modular than it was) 
     76        * Added simple linked list to keep track of clients and to 
     77        keep a counter of the utilization and send it to the auth server 
     78        * Fixed CRLF/formatting in phpauth/auth/index.php 
     79        * Hacked phpauth/auth/index.php to handle very basic utilization tracking 
    7680 
    77812004-03-12  Philippe April <papril777@yahoo.com> 
    78     * Changed all perror()s into debug()s and added 
    79     errno.h to common.h 
     82        * Changed all perror()s into debug()s and added errno.h to common.h 
    8083 
    81842004-03-10  Philippe April <papril777@yahoo.com> 
    82     * Small fix to firewall.c so we don't define variables after 
    83     the function has started (so it builds on gcc-2.95) 
     85        * Small fix to firewall.c so we don't define variables after 
     86        the function has started (so it builds on gcc-2.95) 
    8487 
    85882004-03-09  Philippe April <papril777@yahoo.com> 
    86     * Major changes: not forking anymore for new connections, now using 
    87     select() instead. It will allow us to efficiently use a linked list to track 
    88     users and other things. It introduces some bugs and design issues but will 
    89     be better in the end. 
     89        * Major changes, not forking anymore for new connections, now using 
     90        select() instead. It will allow us to efficiently use a linked list to track 
     91        users and other things. It introduces some bugs and design issues but will 
     92        be better in the end. 
    9093 
    91942004-03-09  Philippe April <papril777@yahoo.com> 
    92     * Small fix in the default.php login page 
    93     * exit() where the program was supposed to exit but wasn't when the 
    94     firewall could not be setup 
     95        * Small fix in the default.php login page 
     96        * exit() where the program was supposed to exit but wasn't when the 
     97        firewall could not be setup 
    9598 
    96992004-03-09  Alexandre Carmel-Veilleux <acv@acv.ca> 
  • trunk/wifidog/src/firewall.c

    r75 r81  
    242242                        if (rc == 4 && rc != EOF) { 
    243243 
    244                                 /* TODO If the client is not active for x 
    245                                  * seconds timeout the client and destroy token. 
    246                                  * Maybe this should be done on the auth 
    247                                  * server */ 
    248                          
    249244                                pthread_mutex_lock(&nodes_mutex); 
    250245 
     
    252247 
    253248                                if (p1->counter == counter) { 
     249                                        /* expire clients for inactivity */ 
    254250                                        debug(D_LOG_DEBUG, "Client %s was " 
    255251                                                "inactive", ip); 
     
    313309} 
    314310 
     311/** 
     312 * @brief Initializes the list of connected clients (node) 
     313 */ 
    315314void 
    316315node_init(void) 
     
    320319} 
    321320 
     321/** 
     322 * @brief Adds a new node to the connections list 
     323 * 
     324 * Based on the parameters it receives, this function creates a new entry 
     325 * in the connections list. All the memory allocation is done here. 
     326 */ 
    322327t_node * 
    323328node_add(char *ip, char *mac, char *token, long int counter, int active) 
     
    361366} 
    362367 
     368/** 
     369 * @brief Finds a specific node by its IP 
     370 */ 
    363371t_node * 
    364372node_find_by_ip(char *ip) 
     
    376384} 
    377385 
     386/** 
     387 * @brief Finds a specific node by its token 
     388 */ 
    378389t_node * 
    379390node_find_by_token(char *token) 
     
    391402} 
    392403 
     404/** 
     405 * @brief Frees the memory used by a t_node structure 
     406 * 
     407 * This function frees the memory used by the t_node structure in the 
     408 * proper order. It also calls the free_userrights() function to free 
     409 * the memory used by the rights structure for the node. 
     410 */ 
    393411void 
    394412free_node(t_node *node) 
     
    410428} 
    411429 
     430/** 
     431 * @brief Deletes a node from the connections list 
     432 * 
     433 * Removes the specified node from the connections list and then calls 
     434 * the function to free the memory used by the node. 
     435 */ 
    412436void 
    413437node_delete(t_node *node) 
     
    430454} 
    431455 
     456/** 
     457 * @brief Check the rights for a client 
     458 * 
     459 * This function validates that a client hasn't met one of the conditions 
     460 * for the termination of his connection. Right now, we only check to see 
     461 * for a time-out. More checks could be added here. 
     462 */ 
    432463int 
    433464check_userrights(t_node *node)