Changeset 632
- Timestamp:
- 10/05/08 16:09:24 (3 months ago)
- Location:
- trunk/daemon/src
- Files:
-
- 4 modified
-
bandwidth.c (modified) (3 diffs)
-
bandwidth.h (modified) (1 diff)
-
misc.c (modified) (1 diff)
-
traffic.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/src/bandwidth.c
r576 r632 18 18 19 19 20 #include <string.h> 21 20 22 #include "main.h" 21 23 #include "misc.h" … … 23 25 #include "request.h" 24 26 #include "error.h" 27 28 #include "fs.h" 25 29 26 30 … … 321 325 322 326 323 327 int ifb_kernel_support() 328 { 329 char *devsfile = file_read("/proc/net/dev"); 330 int ret = 0; 331 332 if(devsfile != NULL) 333 { 334 if(strstr(devsfile, "ifb") != NULL) 335 ret = 1; 336 } 337 338 free(devsfile); 339 340 return ret; 341 } -
trunk/daemon/src/bandwidth.h
r525 r632 30 30 struct ovcp_response_st *del_bandwidth(struct ovcp_request_st *request); 31 31 32 int ifb_kernel_support(); 33 32 34 #endif -
trunk/daemon/src/misc.c
r631 r632 747 747 748 748 modfile = fopen("/proc/modules", "r"); 749 749 if(modfile == NULL) 750 return 0; 751 750 752 while(!feof(modfile)) 751 753 { -
trunk/daemon/src/traffic.c
r576 r632 530 530 sqlite3_exec(openvcp_db, "CREATE TABLE vserver_trafficlimit ('id' INTEGER PRIMARY KEY AUTOINCREMENT, 'name', 'total', 'notify', 'type', 'notified', UNIQUE(name, type))", NULL, 0, NULL); 531 531 532 system("modprobe ifb 2>/dev/null"); 533 534 system("modprobe ip_tables 2>/dev/null"); 535 if(kernelmodule_loaded("ip_tables")) 536 { 537 ovcp_create_chains(); 538 ovcp_create_tables(openvcp_db); 539 } 540 else ovcp_log(OVCP_WARNING, "ip_tables Kernel Module not found"); 541 542 system("modprobe nf_conntrack_ftp 2>/dev/null"); 532 execb_cmd("modprobe", "modprobe", "ifb", NULL); 533 534 execb_cmd("modprobe", "modprobe", "ip_tables", NULL); 535 536 ovcp_create_chains(); 537 ovcp_create_tables(openvcp_db); 538 539 execb_cmd("modprobe", "modprobe", "nf_conntrack_ftp", NULL); 540 543 541 544 542 ifaces = split_string(global_settings.ifaces, ' ', &iface_count); … … 604 602 } 605 603 606 if( kernelmodule_loaded("ifb"))604 if(ifb_kernel_support()) 607 605 ovcp_setup_trafficthrottling(openvcp_db); 608 606 else ovcp_log(OVCP_WARNING, "ifb Kernel Module not found");
