Changeset 840
- Timestamp:
- 11/24/05 16:46:44 (3 years ago)
- Files:
-
- trunk/wifidog/ChangeLog (modified) (2 diffs)
- trunk/wifidog/src/conf.c (modified) (5 diffs)
- trunk/wifidog/src/conf.h (modified) (1 diff)
- trunk/wifidog/src/gateway.c (modified) (3 diffs)
- trunk/wifidog/src/http.h (modified) (1 diff)
- trunk/wifidog/src/util.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wifidog/ChangeLog
r819 r840 1 1 # $Header$ 2 2005-11-24 Philippe April <philippe@ilesansfil.org> 3 * Bad idea 4 2 5 2005-11-01 Max Horvath <max.horvath@maxspot.de> 3 6 * Added .project to .cvsignore … … 5 8 2005-11-01 Philippe April <philippe@ilesansfil.org> 6 9 * Added OPTIONS section in wifidog-init (example: enable syslog) 7 8 2005-10-10 Philippe April <philippe@ilesansfil.org>9 * Ability to run wifidog without an auth server (splash only).10 * Does not allow (yet) to specify a custom splash/disclaimer, but will11 forward to the portal of your choice if specified in the config (or12 a generic one if none is specified).13 Of course, using wifidog without an authentication server will not give14 you statistics and all the rest of the cool features.15 10 16 11 2005-10-09 Philippe April <philippe@ilesansfil.org> trunk/wifidog/src/conf.c
r799 r840 78 78 oAuthServPath, 79 79 oAuthServMaxTries, 80 oPortal,81 80 oHTTPDMaxConn, 82 81 oHTTPDName, … … 106 105 { "authserver", oAuthServer }, 107 106 { "authservmaxtries", oAuthServMaxTries }, 108 { "portal", oPortal },109 107 { "httpdmaxconn", oHTTPDMaxConn }, 110 108 { "httpdname", oHTTPDName }, … … 151 149 config.authserv_maxtries = DEFAULT_AUTHSERVMAXTRIES; 152 150 config.httpdname = NULL; 153 config.portal = NULL;154 151 config.clienttimeout = DEFAULT_CLIENTTIMEOUT; 155 152 config.checkinterval = DEFAULT_CHECKINTERVAL; … … 643 640 &linenum); 644 641 break; 645 case oPortal:646 config.portal = safe_strdup(p1);647 break;648 642 case oFirewallRuleSet: 649 643 parse_firewall_ruleset(p1, fd, filename, &linenum); … … 758 752 { 759 753 config_notnull(config.gw_interface, "GatewayInterface"); 754 config_notnull(config.auth_servers, "AuthServer"); 760 755 761 756 if (missing_parms) { trunk/wifidog/src/conf.h
r799 r840 116 116 connection attempts before abandoning */ 117 117 t_auth_serv *auth_servers; /**< @brief Auth servers list */ 118 char *portal; /**< @brief portal file or url to show */119 118 char *httpdname; /**< @brief Name the web server will return when 120 119 replying to a request */ trunk/wifidog/src/gateway.c
r799 r840 291 291 pthread_kill(tid_fw_counter, SIGKILL); 292 292 } 293 if ( config->auth_servers != NULL &&tid_ping) {293 if (tid_ping) { 294 294 debug(LOG_INFO, "Explicitly killing the ping thread"); 295 295 pthread_kill(tid_ping, SIGKILL); … … 409 409 httpdAddCContent(webserver, "/wifidog", "status", 0, NULL, http_callback_status); 410 410 httpdAddCContent(webserver, "/wifidog", "auth", 0, NULL, http_callback_auth); 411 httpdAddCContent(webserver, "/wifidog", "splash", 0, NULL, http_callback_splash);412 httpdAddCContent(webserver, "/wifidog", "portal", 0, NULL, http_callback_portal);413 411 414 412 httpdAddC404Content(webserver, http_callback_404); … … 435 433 pthread_detach(tid); 436 434 437 /* Start heartbeat thread, only if we have an auth server set */ 438 if (config->auth_servers != NULL) { 439 result = pthread_create(&tid_ping, NULL, (void *)thread_ping, NULL); 440 if (result != 0) { 441 debug(LOG_ERR, "FATAL: Failed to create a new thread (ping) - exiting"); 442 termination_handler(0); 443 } 444 pthread_detach(tid_ping); 445 } 435 /* Start heartbeat thread */ 436 result = pthread_create(&tid_ping, NULL, (void *)thread_ping, NULL); 437 if (result != 0) { 438 debug(LOG_ERR, "FATAL: Failed to create a new thread (ping) - exiting"); 439 termination_handler(0); 440 } 441 pthread_detach(tid_ping); 446 442 447 443 debug(LOG_NOTICE, "Waiting for connections"); trunk/wifidog/src/http.h
r799 r840 39 39 void http_callback_status(httpd *webserver, request *r); 40 40 /**@brief Callback for libhttpd */ 41 void http_callback_splash(httpd *webserver, request *r);42 /**@brief Callback for libhttpd */43 void http_callback_portal(httpd *webserver, request *r);44 /**@brief Callback for libhttpd */45 41 void http_callback_auth(httpd *webserver, request *r); 46 42 trunk/wifidog/src/util.c
r799 r840 410 410 } 411 411 412 if (config->auth_servers != NULL) { 413 snprintf((buffer + len), (sizeof(buffer) - len), "\nAuthentication servers:\n"); 412 snprintf((buffer + len), (sizeof(buffer) - len), "\nAuthentication servers:\n"); 413 len = strlen(buffer); 414 415 LOCK_CONFIG(); 416 417 for (auth_server = config->auth_servers; auth_server != NULL; auth_server = auth_server->next) { 418 snprintf((buffer + len), (sizeof(buffer) - len), " Host: %s (%s)\n", auth_server->authserv_hostname, auth_server->last_ip); 414 419 len = strlen(buffer); 415 416 LOCK_CONFIG(); 417 418 for (auth_server = config->auth_servers; auth_server != NULL; auth_server = auth_server->next) { 419 snprintf((buffer + len), (sizeof(buffer) - len), " Host: %s (%s)\n", auth_server->authserv_hostname, auth_server->last_ip); 420 len = strlen(buffer); 421 } 422 423 UNLOCK_CONFIG(); 424 } else { 425 snprintf((buffer + len), (sizeof(buffer) - len), "\nRunning in splash only mode\n"); 426 len = strlen(buffer); 427 } 420 } 421 422 UNLOCK_CONFIG(); 428 423 429 424 return safe_strdup(buffer);
