Changeset 8533


Ignore:
Timestamp:
12/06/07 15:38:27 (5 years ago)
Author:
eko
Message:

preparation to move l7 out of nvram

Location:
src/router/httpd/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/modules/dd-wrt.c

    r8529 r8533  
    4343#include <utils.h> 
    4444#include <bcmnvram.h> 
     45#include <l7protocols.h> 
    4546 
    4647#ifdef HAVE_OVERCLOCKING 
     
    63506351get_filter_services (char *services) 
    63516352{ 
    6352 /*       
    6353 typedef struct _l7filters  //l7 and p2p filters 
    6354         { 
    6355         char *name; 
    6356         char *protocol; 
    6357         } l7filters; 
    6358  
    6359 l7filters filters_list[] = { 
    6360         { "100bao",                             "l7" }, 
    6361         { "aim",                                "l7"}, 
    6362         { "aimwebcontent" ,             "l7" }, 
    6363         { "applejuice",                 "p2p" }, 
    6364         { "ares",                               "p2p" }, 
    6365         { "audiogalaxy",                "l7" }, 
    6366         { "battlefield1942",    "l7" }, 
    6367         { "battlefield2",               "l7" }, 
    6368         { "bgp",                                "l7" }, 
    6369         { "biff",                               "l7" }, 
    6370         { "bittorrent",                 "p2p" }, 
    6371         { "chikka",                             "l7" }, 
    6372         { "cimd",                               "l7" }, 
    6373         { "ciscovpn",                   "l7" }, 
    6374         { "citrix",                             "l7" }, 
    6375         { "code_red",                   "l7" }, 
    6376         { "counterstrike-source", "l7" }, 
    6377         { "cvs",                                "l7" }, 
    6378         { "dayofdefeat-source", "l7" }, 
    6379         { "dhcp",                               "l7" }, 
    6380         { "directconnect",              "p2p" }, 
    6381         { "dns",                                "l7" }, 
    6382         { "doom3",                              "l7" }, 
    6383         { "edonkey",                    "p2p" }, 
    6384         { "exe",                                "l7" }, 
    6385         { "fasttrack",                  "l7" }, 
    6386         { "finger",                             "l7" }, 
    6387         { "flash",                              "l7" }, 
    6388         { "freenet",                    "l7" }, 
    6389         { "ftp",                                "l7"}, 
    6390         { "gif",                                "l7" }, 
    6391         { "gkrellm",                    "l7" }, 
    6392         { "gnucleuslan",                "l7" }, 
    6393         { "gnutella",                   "p2p" }, 
    6394         { "goboogy",                    "l7" }, 
    6395         { "gopher",                             "l7" }, 
    6396         { "h323",                               "l7" }, 
    6397         { "halflife2-deathmatch", "l7" }, 
    6398         { "hddtemp",                    "l7" }, 
    6399         { "hotline",                    "l7" }, 
    6400         { "html",                               "l7" }, 
    6401         { "http",                               "l7" }, 
    6402         { "http-dap",                   "l7" }, 
    6403         { "http-fresh",                 "l7" }, 
    6404         { "http-itunes",                "l7" }, 
    6405         { "http-rtsp",                  "l7" }, 
    6406         { "httpaudio",                  "l7" }, 
    6407         { "httpcachehit",               "l7" }, 
    6408         { "httpcachemiss",              "l7" }, 
    6409         { "httpvideo",                  "l7" }, 
    6410         { "ident",                              "l7" }, 
    6411         { "imap",                               "l7" }, 
    6412         { "imesh",                              "l7" }, 
    6413         { "ipp",                                "l7" }, 
    6414         { "irc",                                "l7" }, 
    6415         { "jabber",                             "l7" }, 
    6416         { "jpeg",                               "l7" }, 
    6417         { "kugoo",                              "l7"}, 
    6418         { "live365",                    "l7" }, 
    6419         { "lpd",                                "l7" }, 
    6420         { "mohaa",                              "l7" }, 
    6421         { "msnmessenger",               "l7" }, 
    6422         { "msn-filetransfer",   "l7" }, 
    6423         { "mute",                               "l7" }, 
    6424         { "napster",                    "l7" }, 
    6425         { "nbns",                               "l7" }, 
    6426         { "ncp",                                "l7" }, 
    6427         { "netbios",                    "l7" }, 
    6428         { "nimda",                              "l7" }, 
    6429         { "nntp",                               "l7" }, 
    6430         { "ntp",                                "l7" }, 
    6431         { "ogg",                                "l7" }, 
    6432         { "openft",                             "l7" }, 
    6433         { "pcanywhere",                 "l7" }, 
    6434         { "pdf",                                "l7" }, 
    6435         { "perl",                               "l7" }, 
    6436         { "poco",                               "l7" }, 
    6437         { "pop3",                               "l7" }, 
    6438         { "postscript",                 "l7" }, 
    6439         { "pressplay",                  "l7" }, 
    6440         { "qq",                                 "l7" }, 
    6441         { "quake-halflife",             "l7" }, 
    6442         { "quake1",                             "l7" }, 
    6443         { "quicktime",                  "l7" }, 
    6444         { "radmin",                             "l7" }, 
    6445         { "rar",                                "l7"}, 
    6446         { "rdp",                                "l7" }, 
    6447         { "replaytv-ivs",               "l7" }, 
    6448         { "rlogin",                             "l7" }, 
    6449         { "rpm",                                "l7" }, 
    6450         { "rtf",                                "l7" }, 
    6451         { "rtsp",                               "l7" }, 
    6452         { "shoutcast",                  "l7" }, 
    6453         { "sip",                                "l7" }, 
    6454         { "skypeout",                   "l7" }, 
    6455         { "skypetoskype",               "l7" }, 
    6456         { "smb",                                "l7" }, 
    6457         { "smtp",                               "l7" }, 
    6458         { "snmp",                               "l7" }, 
    6459         { "snmp-mon",                   "l7" }, 
    6460         { "snmp-trap",                  "l7" }, 
    6461         { "socks",                              "l7" }, 
    6462         { "soribada",                   "l7" }, 
    6463         { "soulseek",                   "p2p" }, 
    6464         { "ssdp",                               "l7" }, 
    6465         { "ssh",                                "l7" }, 
    6466         { "ssl",                                "l7" }, 
    6467         { "stun",                               "l7" }, 
    6468         { "subspace",                   "l7" }, 
    6469         { "subversion",                 "l7" }, 
    6470         { "tar",                                "l7" }, 
    6471         { "teamspeak",                  "l7" }, 
    6472         { "telnet",                             "l7" }, 
    6473         { "tesla",                              "l7"}, 
    6474         { "tftp",                               "l7" }, 
    6475         { "thecircle",                  "l7" }, 
    6476         { "tls",                                "l7" }, 
    6477         { "tor"                                 "l7" }, 
    6478         { "tsp",                                "l7" }, 
    6479         { "unknown",                    "l7" }, 
    6480         { "uucp",                               "l7" }, 
    6481         { "validcertssl",               "l7" }, 
    6482         { "ventrilo",                   "l7" }, 
    6483         { "vnc",                                "l7" }, 
    6484         { "winmx",                              "p2p" }, 
    6485         { "whois",                              "l7" }, 
    6486         { "worldofwarcraft",    "l7" }, 
    6487         { "x11",                                "l7" }, 
    6488         { "xboxlive",                   "l7" }, 
    6489         { "xunlei",                             "l7" }, 
    6490         { "yahoo",                              "l7" }, 
    6491         { "zip",                                "l7" }, 
    6492         { "zmaap",                              "l7" }, 
    6493         { 0, 0 } 
    6494 }; 
    6495  
    6496 int i=0; 
    6497 int namelen, protolen; 
    6498  
    6499 char services[8192] = ""; 
    6500 char temp[128] = ""; 
    6501  
    6502         while (filters_list[i].name)  //add l7 and p2p filters 
     6353 
     6354  l7filters *filters = filters_list; 
     6355  int namelen, protolen; 
     6356  char temp[128] = ""; 
     6357 
     6358        while (filters->name)  //add l7 and p2p filters 
    65036359                { 
    6504                 namelen = strlen (filters_list[i].name); 
    6505                 protolen = strlen (filters_list[i].protocol); 
    6506  
    6507                 sprintf (temp, "$NAME:%03d:%s$PROT:%03d:%s$PORT:003:0:0<&nbsp;>", namelen, filters_list[i].name, protolen, filters_list[i].protocol); 
     6360                namelen = strlen (filters->name); 
     6361                protolen = strlen (filters->protocol); 
     6362 
     6363                sprintf (temp, "$NAME:%03d:%s$PROT:%03d:%s$PORT:003:0:0<&nbsp;>", namelen, filters->name, protolen, filters->protocol); 
    65086364                strcat (services, temp); 
    6509                  
    6510                 i++; 
    6511                 }        
    6512 */ 
    6513  
    6514   char svcs_var[32] = ""; 
    6515   int index = 0; 
    6516  
    6517   do 
    6518     { 
    6519       snprintf (svcs_var, 31, "filter_services%d", index++); 
    6520       strcat (services, nvram_safe_get (svcs_var)); 
    6521     } 
    6522   while (strlen (nvram_safe_get (svcs_var)) > 0 && index < 8); 
     6365                filters++; 
     6366                } 
     6367 
     6368        strcat (services, nvram_safe_get ("filter_services"));  //this is user defined filters     
    65236369 
    65246370  return; 
  • src/router/httpd/modules/filters.c

    r8082 r8533  
    17361736  char *type; 
    17371737  int which; 
    1738   char word[1024], *next, services[8192] = "", svcs_var[32] = ""; 
     1738  char word[1024], *next; 
    17391739  char delim[] = "<&nbsp;>"; 
    17401740  int index = 0; 
     
    17481748    } 
    17491749 
    1750   do 
    1751     { 
    1752       snprintf (svcs_var, 31, "filter_services%d", index++); 
    1753       strcat (services, nvram_safe_get (svcs_var)); 
    1754     } 
    1755   while (strlen (nvram_safe_get (svcs_var)) > 0 && index < 8); 
    1756  
     1750  char services[8192]; 
     1751  memset (services, 0, 8192); 
     1752   
     1753  get_filter_services (services); 
     1754     
    17571755 
    17581756  if (!strcmp (type, "all_list")) 
    17591757    { 
    17601758      int count = 0; 
    1761 //              services = nvram_safe_get("filter_services"); 
     1759 
    17621760      split (word, services, next, delim) 
    17631761      { 
Note: See TracChangeset for help on using the changeset viewer.