netadm-devel Mailing List for netadm (Page 3)
Status: Beta
Brought to you by:
linuxpark
You can subscribe to this list here.
2006 |
Jan
(4) |
Feb
(78) |
Mar
(70) |
Apr
(32) |
May
(28) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: linuxpark <lin...@us...> - 2006-04-06 15:16:00
|
Update of /cvsroot/netadm/gwc/gwcadmd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12694/gwcadmd Modified Files: Makefile main.c Log Message: MOD: minor modifying and renaming email address. ADD: sample subdir to Makefile. Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/gwcadmd/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- Makefile 6 Apr 2006 15:15:48 -0000 1.2 *************** *** 2,6 **** # # Title : Makefile ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwcadmd --- 2,6 ---- # # Title : Makefile ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwcadmd Index: main.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwcadmd/main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** main.c 13 Mar 2006 14:15:05 -0000 1.13 --- main.c 6 Apr 2006 15:15:48 -0000 1.14 *************** *** 2,6 **** Title : main.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main start point of gwcadmd --- 2,6 ---- Title : main.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main start point of gwcadmd |
From: linuxpark <lin...@us...> - 2006-04-06 15:16:00
|
Update of /cvsroot/netadm/gwc/gwccli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12694/gwccli Modified Files: Makefile main.c Log Message: MOD: minor modifying and renaming email address. ADD: sample subdir to Makefile. Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/gwccli/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- Makefile 6 Apr 2006 15:15:48 -0000 1.2 *************** *** 2,6 **** # # Title : Makefile ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwccli command --- 2,6 ---- # # Title : Makefile ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwccli command Index: main.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwccli/main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.c 6 Mar 2006 04:23:56 -0000 1.2 --- main.c 6 Apr 2006 15:15:48 -0000 1.3 *************** *** 2,6 **** Title : main.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main.c for gwccli --- 2,6 ---- Title : main.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main.c for gwccli |
From: linuxpark <lin...@us...> - 2006-04-06 15:16:00
|
Update of /cvsroot/netadm/gwc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12694 Modified Files: AUTHORS FILES INSTALL Makefile Makefile.tmpl README.en README.ko Log Message: MOD: minor modifying and renaming email address. ADD: sample subdir to Makefile. Index: FILES =================================================================== RCS file: /cvsroot/netadm/gwc/FILES,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FILES 30 Jan 2006 17:41:24 -0000 1.1.1.1 --- FILES 6 Apr 2006 15:15:47 -0000 1.2 *************** *** 2,6 **** # # Title : FILES ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : the tree infomation of source files --- 2,6 ---- # # Title : FILES ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : the tree infomation of source files Index: Makefile.tmpl =================================================================== RCS file: /cvsroot/netadm/gwc/Makefile.tmpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.tmpl 6 Mar 2006 14:16:04 -0000 1.3 --- Makefile.tmpl 6 Apr 2006 15:15:47 -0000 1.4 *************** *** 2,6 **** # # Title : Makefile.tmpl ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : config of Makefile --- 2,6 ---- # # Title : Makefile.tmpl ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : config of Makefile Index: README.ko =================================================================== RCS file: /cvsroot/netadm/gwc/README.ko,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README.ko 2 Mar 2006 08:22:22 -0000 1.3 --- README.ko 6 Apr 2006 15:15:47 -0000 1.4 *************** *** 3,7 **** ! 2006. 2. 5, ¹Ú Á¦È£, ne...@ke... --- 3,7 ---- ! 2006. 2. 5, ¹Ú Á¦È£, lin...@gm... Index: README.en =================================================================== RCS file: /cvsroot/netadm/gwc/README.en,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README.en 2 Mar 2006 08:22:21 -0000 1.3 --- README.en 6 Apr 2006 15:15:47 -0000 1.4 *************** *** 3,7 **** ! 2006. 01. 12. (thu) 03:16:10 KST, par...@ho... or lin...@ke... --- 3,7 ---- ! 2006. 01. 12. (thu) 03:16:10 KST, lin...@gm... Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 30 Jan 2006 17:41:24 -0000 1.1.1.1 --- Makefile 6 Apr 2006 15:15:47 -0000 1.2 *************** *** 1,6 **** # - # # Title : Makefile ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile just for subtree compiling. --- 1,5 ---- # # Title : Makefile ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile just for subtree compiling. *************** *** 12,16 **** gwccli \ gwcadmd \ ! gwcguid all: do-all --- 11,16 ---- gwccli \ gwcadmd \ ! gwcguid \ ! sample all: do-all Index: INSTALL =================================================================== RCS file: /cvsroot/netadm/gwc/INSTALL,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** INSTALL 2 Mar 2006 08:22:21 -0000 1.2 --- INSTALL 6 Apr 2006 15:15:47 -0000 1.3 *************** *** 2,6 **** # # Title : INSTALL ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 02. 08. (wen) 02:21:58 KST # Description : The manual for installation. --- 2,6 ---- # # Title : INSTALL ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 02. 08. (wen) 02:21:58 KST # Description : The manual for installation. Index: AUTHORS =================================================================== RCS file: /cvsroot/netadm/gwc/AUTHORS,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AUTHORS 30 Jan 2006 17:41:25 -0000 1.1.1.1 --- AUTHORS 6 Apr 2006 15:15:47 -0000 1.2 *************** *** 2,6 **** # # Title : AUTHORS ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : authors and contributors --- 2,6 ---- # # Title : AUTHORS ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : authors and contributors *************** *** 8,12 **** #ident "@(#) $Header$" ! Jeho Park : ne...@ke... --- 8,12 ---- #ident "@(#) $Header$" ! Jeho Park : lin...@gm... |
From: linuxpark <lin...@us...> - 2006-04-06 15:15:56
|
Update of /cvsroot/netadm/gwc/elib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12694/elib Modified Files: Makefile Log Message: MOD: minor modifying and renaming email address. ADD: sample subdir to Makefile. Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/elib/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 30 Jan 2006 17:41:26 -0000 1.1.1.1 --- Makefile 6 Apr 2006 15:15:47 -0000 1.2 *************** *** 2,6 **** # # Title : Makefile ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for external arch lib --- 2,6 ---- # # Title : Makefile ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for external arch lib |
From: linuxpark <lin...@us...> - 2006-04-06 15:14:39
|
Update of /cvsroot/netadm/gwc/sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12305 Added Files: Makefile confilter.c test.html Log Message: Initial Check-in of the library for contents filtering. ported C library of dansgardian's oop. --- NEW FILE: test.html --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>Gray Watson's Multimedia Files</title><!--skipfrom--> <meta http-equiv="pics-label" content="(PICS-1.1 "http://www.icra.org/ratingsv02.html" labels for "http://mm.256.com/" generic true ratings (cz 1 lb 1 lc 1 nf 1 ng 1 og 1 oh 1 vb 1 vc 1 vf 1) "http://www.rsac.org/ratingsv01.html" labels for "http://mm.256.com/" generic true ratings (n0 s4 v4 l2) "http://www.classify.org/safesurf/" labels for "http://mm.256.com/" generic true ratings (SS~~000 5 SS~~001 6 SS~~004 6 SS~~005 6 SS~~009 6) "http://www.weburbia.com/safe/ratings.htm" labels for "http://mm.256.com/" generic true ratings (s 2) )"></head> <body alink="#ff3300" bgcolor="#ffffff" link="#aa0000" text="#000000" vlink="#005522"> <!-- header.html starts at the top of the document ^^ --> <!-- NOTE: it doesn't work well to put the H1 and the warning in here because other html files use this not just the 200X.html files. --> <!-- end of header --> <!--skipto--> <h1> <a href="http://256.com/gray/">Gray Watson's</a> <br> Multimedia Files <br> Has Been Shutdown </h1> <p> Sorry. I've decided to take this site down. Using up too much bandwidth. Sorry. </p> <!-- start of footer --> <!--skipfrom--> <p> <font size="-1"> Brought to you by <a href="http://256.com/gray/">Gray Watson</a> <br> This page should be <a href="http://validator.w3.org/check/referer">W3C Valid XHTML</a> and should work with most browsers. <br> http://mm.256.com/ </font> </p> <!-- plugs --> <p> <a href="http://mailnull.com/">Free Spam Protection</a> <a href="http://geekleft.org/">My Political T-Shirts</a> <a href="http://dmalloc.com/">Memory Debug Library</a> <a href="http://256.com/gray/shareware_registration_module/integrated_selling_library.html">Shareware Help Wanted</a> </p> <!-- end of footer including /BODY and /HTML --> <!--skipto--> </body></html> --- NEW FILE: confilter.c --- /* Title : confilter.c Author : Jeho-Park <lin...@gm...> Created date : 2006. 04. 06. (thu) 23:54:35 KST Description : sample code */ #ident "@(#) $Header: /cvsroot/netadm/gwc/sample/confilter.c,v 1.1 2006/04/06 15:14:32 linuxpark Exp $" #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "global.h" #include "naufilter.h" #include "sysutil.h" confilter_conf_t config; static void usage () { printf ("[usage] html\n"); } static void loadconf () { config.pics_rsac_violence = 2; config.pics_rsac_sex = 2 ; config.pics_rsac_nudity = 2; config.pics_rsac_language = 2; config.pics_icra_chat = 0; config.pics_icra_moderatedchat = 1; config.pics_icra_languagesexual = 0; config.pics_icra_languageprofanity = 0; config.pics_icra_languagemildexpletives = 1; config.pics_icra_nuditygraphic = 0; config.pics_icra_nuditymalegraphic = 0; config.pics_icra_nudityfemalegraphic = 0; config.pics_icra_nuditytopless = 0; config.pics_icra_nuditybottoms = 0; config.pics_icra_nuditysexualacts = 0; config.pics_icra_nudityobscuredsexualacts = 0; config.pics_icra_nuditysexualtouching = 0; config.pics_icra_nuditykissing = 0; config.pics_icra_nudityartistic = 1; config.pics_icra_nudityeducational = 1; config.pics_icra_nuditymedical = 1; config.pics_icra_drugstobacco = 0; config.pics_icra_drugsalcohol = 0; config.pics_icra_drugsuse = 0; config.pics_icra_gambling = 0; config.pics_icra_weaponuse = 0; config.pics_icra_intolerance = 0; config.pics_icra_badexample = 0; config.pics_icra_pgmaterial = 0; config.pics_icra_violencerape = 0; config.pics_icra_violencetohumans = 0; config.pics_icra_violencetoanimals = 0; config.pics_icra_violencetofantasy = 0; config.pics_icra_violencekillinghumans = 0; config.pics_icra_violencekillinganimals = 0; config.pics_icra_violencekillingfantasy = 0; config.pics_icra_violenceinjuryhumans = 0; config.pics_icra_violenceinjuryanimals = 0; config.pics_icra_violenceinjuryfantasy = 0; config.pics_icra_violenceartisitic = 0; config.pics_icra_violenceeducational = 0; config.pics_icra_violencemedical = 0; config.pics_icra_violencesports = 0; config.pics_icra_violenceobjects = 0; config.pics_evaluweb_rating = 1; config.pics_cybernot_sex = 3; config.pics_cybernot_other = 3; config.pics_safesurf_agerange = 3; config.pics_safesurf_profanity = 3; config.pics_safesurf_heterosexualthemes = 3; config.pics_safesurf_homosexualthemes = 3; config.pics_safesurf_nudity = 3; config.pics_safesurf_violence = 3; config.pics_safesurf_sexviolenceandprofanity = 3; config.pics_safesurf_intolerance = 3; config.pics_safesurf_druguse = 3; config.pics_safesurf_otheradultthemes = 3; config.pics_safesurf_gambling = 3; config.pics_weburbia_rating = 1; config.pics_vancouver_multiculturalism = 0; config.pics_vancouver_educationalcontent = 0; config.pics_vancouver_environmentalawareness = 0; config.pics_vancouver_tolerance = 0; config.pics_vancouver_violence = 0; config.pics_vancouver_sex = 0; config.pics_vancouver_profanity = 0; config.pics_vancouver_safety = 0; config.pics_vancouver_canadiancontent = 0; config.pics_vancouver_commercialcontent = 0; config.pics_vancouver_gambling = 0; } static int init_regx (confilter_session_t *sess ) { memset (sess, 0, sizeof (confilter_session_t)); if (init_precompileregexps (sess) != TRUE) return FALSE; sess->conf = &config; return TRUE; } static int free_regx (confilter_session_t *sess ) { if (free_precompileregexps (sess) != TRUE) return FALSE; return TRUE; } int main (int argc, char **argv) { confilter_session_t sess; char *buf; int len; int ret = 1; int sid; if (argc != 2) { usage (); _exit(0); } if (access (argv[1], R_OK) < 0 ) { printf ("Can't access file (%s)\n", argv[1]); usage (); _exit(0); } /* * 1. D A E M O N I N I T I A L I Z A T I O N T I M E */ /* 1-1. TODO: load PIC parameter during daemon initializing time */ loadconf (); /* 1-2. TODO: initialize hash table based on URL(http://xxx/page.html) */ #ifndef DEBUG_MLEAK for (sid = 0; sid < SZMAXSESS; sid ++) { #else while (1) { #endif if (init_regx (&sess) != TRUE ) { printf ("failed to init regx \n"); ret = -1; goto EXIT; } /* * 2. R U N T I M E, P R O X Y S E V I C E T I M E */ /* 2.1. TODO: searching hash table then * if daemon can't find key, * start checking from 2.2 ~ * if daemon find this URL key, drop this http request */ /* 2.2. get HTTP body from server */ buf = loadfile (argv[1], &len); if (!buf || !len) { printf ("session(%d) failed to load file \n", sid); ret = -1; goto EXIT1; } /* 2.3. checking * sid must be managed by main proxy * and * must be thread safe, counted by slot */ if ( checkPICS (&sess, buf, len) != TRUE) { printf ("session(%d) checkPICS met some error\n", sid); ret = -1; goto EXIT2; } /* 2.4. apply policy. * if this page is naughty, insert to hash table above. * so this page will continue to be droped without checking again. */ if (sess.isnaughty ) { printf ("session(%d) naughty page\n", sid); } else { printf ("session(%d) nomal page\n", sid); } /* 2.5. free request resource whenever exit checking. */ EXIT2: free (buf); EXIT1: if (free_regx (&sess) != TRUE ) { printf ("session(%d):failed to destory regx in session\n", sid); _exit (ret); } EXIT: continue; } return 1; } --- NEW FILE: Makefile --- # # # Title : Makefile # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 04. 06. (thu) 23:54:35 KST # Description : # #ident "@(#) $Header: /cvsroot/netadm/gwc/sample/Makefile,v 1.1 2006/04/06 15:14:32 linuxpark Exp $" include ../Makefile.tmpl TARGET = confilter OBJS = confilter.o all : $(TARGET) $(TARGET): $(OBJS) $(CC) -o $@ $(OBJS) $(LIBSYS) .c.o: $(CC) $(CFLAGS) $(INCLUDE) -c $< tags: ctags *.c *.h clean: rm -f *.o core tags *.bak $(TARGET) depend: $(MAKEDEPEND) -- $(CFLAGS) -- *.c rm -f Makefile.bak # DO NOT DELETE THIS LINE -- make depend depends on it. |
From: linuxpark <lin...@us...> - 2006-04-06 15:12:47
|
Update of /cvsroot/netadm/gwc/sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11238/sample Log Message: Directory /cvsroot/netadm/gwc/sample added to the repository |
From: linuxpark <lin...@us...> - 2006-04-06 15:12:23
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10489 Modified Files: Makefile confio.c confproc.c conftab.c confutil.c linklist.c slog.c sysipc.c sysnio.c syssnmp.c systime.c sysutil.c Log Message: MOD: modify mail address. and add object about confilter Index: syssnmp.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/syssnmp.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** syssnmp.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- syssnmp.c 6 Apr 2006 15:12:05 -0000 1.2 *************** *** 2,6 **** Title : snmp.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc snmp lib --- 2,6 ---- Title : snmp.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc snmp lib Index: slog.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/slog.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** slog.c 28 Feb 2006 23:07:49 -0000 1.2 --- slog.c 6 Apr 2006 15:12:05 -0000 1.3 *************** *** 2,6 **** Title : slog.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc syslog wrapper fn --- 2,6 ---- Title : slog.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc syslog wrapper fn Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** confproc.c 14 Mar 2006 17:17:05 -0000 1.20 --- confproc.c 6 Apr 2006 15:12:05 -0000 1.21 *************** *** 2,6 **** Title : confproc.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main proc source --- 2,6 ---- Title : confproc.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : main proc source Index: sysnio.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/sysnio.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sysnio.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- sysnio.c 6 Apr 2006 15:12:05 -0000 1.2 *************** *** 2,6 **** Title : sysnio.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc network lib --- 2,6 ---- Title : sysnio.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc network lib Index: conftab.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/conftab.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** conftab.c 13 Mar 2006 14:15:05 -0000 1.9 --- conftab.c 6 Apr 2006 15:12:05 -0000 1.10 *************** *** 2,6 **** Title : conftab.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : proc mapping object --- 2,6 ---- Title : conftab.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : proc mapping object Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 28 Feb 2006 23:41:50 -0000 1.2 --- Makefile 6 Apr 2006 15:12:05 -0000 1.3 *************** *** 2,6 **** # # Title : Makefile ! # Author : Jeho-Park <ne...@ke...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwclib --- 2,6 ---- # # Title : Makefile ! # Author : Jeho-Park <lin...@gm...> # Created date : 2006. 01. 31. (thu) 01:40:38 KST # Description : Makefile for gwclib *************** *** 12,15 **** --- 12,16 ---- rely=`uname -r | cut -f 2 -d .` SYSOBJS = conftab.o \ + linklist.o \ confutil.o \ confproc.o \ *************** *** 21,25 **** syssnmp.o \ systime.o \ ! linklist.o all: libsys.a --- 22,28 ---- syssnmp.o \ systime.o \ ! naufilter.o \ ! regexp.o ! all: libsys.a Index: confutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confutil.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** confutil.c 13 Mar 2006 14:15:05 -0000 1.11 --- confutil.c 6 Apr 2006 15:12:05 -0000 1.12 *************** *** 2,6 **** Title : confutil.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : utils for confio --- 2,6 ---- Title : confutil.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : utils for confio *************** *** 532,536 **** } #endif ! char * loadfile(char *fn) --- 532,536 ---- } #endif ! #if 0 char * loadfile(char *fn) *************** *** 566,569 **** --- 566,570 ---- return cp; } + #endif void Index: systime.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/systime.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** systime.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- systime.c 6 Apr 2006 15:12:05 -0000 1.2 *************** *** 2,6 **** Title : systime.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc timing concern lib --- 2,6 ---- Title : systime.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc timing concern lib Index: linklist.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/linklist.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** linklist.c 6 Mar 2006 14:16:05 -0000 1.2 --- linklist.c 6 Apr 2006 15:12:05 -0000 1.3 *************** *** 2,6 **** Title : linklist.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : linklist.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: confio.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confio.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** confio.c 8 Mar 2006 15:29:55 -0000 1.6 --- confio.c 6 Apr 2006 15:12:05 -0000 1.7 *************** *** 2,6 **** Title : confio.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : config io --- 2,6 ---- Title : confio.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : config io Index: sysutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/sysutil.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sysutil.c 6 Mar 2006 14:16:05 -0000 1.4 --- sysutil.c 6 Apr 2006 15:12:05 -0000 1.5 *************** *** 2,6 **** Title : sysutil.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc util lib --- 2,6 ---- Title : sysutil.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc util lib *************** *** 9,14 **** #ident "@(#) $Header$" - #include <stdlib.h> #include <stdio.h> #include <ctype.h> #define _GNU_SOURCE --- 9,14 ---- #ident "@(#) $Header$" #include <stdio.h> + #include <stdlib.h> #include <ctype.h> #define _GNU_SOURCE *************** *** 820,821 **** --- 820,888 ---- } + + char * loadfile(char *fn, int *len) + { + struct stat st; + char fname[256]; + char *cp; + int ret; + int fd; + + sprintf(fname, "%s", fn); + if ((fd = open(fname, O_RDONLY)) == -1) { + return NULL; + } + + if (fstat(fd, &st) == -1) { + close(fd); + return NULL; + } + + if (st.st_size <= 0) + return NULL; + + if ((cp = (char *) malloc(st.st_size + 1)) == NULL) { + close(fd); + return NULL; + } + + ret = read(fd, cp, st.st_size); + cp[st.st_size] = '\0'; + + close(fd); + + if (ret == -1) + return NULL; + else { + *len = ret; + return cp; + } + } + + char *subString(char *buf, int start, int l) { + char *p = buf; + + if ((start + l) > strlen (p)) { + return NULL; + } + + *(p + start + l ) = '\0'; + return (p + start); + } + + int strindexof (char *p, const char *s) { + char *pos; + int sl; + + if (!(sl = strlen (p))) + return -1; + + if ((signed)strlen (s) > sl ) + return -1; + + pos = strstr (p, s); + if (!pos) + return -1; + + return (int) (pos -p); + } Index: sysipc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/sysipc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sysipc.c 7 Mar 2006 17:04:51 -0000 1.3 --- sysipc.c 6 Apr 2006 15:12:05 -0000 1.4 *************** *** 2,6 **** Title : sysipc.c ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc ipc fn --- 2,6 ---- Title : sysipc.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : gwc ipc fn |
From: linuxpark <lin...@us...> - 2006-04-06 15:11:03
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9615 Added Files: naufilter.c regexp.c Log Message: Initial Check-in of the library for contents filtering. ported C library of dansgardian's oop. --- NEW FILE: naufilter.c --- /* Title : naufilter.c Author : Jeho-Park <lin...@gm...> Created date : 2006. 04. 06. (thu) 23:54:35 KST Description : library of content filter this is the ported code of dansgardian.org's */ #ident "@(#) $Header: /cvsroot/netadm/gwc/gwclib/naufilter.c,v 1.1 2006/04/06 15:10:53 linuxpark Exp $" #include <stdio.h> #include <string.h> #include <stdlib.h> #include "sysutil.h" #include "naufilter.h" static int checkPICSrating (confilter_session_t *sess, char *label); static void checkPICSratingSafeSurf (confilter_session_t *sess, char *r); static void checkPICSratingevaluWEB (confilter_session_t *sess, char *r); static void checkPICSratingCyberNOT (confilter_session_t *sess, char *r); static void checkPICSratingRSAC (confilter_session_t *sess, char *r); static void checkPICSratingICRA (confilter_session_t *sess, char *r); static void checkPICSratingWeburbia (confilter_session_t *sess, char *r); static void checkPICSratingVancouver (confilter_session_t *sess, char *r); static void checkPICSagainstoption (confilter_session_t *sess, char *s, char* l, int opt, char *m); int init_precompileregexps( confilter_session_t *sess) { confilter_out("\n"); /* return : TRUE(1), FALSE(0) */ if (!regexp_comp(&sess->pics1, "pics-label\"[ \t]*content=[\'\"]([^>]*)[\'\"]")) { confilter_out("Error compiling RegExp pics1.\n"); return FALSE; } if (!regexp_comp(&sess->pics2, "[r|{ratings}] *\\(([^\\)]*)\\)")) { confilter_out( "Error compiling RegExp pics2.\n"); return FALSE; } if (!regexp_comp(&sess->isiphost, ".*[a-z|A-Z].*")) { confilter_out("Error compiling RegExp isiphost.\n"); return FALSE; } sess->isnaughty = FALSE; return TRUE; } int free_precompileregexps( confilter_session_t *sess) { confilter_out("\n"); /* return : TRUE(1), FALSE(0) */ if (regexp_destory (&sess->pics1) != TRUE) { confilter_out("Error destory RegExp pics1.\n"); return FALSE; } if (regexp_destory (&sess->pics2) != TRUE) { confilter_out( "Error destory RegExp pics2.\n"); return FALSE; } if (regexp_destory (&sess->isiphost) != TRUE) { confilter_out("Error compiling RegExp isiphost."); return FALSE; } return TRUE; } int checkPICS(confilter_session_t *sess, char* file, int l) { int i; confilter_out("\n"); *(file + l) = '\0'; if (regexp_match (&sess->pics1, file) != TRUE) { return FALSE; } /* if regexp_matched return FALSE, it mean there is no symtom of naughty. */ if (regexp_matched(&sess->pics1) != TRUE) { return TRUE; } confilter_out("-------------->num [%d]\n", regexp_numberOfMatches (&sess->pics1)); for (i = 0; i < regexp_numberOfMatches (&sess->pics1); i++) { confilter_out("-------------->num [%d]\n", i); if (checkPICSrating(sess, regexp_result (&sess->pics1, i)) != TRUE) return FALSE; } return TRUE; } static int checkPICSrating (confilter_session_t *sess, char *label) { char lab [SZMAXSTR]; char *service; char buf [SZMAXSTR]; char *r; char *p; char *o; int i; char *f; confilter_out("\n"); confilter_out("----> label:[%s]\n", label); if (regexp_match (&sess->pics2, label) != TRUE) { return FALSE; } /* TEST was done properly */ if (regexp_matched (&sess->pics2) != TRUE) { return TRUE; } strcpy (lab, label); confilter_out("lab:{%s}\n", lab); confilter_out("-----> pics2: %d\n", regexp_numberOfMatches (&sess->pics2)); confilter_out("\n"); for (i = 0; i < regexp_numberOfMatches (&sess->pics2); i++) { confilter_out("\n"); strcpy (buf, regexp_result (&sess->pics2, i)); confilter_out("\n"); confilter_out("===========>buffer[%s]\n", buf); o = buf; p = strchr (buf, '('); confilter_out("\n"); if (p) { *p = '\0'; o = ++p; } confilter_out("\n"); p = strchr (o, ')'); if (p) { confilter_out("\n"); *p = '\0'; } confilter_out("\n"); r = o; confilter_out("\n"); confilter_out("r:[%s]\n", r); if (i == 0) { confilter_out("------------> i(%d): %d\n", i, regexp_offset (&sess->pics2, i)); /* TODO: ignore ret val of regexp_offset */ service = subString (lab, 0, regexp_offset (&sess->pics2, i) ); confilter_out("service:[%s]\n", service); } else { confilter_out("------------> i(%d): offset(%d):%d, offset(%d):%d\n", i, i-1, regexp_length (&sess->pics2, i -1), i, regexp_length (&sess->pics2, i)); service = subString (lab, regexp_offset (&sess->pics2, i -1) + regexp_length (&sess->pics2, i -1), regexp_offset (&sess->pics2, i) ); confilter_out("service:[%s]\n", service); } if (!service) return TRUE; confilter_out("\n"); sys_strfind (service, strlen (service), "safesurf", &f); if (f) checkPICSratingSafeSurf (sess, r); if (sess->isnaughty != FALSE) return TRUE; confilter_out("\n"); sys_strfind (service, strlen (service), "evaluweb", &f); if (f) checkPICSratingevaluWEB (sess, r); if (sess->isnaughty != FALSE) return TRUE; confilter_out("\n"); sys_strfind (service, strlen (service), "microsys", &f); if (f) checkPICSratingCyberNOT (sess, r); if (sess->isnaughty != FALSE) return TRUE; confilter_out("\n"); sys_strfind (service, strlen (service), "icra", &f); if (f) checkPICSratingICRA (sess, r); if (sess->isnaughty != FALSE) { confilter_out("================> i: %d, r[%s]\n", i, r); return TRUE; } confilter_out("\n"); sys_strfind (service, strlen (service), "rsac", &f); if (f) checkPICSratingRSAC (sess, r); if (sess->isnaughty != FALSE) return TRUE; confilter_out("\n"); sys_strfind (service, strlen (service), "weburbia", &f); if (f) checkPICSratingWeburbia (sess, r); if (sess->isnaughty != FALSE) return TRUE; confilter_out("\n"); sys_strfind (service, strlen (service), "vancouver", &f); if (f) checkPICSratingVancouver (sess, r); } return TRUE; } static void checkPICSratingSafeSurf (confilter_session_t *sess, char *r) { confilter_out("\n"); checkPICSagainstoption(sess, r, "000 ", sess->conf->pics_safesurf_agerange, "Safesurf age range"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "001 ", sess->conf->pics_safesurf_profanity, "Safesurf profanity"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "002 ", sess->conf->pics_safesurf_heterosexualthemes, "Safesurf heterosexualthemes"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "003 ", sess->conf->pics_safesurf_homosexualthemes, "Safesurf "); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "004 ", sess->conf->pics_safesurf_nudity, "Safesurf nudity"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "005 ", sess->conf->pics_safesurf_violence, "Safesurf violence"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "006 ", sess->conf->pics_safesurf_sexviolenceandprofanity, "Safesurf sexviolenceandprofanity"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "007 ", sess->conf->pics_safesurf_intolerance, "Safesurf intolerance"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "008 ", sess->conf->pics_safesurf_druguse, "Safesurf druguse"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "009 ", sess->conf->pics_safesurf_otheradultthemes, "Safesurf otheradultthemes"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "00A ", sess->conf->pics_safesurf_gambling, "Safesurf gambling"); } static void checkPICSratingevaluWEB (confilter_session_t *sess, char *r) { confilter_out("\n"); checkPICSagainstoption(sess, r, "rating ", sess->conf->pics_evaluweb_rating, "evaluWEB age range"); } static void checkPICSratingCyberNOT (confilter_session_t *sess, char *r) { confilter_out("\n"); checkPICSagainstoption(sess, r, "sex ", sess->conf->pics_cybernot_sex, "CyberNOT sex rating"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "other ", sess->conf->pics_cybernot_sex, "CyberNOT other rating"); } static void checkPICSratingRSAC (confilter_session_t *sess, char *r) { confilter_out("\n"); checkPICSagainstoption(sess, r, "v ", sess->conf->pics_rsac_violence, "RSAC violence"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "s ", sess->conf->pics_rsac_sex, "RSAC sex"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "n ", sess->conf->pics_rsac_nudity, "RSAC nudity"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess, r, "l ", sess->conf->pics_rsac_language, "RSAC language"); } static void checkPICSratingICRA (confilter_session_t *sess, char *r) { confilter_out("\n"); checkPICSagainstoption(sess,r, "la ", sess->conf->pics_icra_languagesexual, "ICRA languagesexual"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "ca ", sess->conf->pics_icra_chat, "ICRA chat"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "cb ", sess->conf->pics_icra_moderatedchat, "ICRA moderatedchat"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "lb ", sess->conf->pics_icra_languageprofanity, "ICRA languageprofanity"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "lc ", sess->conf->pics_icra_languagemildexpletives, "ICRA languagemildexpletives"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "na ", sess->conf->pics_icra_nuditygraphic, "ICRA nuditygraphic"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "nb ", sess->conf->pics_icra_nuditymalegraphic, "ICRA nuditymalegraphic"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "nc ", sess->conf->pics_icra_nudityfemalegraphic, "ICRA nudityfemalegraphic"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "nd ", sess->conf->pics_icra_nuditytopless, "ICRA nuditytopless"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "ne ", sess->conf->pics_icra_nuditybottoms, "ICRA nuditybottoms"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "nf ", sess->conf->pics_icra_nuditysexualacts, "ICRA nuditysexualacts"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "ng ", sess->conf->pics_icra_nudityobscuredsexualacts, "ICRA nudityobscuredsexualacts"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "nh ", sess->conf->pics_icra_nuditysexualtouching, "ICRA nuditysexualtouching"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "ni ", sess->conf->pics_icra_nuditykissing, "ICRA nuditykissing"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "nr ", sess->conf->pics_icra_nudityartistic, "ICRA nudityartistic"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "ns ", sess->conf->pics_icra_nudityeducational, "ICRA nudityeducational"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "nt ", sess->conf->pics_icra_nuditymedical, "ICRA nuditymedical"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "oa ", sess->conf->pics_icra_drugstobacco, "ICRA drugstobacco"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "ob ", sess->conf->pics_icra_drugsalcohol, "ICRA drugsalcohol"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "oc ", sess->conf->pics_icra_drugsuse, "ICRA drugsuse"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "od ", sess->conf->pics_icra_gambling, "ICRA gambling"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "oe ", sess->conf->pics_icra_weaponuse, "ICRA weaponuse"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "of ", sess->conf->pics_icra_intolerance, "ICRA intolerance"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "og ", sess->conf->pics_icra_badexample, "ICRA badexample"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "oh ", sess->conf->pics_icra_pgmaterial, "ICRA pgmaterial"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "va ", sess->conf->pics_icra_violencerape, "ICRA violencerape"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vb ", sess->conf->pics_icra_violencetohumans, "ICRA violencetohumans"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vc ", sess->conf->pics_icra_violencetoanimals, "ICRA violencetoanimals"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vd ", sess->conf->pics_icra_violencetofantasy, "ICRA violencetofantasy"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "ve ", sess->conf->pics_icra_violencekillinghumans, "ICRA violencekillinghumans"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vf ", sess->conf->pics_icra_violencekillinganimals, "ICRA violencekillinganimals"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vg ", sess->conf->pics_icra_violencekillingfantasy, "ICRA violencekillingfantasy"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vh ", sess->conf->pics_icra_violenceinjuryhumans, "ICRA violenceinjuryhumans"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vi ", sess->conf->pics_icra_violenceinjuryanimals, "ICRA violenceinjuryanimals"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vj ", sess->conf->pics_icra_violenceinjuryfantasy, "ICRA violenceinjuryfantasy"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vr ", sess->conf->pics_icra_violenceartisitic, "ICRA violenceartisitic"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vs ", sess->conf->pics_icra_violenceeducational, "ICRA violenceeducational"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vt ", sess->conf->pics_icra_violencemedical, "ICRA violencemedical"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vu ", sess->conf->pics_icra_violencesports, "ICRA violencesports"); if (sess->isnaughty) {return;} checkPICSagainstoption(sess,r, "vk ", sess->conf->pics_icra_violenceobjects, "ICRA violenceobjects"); } static void checkPICSratingWeburbia (confilter_session_t *sess, char *r) { confilter_out("\n"); checkPICSagainstoption(sess, r, "s ", sess->conf->pics_weburbia_rating, "Weburbia rating"); } static void checkPICSratingVancouver (confilter_session_t *sess, char *r) { checkPICSagainstoption(sess, r, "MC ", sess->conf->pics_vancouver_multiculturalism, "Vancouvermulticulturalism"); checkPICSagainstoption(sess, r, "Edu ", sess->conf->pics_vancouver_educationalcontent, "Vancouvereducationalcontent"); checkPICSagainstoption(sess, r, "Env ", sess->conf->pics_vancouver_environmentalawareness, "Vancouverenvironmentalawareness"); checkPICSagainstoption(sess, r, "Tol ", sess->conf->pics_vancouver_tolerance, "Vancouvertolerance"); checkPICSagainstoption(sess, r, "V ", sess->conf->pics_vancouver_violence, "Vancouverviolence"); checkPICSagainstoption(sess, r, "S ", sess->conf->pics_vancouver_sex, "Vancouversex"); checkPICSagainstoption(sess, r, "P ", sess->conf->pics_vancouver_profanity, "Vancouverprofanity"); checkPICSagainstoption(sess, r, "SF ", sess->conf->pics_vancouver_safety, "Vancouversafety"); checkPICSagainstoption(sess, r, "Can ", sess->conf->pics_vancouver_canadiancontent, "Vancouvercanadiancontent"); checkPICSagainstoption(sess, r, "Com ", sess->conf->pics_vancouver_commercialcontent, "Vancouvercommercialcontent"); checkPICSagainstoption(sess, r, "Gam ", sess->conf->pics_vancouver_gambling, "Vancouvergambling"); } static void checkPICSagainstoption (confilter_session_t *sess, char *s, char* l, int opt, char *m) { int i; char *p; char *o; confilter_out("ready rating[%s] syntax[%s] opt [%d] contents[%s]\n", s, l, opt, m); if (strindexof (s, l) != -1 ) { confilter_out("find1\n"); i = 0; /* * s = 1 + strstr (s, l); if ( strindexof (s, " ") != -1 ) { confilter_out("find2\n"); s = strstr (s, " ") -1; confilter_out("find3 s(%s)\n", s); } */ p = strstr (s, l); i = strlen (l); p = p + i; if ( strindexof (p, " ") != -1 ) { o = strstr (p, " "); *o = '\0'; } if ( strlen (p) > 0 ) { i = atoi (p); if (opt < i) { confilter_out("------------------------> got it [opt:%d, i:%d\n", opt, i); sess->isnaughty = TRUE; } } } } --- NEW FILE: regexp.c --- /* Title : regexp.c Author : Jeho-Park <lin...@gm...> Created date : 2006. 04. 06. (thu) 23:54:35 KST Description : regular expression. ported from dansgardian. */ #ident "@(#) $Header: /cvsroot/netadm/gwc/gwclib/regexp.c,v 1.1 2006/04/06 15:10:53 linuxpark Exp $" #include <stdio.h> #include <sys/types.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <regex.h> #include "sysutil.h" #include "naufilter.h" #include "regexp.h" extern int errno; static void free_res (void *p) { confilter_out ("\n"); free (p); } int regexp_init (regexp_t *regx) { confilter_out ("\n"); /* TODO: init list */ regx->results = list_new(); if (!regx->results) return FALSE; else regx->results->del = free_res; regx->offsets = list_new(); if (!regx->offsets) return FALSE; else regx->offsets->del = free_res; regx->lengths = list_new(); if (!regx->offsets) return FALSE; else regx->lengths->del = free_res; regx->imatched = FALSE; regx->wascompiled = FALSE; return TRUE; } int regexp_clean (regexp_t *regx) { confilter_out ("\n"); list_delete_all_node (regx->results); list_delete_all_node (regx->offsets); list_delete_all_node (regx->lengths); if (regx->wascompiled != FALSE) { regfree(®x->reg); } return TRUE; } int regexp_destory (regexp_t *regx) { confilter_out ("\n"); list_delete (regx->results); list_delete (regx->offsets); list_delete (regx->lengths); if (regx->wascompiled != FALSE) { regfree(®x->reg); } return TRUE; } int regexp_copy (regexp_t *dst, regexp_t *src) { struct listnode *n; node_s_t *src_s; node_s_t *dst_s; node_v_t *src_v; node_v_t *dst_v; char errmsg [SZMAXSTR]; int ret; confilter_out ("\n"); list_delete_all_node (dst->results); list_delete_all_node (dst->offsets); list_delete_all_node (dst->lengths); LIST_LOOP (src->results, src_s, n) { if (src_s) { dst_s = (node_s_t *)malloc (sizeof (node_s_t)); if (!dst_s){ confilter_out ("Failed to malloc node for result list\n"); return FALSE; } strcpy (dst_s->s, src_s->s); /* TODO: buffer overflow */ listnode_add (dst->results, dst_s); } }/* end LIST_LOOP */ LIST_LOOP (src->offsets, src_v, n) { if (src_v) { dst_v = (node_v_t *)malloc (sizeof (node_v_t)); if (!dst_v){ confilter_out ("Failed to malloc node for offset list\n"); return FALSE; } dst_v->v = src_v->v; listnode_add (dst->offsets, dst_v); } }/* end LIST_LOOP */ LIST_LOOP (src->lengths, src_v, n) { if (src_v) { dst_v = (node_v_t *)malloc (sizeof (node_v_t)); if (!dst_v){ confilter_out ("Failed to malloc node for length list\n"); return FALSE; } dst_v->v = src_v->v; listnode_add (dst->lengths, dst_v); } }/* end LIST_LOOP */ dst->imatched = src->imatched; dst->wascompiled = src->wascompiled; strcpy (dst->searchstring, src->searchstring); if (dst->wascompiled != FALSE) { if ((ret = regcomp (&dst->reg, dst->searchstring, REG_ICASE | REG_EXTENDED))){ regerror (ret, &dst->reg, errmsg, sizeof (errmsg)); confilter_out ("Failed to regcomp: %s\n", errmsg); regfree (&dst->reg); dst->imatched = FALSE; dst->wascompiled = FALSE; } } return TRUE; } int regexp_comp (regexp_t *regx, const char* exp) { char errmsg [SZMAXSTR]; int ret; confilter_out ("\n"); if (regx->wascompiled != FALSE) { regfree (®x->reg); regx->wascompiled = FALSE; } if (!regx->results && !regx->offsets && !regx->offsets) { /* seems first. so, initialize regexp */ if ( regexp_init (regx) != TRUE ) { confilter_out ("Failed to initialize regexp\n"); return FALSE; } } else { list_delete_all_node (regx->results); list_delete_all_node (regx->offsets); list_delete_all_node (regx->lengths); regx->imatched = FALSE; } if ((ret = regcomp(®x->reg, exp, REG_ICASE | REG_EXTENDED))) { regerror (ret, ®x->reg, errmsg, sizeof (errmsg)); confilter_out ("Failed to regcomp: %s\n", errmsg); regfree(®x->reg); return FALSE; } regx->wascompiled = TRUE; strcpy (regx->searchstring, exp); return TRUE; } int regexp_match (regexp_t *regx, const char* text) { char *pos = (char*)text; int i; regmatch_t *pmatch = NULL; regmatch_t *o_pmatch = NULL; size_t matchlen; char *submatch; unsigned int largestoffset; char errmsg [SZMAXSTR]; int ret; int error = 0; node_s_t *node_s; node_v_t *node_v; confilter_out ("\n"); if (regx->wascompiled != TRUE) { confilter_out ("reg was not compiled\n"); return FALSE; } confilter_out ("\n"); list_delete_all_node (regx->results); list_delete_all_node (regx->offsets); list_delete_all_node (regx->lengths); confilter_out ("\n"); regx->imatched = FALSE; pmatch = (regmatch_t *)malloc (sizeof (regmatch_t) * (regx->reg.re_nsub + 1)); if (!pmatch) { confilter_out ("Failed to malloc of pmatch\n"); regx->imatched = FALSE; return FALSE; } o_pmatch = pmatch; confilter_out ("\n"); if ((ret = regexec(®x->reg, pos, regx->reg.re_nsub + 1, pmatch, 0))) { confilter_out ("\n"); regerror (ret, ®x->reg, errmsg, sizeof (errmsg)); confilter_out ("\n"); confilter_out ("Failed to regexec: %s\n", errmsg); confilter_out ("no match for: %s\n", regx->searchstring); free (o_pmatch); confilter_out ("\n"); regx->imatched = FALSE; return TRUE; } confilter_out ("------------> ! Find match for: %s\n", regx->searchstring); while (!error) { largestoffset = 0; confilter_out ("\n"); for (i = 0; i <= (signed)regx->reg.re_nsub; i++, pmatch++) { confilter_out ("\n"); if (pmatch->rm_so != -1) { confilter_out ("\n"); matchlen = pmatch->rm_eo - pmatch->rm_so; confilter_out ("\n"); submatch = (char *)malloc (matchlen + 1); if (!submatch) { confilter_out ("Failed to malloc for submatch\n"); free (o_pmatch); return FALSE; } confilter_out ("\n"); strncpy(submatch, pos + pmatch->rm_so, matchlen); confilter_out ("\n"); *(submatch + matchlen) = '\0'; confilter_out ("\n"); #if 0 results.push_back(std::string(submatch)); offsets.push_back(pmatch[i].rm_so + (pos - text)); lengths.push_back(matchlen); #endif /* add submatch to result list */ confilter_out ("\n"); node_s = (node_s_t *)malloc (sizeof (node_s_t)); confilter_out ("\n"); if (!node_s){ confilter_out ("Failed to malloc node for result list\n"); free (o_pmatch); free (submatch); return FALSE; } confilter_out ("\n"); strcpy (node_s->s, submatch); confilter_out ("\n"); listnode_add (regx->results, node_s); /* add offset to offsets list */ node_v = (node_v_t *)malloc (sizeof (node_v_t)); if (!node_v){ confilter_out ("Failed to malloc node for offset list\n"); free (o_pmatch); free (submatch); return FALSE; } confilter_out ("\n"); node_v->v = pmatch->rm_so + (pos - text); listnode_add (regx->offsets, node_v); confilter_out ("\n"); /* add matchlen to length list */ node_v = (node_v_t *)malloc (sizeof (node_v_t)); if (!node_v){ confilter_out ("Failed to malloc node for offset list\n"); free (o_pmatch); free (submatch); return FALSE; } confilter_out ("\n"); node_v->v = matchlen; listnode_add (regx->offsets, node_v); confilter_out ("\n"); free (submatch); if ((pmatch->rm_so + matchlen) > largestoffset) { confilter_out ("\n"); largestoffset = pmatch->rm_so + matchlen; } }/* if (pmatch[i].rm_so != -1) */ } confilter_out ("\n"); if (largestoffset > 0) { confilter_out ("\n"); pos += largestoffset; error = regexec(®x->reg, pos, regx->reg.re_nsub + 1, pmatch, REG_NOTBOL); } else { confilter_out ("\n"); error = -1; } } confilter_out ("\n"); regx->imatched = TRUE; free (o_pmatch); confilter_out ("match(s) for:%s\n", regx->searchstring); return TRUE; } char * regexp_result(regexp_t *regx, int i) { #if 0 std::string RegExp::result(int i) { if (i >= (signed)results.size() || i < 0) { // reality check return ""; // maybe exception? } return results[i]; } #endif struct listnode *n; node_s_t *src_s; int cnt = 0; confilter_out ("\n"); if (i >= listcount (regx->results) || i < 0 ) { confilter_out ("index break limit, i(%d), node count of result list(%d)\n", i, listcount (regx->results)); return ""; } confilter_out ("\n"); LIST_LOOP (regx->results, src_s, n) { confilter_out ("\n"); if (src_s && cnt++ == i) { confilter_out ("\n"); return src_s->s; } } confilter_out ("Failed to find i(%d), node count of result list(%d)\n", i, listcount (regx->results)); return ""; } unsigned int regexp_offset(regexp_t *regx, int i) { #if 0 unsigned int RegExp::offset(int i) { if (i >= (signed)offsets.size() || i < 0) { // reality check return 0; // maybe exception? } return offsets[i]; } #endif struct listnode *n; node_v_t *src_v; int cnt = 0; confilter_out ("\n"); if (i >= listcount (regx->offsets) || i < 0 ) { confilter_out ("index break limit, i(%d), node count of offsets(%d)\n", i, listcount (regx->offsets)); return FALSE; } LIST_LOOP (regx->offsets, src_v, n) { if (src_v && cnt++ == i) { return src_v->v; } } confilter_out ("Failed to find i(%d), node count of offsets list(%d)\n", i, listcount (regx->offsets)); return FALSE; /* TODO : offset can be zero == FALSE */ } unsigned int regexp_length(regexp_t *regx, int i) { #if 0 unsigned int RegExp::length(int i) { if (i >= (signed)lengths.size() || i < 0) { // reality check return 0; // maybe exception? } return lengths[i]; } #endif struct listnode *n; node_v_t *src_v; int cnt = 0; confilter_out ("\n"); if (i >= listcount (regx->lengths) || i < 0 ) { confilter_out ("index break limit, i(%d), node count of lengths list(%d)\n", i, listcount (regx->lengths)); return FALSE; } LIST_LOOP (regx->lengths, src_v, n) { if (src_v && cnt++ == i) { return src_v->v; } } confilter_out ("Failed to find i(%d), node count of lengths list(%d)\n", i, listcount (regx->lengths)); return FALSE;/* TODO : length can be zero == FALSE */ } int regexp_numberOfMatches(regexp_t *regx) { #if 0 int RegExp::numberOfMatches() { int i = (signed)results.size(); return i; } #endif confilter_out ("\n"); return listcount (regx->results); } int regexp_matched(regexp_t *regx) { #if 0 bool RegExp::matched() { return imatched; // regexp matches only } #endif confilter_out ("\n"); return regx->imatched; } char* regexp_search(char* file, char* fileend, char* phrase, char* phraseend) { #if 0 char* RegExp::search(char* file, char* fileend, char* phrase, char* phraseend) { int j, l; // counters int p; // to hold precalcuated value for speed bool match; // flag int qsBc[256]; // Quick Search Boyer Moore shift table (256 alphabet) char* k; // pointer used in matching int pl = phraseend - phrase; // phrase length int fl = (int)(fileend - file) - pl; // file length that could match if (fl < pl) return fileend; // reality checking if (pl > 126) return fileend; // reality checking // For speed we append the phrase to the end of the memory block so it // is always found, thus eliminating some checking. This is possible as // we know an extra 127 bytes have been provided by NaughtyFilter.cpp // and also the OptionContainer does not allow phrase lengths greater // than 126 chars for(j = 0; j < pl; j++) { fileend[j] = phrase[j]; } // Next we need to make the Quick Search Boyer Moore shift table p = pl + 1; for (j = 0; j < 256; j++) { // Preprocessing qsBc[j] = p; } for (j = 0; j < pl; j++) { // Preprocessing qsBc[(unsigned char)phrase[j]] = pl - j; } // Now do the searching! for(j = 0;;) { k = file + j; match = true; for (l = 0; l < pl; l++) { // quiv, but faster, memcmp() if (k[l] != phrase[l]) { match = false; break; } } if (match) { return (j + file); // match found at offset j (but could be the // copy put at fileend) } j += qsBc[(unsigned char)file[j + pl]]; // shift } return fileend; // should never get here as it should always match } #endif confilter_out ("\n"); return NULL; } |
From: linuxpark <lin...@us...> - 2006-04-06 15:10:03
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8575 Modified Files: confio.h confproc.h confutil.h global.h linklist.h message.h slog.h sysdef.h sysioctl.h sysipc.h sysnio.h sysshm.h syssnmp.h systime.h sysutil.h Log Message: ADD: macro for confilter and modify mail address. Index: syssnmp.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/syssnmp.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** syssnmp.h 30 Jan 2006 17:41:29 -0000 1.1.1.1 --- syssnmp.h 6 Apr 2006 15:09:37 -0000 1.2 *************** *** 2,6 **** Title : syssnmp.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : syssnmp.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: global.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/global.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** global.h 7 Mar 2006 04:45:09 -0000 1.5 --- global.h 6 Apr 2006 15:09:34 -0000 1.6 *************** *** 2,6 **** Title : global.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : compile time config header --- 2,6 ---- Title : global.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : compile time config header Index: confutil.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confutil.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** confutil.h 7 Mar 2006 17:04:51 -0000 1.6 --- confutil.h 6 Apr 2006 15:09:34 -0000 1.7 *************** *** 2,6 **** Title : confutil.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : confutil.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: linklist.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/linklist.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** linklist.h 6 Mar 2006 14:16:05 -0000 1.2 --- linklist.h 6 Apr 2006 15:09:36 -0000 1.3 *************** *** 2,6 **** Title : linklist.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : linklist header, refer example at the end of file --- 2,6 ---- Title : linklist.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : linklist header, refer example at the end of file Index: confio.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confio.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** confio.h 30 Jan 2006 17:41:29 -0000 1.1.1.1 --- confio.h 6 Apr 2006 15:09:34 -0000 1.2 *************** *** 1,6 **** /* - Title : confio.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 1,5 ---- /* Title : confio.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: sysshm.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysshm.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sysshm.h 6 Mar 2006 04:23:56 -0000 1.8 --- sysshm.h 6 Apr 2006 15:09:37 -0000 1.9 *************** *** 2,6 **** Title : sysshm.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : definitioin for shared memory, shm is used for runtime config --- 2,6 ---- Title : sysshm.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : definitioin for shared memory, shm is used for runtime config Index: message.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/message.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** message.h 8 Mar 2006 15:29:55 -0000 1.7 --- message.h 6 Apr 2006 15:09:36 -0000 1.8 *************** *** 2,6 **** Title : message.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : message definition header --- 2,6 ---- Title : message.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : message definition header Index: sysnio.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysnio.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sysnio.h 30 Jan 2006 17:41:29 -0000 1.1.1.1 --- sysnio.h 6 Apr 2006 15:09:36 -0000 1.2 *************** *** 2,6 **** Title : sysnio.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : sysnio.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: confproc.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confproc.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** confproc.h 13 Mar 2006 14:15:05 -0000 1.7 --- confproc.h 6 Apr 2006 15:09:34 -0000 1.8 *************** *** 2,6 **** Title : confproc.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : confproc.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: slog.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/slog.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** slog.h 30 Jan 2006 17:41:29 -0000 1.1.1.1 --- slog.h 6 Apr 2006 15:09:36 -0000 1.2 *************** *** 2,6 **** Title : slog.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : slog.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: sysutil.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysutil.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sysutil.h 6 Mar 2006 14:16:05 -0000 1.4 --- sysutil.h 6 Apr 2006 15:09:37 -0000 1.5 *************** *** 2,6 **** Title : sysutil.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : sysutil.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : *************** *** 49,52 **** --- 49,59 ---- #endif + #ifdef CONFILTER_DEBUG + #define confilter_out(fmt, args...) \ + printf("%s,%s,%d: " fmt, __FILE__, __FUNCTION__, __LINE__, ##args) + #else + #define confilter_out(fmt, args...) {} + #endif + #define alloc_common(a, b, c) do { \ a = (char *)malloc (strlen(csm->community)); \ *************** *** 170,173 **** --- 177,185 ---- void set_power(int idx, int pw_index, int val, frp_t fr); int parse_iprange (const char *ip, unsigned char *parsed, frp_t fr); + /* content filtering routine use this utils loadfile, subString, strindexof */ + char * loadfile (char *fn, int *len); + char *subString(char *buf, int start, int l); + int strindexof (char *p, const char *s); + #endif /* __SYSUTIL_H */ Index: sysipc.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysipc.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sysipc.h 7 Mar 2006 04:45:09 -0000 1.6 --- sysipc.h 6 Apr 2006 15:09:36 -0000 1.7 *************** *** 2,6 **** Title : sysipc.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : local ipc fn header --- 2,6 ---- Title : sysipc.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : local ipc fn header Index: sysioctl.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysioctl.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sysioctl.h 10 Mar 2006 16:52:05 -0000 1.5 --- sysioctl.h 6 Apr 2006 15:09:36 -0000 1.6 *************** *** 2,6 **** Title : sysioctl.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : ioctl for pf --- 2,6 ---- Title : sysioctl.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : ioctl for pf Index: sysdef.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysdef.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sysdef.h 13 Mar 2006 14:15:05 -0000 1.9 --- sysdef.h 6 Apr 2006 15:09:36 -0000 1.10 *************** *** 2,6 **** Title : sysdef.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : header for each object definition --- 2,6 ---- Title : sysdef.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : header for each object definition Index: systime.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/systime.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** systime.h 30 Jan 2006 17:41:29 -0000 1.1.1.1 --- systime.h 6 Apr 2006 15:09:37 -0000 1.2 *************** *** 2,6 **** Title : systime.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 2,6 ---- Title : systime.h ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : |
From: linuxpark <lin...@us...> - 2006-04-06 15:08:00
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6989 Added Files: naufilter.h regexp.h Log Message: Initial Check-in of the library for contents filtering. ported C library of dansgardian's oop --- NEW FILE: regexp.h --- /* Title : regexp.h Author : Jeho-Park <lin...@gm...> Created date : 2006. 04. 06. (thu) 23:54:35 KST Description : header of regular exp */ #ident "@(#) $Header: /cvsroot/netadm/gwc/include/regexp.h,v 1.1 2006/04/06 15:07:43 linuxpark Exp $" #ifndef __H_REGEXP #define __H_REGEXP #include <sys/types.h> #include <regex.h> #include "linklist.h" #include "naufilter.h" typedef struct { char s [SZMAXSTR]; }node_s_t; typedef struct { unsigned int v; }node_v_t; typedef struct { list results; list offsets; list lengths; int imatched; regex_t reg; int wascompiled; char searchstring [SZMAXSTR]; } regexp_t; /* all of these function will be used in naufilter */ int regexp_init (regexp_t *regx); int regexp_clean (regexp_t *regx); int regexp_destory (regexp_t *regx); int regexp_copy (regexp_t *dst, regexp_t *src); int regexp_comp (regexp_t *regx, const char* exp); int regexp_match (regexp_t *regx, const char* text); int regexp_numberOfMatches (regexp_t *regx); int regexp_matched (regexp_t *regx); char* regexp_result(regexp_t *regx, int i); unsigned int regexp_offset (regexp_t *regx, int i); unsigned int regexp_length (regexp_t *regx, int i); char* regexp_search (char* file, char* fileend, char* phrase, char* phraseend); #endif --- NEW FILE: naufilter.h --- /* Title : naufilter.h Author : Jeho-Park <lin...@gm...> Created date : 2006. 04. 06. (thu) 23:54:35 KST Description : header of naufilter */ #ident "@(#) $Header: /cvsroot/netadm/gwc/include/naufilter.h,v 1.1 2006/04/06 15:07:43 linuxpark Exp $" #ifndef __H_NAUFILTER #define __H_NAUFILTER #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define SZMAXSESS 1 /* M A X S E S S I O N #*/ #define SZMAXBUF 8196 #define SZMAXSTR 8196 typedef struct { int pics_rsac_violence; int pics_rsac_sex; int pics_rsac_nudity; int pics_rsac_language; int pics_icra_chat; int pics_icra_moderatedchat; int pics_icra_languagesexual; int pics_icra_languageprofanity; int pics_icra_languagemildexpletives; int pics_icra_nuditygraphic; int pics_icra_nuditymalegraphic; int pics_icra_nudityfemalegraphic; int pics_icra_nuditytopless; int pics_icra_nuditybottoms; int pics_icra_nuditysexualacts; int pics_icra_nudityobscuredsexualacts; int pics_icra_nuditysexualtouching; int pics_icra_nuditykissing; int pics_icra_nudityartistic; int pics_icra_nudityeducational; int pics_icra_nuditymedical; int pics_icra_drugstobacco; int pics_icra_drugsalcohol; int pics_icra_drugsuse; int pics_icra_gambling; int pics_icra_weaponuse; int pics_icra_intolerance; int pics_icra_badexample; int pics_icra_pgmaterial; int pics_icra_violencerape; int pics_icra_violencetohumans; int pics_icra_violencetoanimals; int pics_icra_violencetofantasy; int pics_icra_violencekillinghumans; int pics_icra_violencekillinganimals; int pics_icra_violencekillingfantasy; int pics_icra_violenceinjuryhumans; int pics_icra_violenceinjuryanimals; int pics_icra_violenceinjuryfantasy; int pics_icra_violenceartisitic; int pics_icra_violenceeducational; int pics_icra_violencemedical; int pics_icra_violencesports; int pics_icra_violenceobjects; int pics_evaluweb_rating; int pics_cybernot_sex; int pics_cybernot_other; int pics_safesurf_agerange; int pics_safesurf_profanity; int pics_safesurf_heterosexualthemes; int pics_safesurf_homosexualthemes; int pics_safesurf_nudity; int pics_safesurf_violence; int pics_safesurf_sexviolenceandprofanity; int pics_safesurf_intolerance; int pics_safesurf_druguse; int pics_safesurf_otheradultthemes; int pics_safesurf_gambling; int pics_weburbia_rating; int pics_vancouver_multiculturalism; int pics_vancouver_educationalcontent; int pics_vancouver_environmentalawareness; int pics_vancouver_tolerance; int pics_vancouver_violence; int pics_vancouver_sex; int pics_vancouver_profanity; int pics_vancouver_safety; int pics_vancouver_canadiancontent; int pics_vancouver_commercialcontent; int pics_vancouver_gambling; } confilter_conf_t; #include "regexp.h" typedef struct { regexp_t pics1; regexp_t pics2; regexp_t isiphost; int isnaughty; confilter_conf_t *conf; } confilter_session_t; /* * init_precompileregexps * return: success(TRUE) || error (FALSE) * : initailize reg exp object for a given session */ int init_precompileregexps (confilter_session_t *sess); /* * free_precompileregexps * return: success (TRUE) || error (FALSE) * : free linkedlists and regex_t objects of pic1, pic2, iphost for a given session. */ int free_precompileregexps (confilter_session_t *sess); /* * checkPICS * : check routine. * return: success (TRUE)| error (FALSE), note! success don't mean session is naughty. * sess->isnaughty == TRUE || FALSE */ int checkPICS(confilter_session_t *sess, char* file, int l); #endif /* __H_NAUFILTER */ |
From: jeho-park <lin...@gm...> - 2006-03-29 18:43:26
|
hi everyone i want to know what's going on to our all member george ~ are you continue to research snort ? please let me know.. i think a few week later, i should research snort, for my company.. or for netadm for about two week from next week, i have to do performance test of IPS system ( safenet, safenet-inc.com ) i will refer to " An NSS Group Report V 1.0, Intrusion Prevention Systems(IPS), Group Test, NSS, Jan., 2004." or " http://kidbs.itfind.or.kr/new-bin/WZIN/WebzineRead.cgi?recno=0901013827&mcode=jugidong" to get IPS performance metric and how to test, and if possible, i will use our packet generator ("npt") for variable TCP/UDP thput test. i hope this test may give me some more wide understanding about IPS, i will mail the result of this test later throught this mailling list. p.s: i thought it would be better to divide QoS, IPS functionality to each component or the functionality and its usage must be decided by user at install time. for example, <install gwc > +--------------------------------+ | ( ) use QoS | | ( ) use IPS | | ( ) use monitoring | | (ok) (cancel) ... | +--------------------------------+ |
From: jeho-park <lin...@gm...> - 2006-03-26 22:27:21
|
hi everyone. todays, i am waiting hyoseok hwang's GUI commit in gwc source branch and until he will check in his code, i will continue to do my sub project ? at http://stonelinux.sf.net hyoseok said to me that he would start to make GUI from late march, i expect he would finish up his work in early or late april in 2006. if he would done his work, i will restart debugging gwc. :-( [the motive of stonelinux project] 1. understanding and testing linux network stack and its drivers. the first motive came from during making IPS 3 years ago in my lab ( http://dclab.skku.ac.kr ) using the cvs of sourceforge ( http://geto.sf.net ) and about one years ago(2005. 02) making or porting net-BSD's OCF driver( for example, http://ocf-linux.sf.net) targetting to the kernel of linux for my company. todays david continue porting and developing OCF frame at linux since 2003. he may be work for snapgear or montavista. during these period, i realized that i need overall or code level understanding from network driver, sk buffer to BSD socket. 2. suggestion from some company of korean. half a month ago, some company suggest to me to restart porting or modifying their accelator device driver. so before staring this work, i determine to make test codes or make document just only for self-studying. how to join stonelinux is easy, just upload your testing code or your documents to the http://stonelinux.sf.net server then let us know what you have done through this mailling list. [ net...@li... ] my script [ http://jhpark.guideline.co.kr/data/PROJECT/stonelinux/src/scripts/myscp ] will help you to upload your code or docs files to stonelinux.sf.net thanks regards jeho-park |
From: il-eok h. <ie...@gm...> - 2006-03-19 12:10:56
|
hi, jeho-park. jeho-park wrote: hm.. it's so currious why did you implement content filtering of L4 to the > L2 layer of netfilter frame. ? > is there any reason ? .. for performance ? *=3D=3D> As you guess, just for performance.* *Last year, I had developed "HARM Site Filter" for minors in user land.* *It use port re-direction. But too slow. So I dicided to port to kernel.* *To my satisfaction, it show me excellent performance*. jeho-park wrote : i need some time to modify or delete some commercial code in it. i want > your understanding *=3D=3D> Sure. I really understand.* Have a nice day ~~~~ 2006/3/19, jeho-park <lin...@gm...>: > > hi il-eok > > > il-eok hwang wrote: > > > hi.. jeho-park. > > Oh, Did you make the HTTP Proxy? > > .. about 4,5 years ago, i made or upgraded HTTP, TELNET proxy daemon for > my company. > but it is almost same as relay-proxy. (^^; few functionality. -_-; > (user auth/proxy policy auth, virus checking, url filtering that's all) = i > used virus checking engine of other company. > > > Last year, I also make the Harm site Filter supported > the PICS operated in KERNEL. I use netfilter target in developing that. > > > good !. > a few hours ago, i completed porting content filter part of dansguard ( > http://dansguardian.org/) to my c library in bsd-i386-release6.0 . but > during testing this library, i found that some case of calling "regexec" > that process was killed by SIGFAULT SIG only in linux. > > hm.. it's so currious why did you implement content filtering of L4 to th= e > L2 layer of netfilter frame. ? > is there any reason ? .. for performance ? but it seems so very > interesting > i think netfilter is very interesting stuff ~, and i consider L2 > layer programmer is real network programmer. > and other socket programmer is just application programmer. so you looks > so excellent ~ > > > If you ok, I want to see the your source code. > > > i need some time to modify or delete some commercial code in it. i want > your understanding. > > regards. > jeho-park. > > > Have a nice day~~~ > > > 2006/3/18, jeho-park <lin...@gm...>: > > > > hi kwan-kyung > > > > i remember that you hope to develop virus checking module in gwc. > > > > about a few months later, i will schedule to check in my L4 proxy > > daemon source to our cvs, if you don't. > > this proxy may be just a general port proxy(just only relay proxy). and > > than i will expend its properity to the specified port proxy daemon. > > for example, HTTP and FTP > > if you want to make proxy daemon by yourself, i don't hesitate to thro= w > > away my proxy source. > > but if your proxy daemon come from other open source, i dont want to us= e > > it instead of my self made daemon. > > i want your reply about this idea! > > > > todays, i am analyzing and porting dansguard (content filtering module= ) > > of HTTP proxy daemon for money ^-^; > > and it is almost finished to make it to c library of contents filterin= g > > module. (supporting PICS, site rating) > > in this year, i will check in this content filtering library to our gwc= , > > i want you to develop and check in your virus checking module to our > > HTTP proxy. how about this suggestion ? if possible, i also want yo= u > > > > to develop web proxy as i described above. > > > > > > i will try to make our project more active and more profitable or money > > making. > > so i need more help. bye ~ > > > > regards > > jeho park. > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting > > language > > that extends applications into web and mobile media. Attend the live > > webcast > > and join the prime developer group breaking into this new coding > > territory! > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > > > > _______________________________________________ > > Netadm-devel mailing list > > Net...@li... > > https://lists.sourceforge.net/lists/listinfo/netadm-devel > > > > > |
From: jeho-park <lin...@gm...> - 2006-03-18 22:23:27
|
hi il-eok il-eok hwang wrote: > > hi.. jeho-park. > > Oh, Did you make the HTTP Proxy? .. about 4,5 years ago, i made or upgraded HTTP, TELNET proxy daemon for my company. but it is almost same as relay-proxy. (^^; few functionality. -_-; (user auth/proxy policy auth, virus checking, url filtering that's all) i used virus checking engine of other company. > Last year, I also make the Harm site Filter supported > the PICS operated in KERNEL. I use netfilter target in developing that. > good !. a few hours ago, i completed porting content filter part of dansguard ( http://dansguardian.org/) to my c library in bsd-i386-release6.0 . but during testing this library, i found that some case of calling "regexec" that process was killed by SIGFAULT SIG only in linux. hm.. it's so currious why did you implement content filtering of L4 to the L2 layer of netfilter frame. ? is there any reason ? .. for performance ? but it seems so very interesting i think netfilter is very interesting stuff ~, and i consider L2 layer programmer is real network programmer. and other socket programmer is just application programmer. so you looks so excellent ~ > If you ok, I want to see the your source code. i need some time to modify or delete some commercial code in it. i want your understanding. regards. jeho-park. > > Have a nice day~~~ > > > 2006/3/18, jeho-park <lin...@gm... > <mailto:lin...@gm...>>: > > hi kwan-kyung > > i remember that you hope to develop virus checking module in gwc. > > about a few months later, i will schedule to check in my L4 proxy > daemon source to our cvs, if you don't. > this proxy may be just a general port proxy(just only relay > proxy). and > than i will expend its properity to the specified port proxy daemon. > for example, HTTP and FTP > if you want to make proxy daemon by yourself, i don't hesitate to > throw > away my proxy source. > but if your proxy daemon come from other open source, i dont want > to use > it instead of my self made daemon. > i want your reply about this idea! > > todays, i am analyzing and porting dansguard (content filtering > module) > of HTTP proxy daemon for money ^-^; > and it is almost finished to make it to c library of contents > filtering > module. (supporting PICS, site rating) > in this year, i will check in this content filtering library to > our gwc, > i want you to develop and check in your virus checking module to our > HTTP proxy. how about this suggestion ? if possible, i also > want you > to develop web proxy as i described above. > > > i will try to make our project more active and more profitable or > money > making. > so i need more help. bye ~ > > regards > jeho park. > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the > live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642> > _______________________________________________ > Netadm-devel mailing list > Net...@li... > <mailto:Net...@li...> > https://lists.sourceforge.net/lists/listinfo/netadm-devel > <https://lists.sourceforge.net/lists/listinfo/netadm-devel> > > |
From: linuxpark <lin...@us...> - 2006-03-18 17:45:47
|
Update of /cvsroot/netadm/gwc/pf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8626 Modified Files: pf.c pf.h sysktimer.c sysktimer.h Log Message: MOD: modify previos sysktimer to more simple 3 exported library function. 1. sysktimer_t *init_sysktimer ( handler-func-pointer, parameter-to-handler, timeout-sec[0:forever | specified second], secound [ to wakeup handler ], nanosecond [ to wakeup handler ] ) : initialize data struct for timer : return value : timer object(success) or null (fail) 2. int register_sysktimer (timer_object) : activate timer : return value : fail (minu integer), success (task id) 3. int unregister_sysktimer (tid, ktimer) : deactivate timer and destory timer object : return value : fail (minus integer), success (plus integer) Index: sysktimer.h =================================================================== RCS file: /cvsroot/netadm/gwc/pf/sysktimer.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sysktimer.h 10 Mar 2006 16:48:49 -0000 1.3 --- sysktimer.h 18 Mar 2006 17:45:41 -0000 1.4 *************** *** 1,6 **** /* ! * filename : timer.h * 2006. 02. 28. (thu) 08:39:39 KST ! * lin...@gm... */ #include <linux/init.h> --- 1,6 ---- /* ! * filename : sysktimer.h * 2006. 02. 28. (thu) 08:39:39 KST ! * jeho park <lin...@us...> */ #include <linux/init.h> *************** *** 12,27 **** #include <linux/interrupt.h> ! #ifndef __SYS_KTIMER_H ! #define __SYS_KTIMER_H ! struct sys_timer_t { int (*func)(void *argument); void *data; int t_time; struct timespec t; ! }; ! extern pid_t register_sys_timer ( struct sys_timer_t *timer ); ! extern int unregister_sys_timer ( pid_t pid ); #endif --- 12,46 ---- #include <linux/interrupt.h> ! #ifndef __H_SYSKTIMER ! #define __H_SYSKTIMER ! #ifndef SZSYSVERSION ! #define SZSYSVERSION "sysktimer-v0.1.0" ! #endif ! ! typedef struct { int (*func)(void *argument); void *data; int t_time; struct timespec t; ! } sysktimer_t; ! /* init_sysktimer ! * @func: handler of timer ! * @data: argument of hander ! * @total_sec: total time to make live timer. ! * @p_sec: period of waking up handler. sec unit. ! * @p_nsec:period of waking up handler. nano sec unit. ! * ! * return: null: Fail, not null: sucess ! */ ! extern sysktimer_t * init_sysktimer (int (*func)(void *argument), ! void *data, ! unsigned long total_sec, ! unsigned long p_sec, ! unsigned long p_nsec); ! ! extern pid_t register_sysktimer ( sysktimer_t *sysktimer ); ! extern int unregister_sysktimer ( pid_t pid, sysktimer_t *sysktimer); #endif Index: pf.h =================================================================== RCS file: /cvsroot/netadm/gwc/pf/pf.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pf.h 10 Mar 2006 16:48:49 -0000 1.4 --- pf.h 18 Mar 2006 17:45:41 -0000 1.5 *************** *** 1,6 **** /* - Title : pf.h ! Author : Jeho-Park <ne...@ke...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : --- 1,5 ---- /* Title : pf.h ! Author : Jeho-Park <lin...@us...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : Index: pf.c =================================================================== RCS file: /cvsroot/netadm/gwc/pf/pf.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pf.c 14 Mar 2006 17:17:08 -0000 1.7 --- pf.c 18 Mar 2006 17:45:41 -0000 1.8 *************** *** 1,6 **** /* - Title : pf.c ! Author : Jeho-Park <lin...@gm...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : pf module --- 1,5 ---- /* Title : pf.c ! Author : Jeho-Park <lin...@us...> Created date : 2006. 01. 31. (thu) 01:39:30 KST Description : pf module *************** *** 53,56 **** --- 52,56 ---- static pid_t tid; /* timer thread id */ + static sysktimer_t *pf_ktimer = NULL; static int debug __initdata = 0; static int kuio_rdopen = 0; *************** *** 79,83 **** return map->id; } - map++; } --- 79,82 ---- *************** *** 87,91 **** EXPORT_SYMBOL_GPL (mapstrtoid); - /* block list hash table */ static struct blk_hash_bucket *blk_hash_table; --- 86,89 ---- *************** *** 306,318 **** } - static void init_systimer (struct sys_timer_t * t) - { - t->func = update_eat; /* handler */ - t->data = NULL; /* param of handler */ - t->t_time = 0; /* total time endless */ - t->t.tv_sec = 0; /* sec */ - t->t.tv_nsec = 1000000000; /* nano sec */ - } - /* process_packet * : This is called with lock state of spinlock in a bucket --- 304,307 ---- *************** *** 630,635 **** gwc_pf_init(void) { ! static struct sys_timer_t timer; ! printk("%s: Loading %s module ...\n", DEVICE_NAME, DEVICE_NAME); --- 619,623 ---- gwc_pf_init(void) { ! printk("%s: Loading %s module ...\n", DEVICE_NAME, DEVICE_NAME); *************** *** 640,650 **** init_pf(); init_kuio(); ! init_systimer(&timer); ! ! /* TODO : in futer, tid can be pid list for each timer thread */ ! if ( (tid = register_sys_timer( &timer)) < 0 ) { ! printk("%s: Failed to register timer\n", DEVICE_NAME); ! /* FIXME */ } return 0; } --- 628,642 ---- init_pf(); init_kuio(); ! ! pf_ktimer = init_sysktimer (update_eat, NULL, 0, 0, 1000000000); ! if (!pf_ktimer) { ! printk("%s: Failed to init sysktimer\n", DEVICE_NAME); ! return 1; } + + if ((tid = register_sysktimer (pf_ktimer)) < 0 ) { + printk("%s: Failed to register sysktimer\n", DEVICE_NAME); + } + return 0; } *************** *** 654,660 **** gwc_pf_exit(void) { ! if ( tid > 0 && unregister_sys_timer(tid) < 0 ) { ! printk("%s: Failed to unregister timer\n", DEVICE_NAME); } --- 646,653 ---- gwc_pf_exit(void) { + int ret; ! if ( tid > 1 && ((ret = unregister_sysktimer(tid, pf_ktimer))) < 0 ) { ! printk("%s: Failed to unregister timer (%d)\n", DEVICE_NAME, ret); } Index: sysktimer.c =================================================================== RCS file: /cvsroot/netadm/gwc/pf/sysktimer.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sysktimer.c 10 Mar 2006 16:48:49 -0000 1.3 --- sysktimer.c 18 Mar 2006 17:45:41 -0000 1.4 *************** *** 1,6 **** /* ! * filename : timer.c * 2006. 02. 28. (thu) 08:38:14 KST ! * lin...@gm... */ --- 1,6 ---- /* ! * filename : sysktimer.c * 2006. 02. 28. (thu) 08:38:14 KST ! * jeho park <lin...@us...> */ *************** *** 14,18 **** #include <linux/kthread.h> #include "sysktimer.h" - #include "../include/global.h" #define DRIVER_AUTHOR "jeho park <lin...@gm...>" --- 14,17 ---- *************** *** 21,38 **** static int netadm_timer_thread (void *data) { ! struct sys_timer_t *p = NULL; ! unsigned long expire; ! unsigned long i_time = jiffies; ! int ret = 1; ! p = (struct sys_timer_t*)data; if (!p) { ret = -1; ! printk("null timer struct\n"); } if ( p->t_time < 0 || p->t.tv_sec < 0 || p->t.tv_nsec < 0) { ret = -1; ! printk("invalid argument given\n"); } --- 20,37 ---- static int netadm_timer_thread (void *data) { ! sysktimer_t *p = NULL; ! unsigned long expire; ! unsigned long i_time = jiffies; ! int ret = 1; ! p = (sysktimer_t*)data; if (!p) { ret = -1; ! printk("null timer struct.\n"); } if ( p->t_time < 0 || p->t.tv_sec < 0 || p->t.tv_nsec < 0) { ret = -1; ! printk("invalid argument.\n"); } *************** *** 40,44 **** return ret; ! printk("%s thread start, total time: %d\n", DRIVER_VERSION, p->t_time); expire = timespec_to_jiffies(&p->t) + (p->t.tv_sec || p->t.tv_nsec); --- 39,43 ---- return ret; ! printk("%s timer start, timeout time: %d\n", DRIVER_VERSION, p->t_time); expire = timespec_to_jiffies(&p->t) + (p->t.tv_sec || p->t.tv_nsec); *************** *** 46,50 **** if ( p->t_time > 0 && jiffies > ( p->t_time * HZ + i_time) ) { ! printk("%s: timer thread exit\n", DRIVER_VERSION); break; } --- 45,49 ---- if ( p->t_time > 0 && jiffies > ( p->t_time * HZ + i_time) ) { ! printk("%s: timer timeout(%d)...\n", DRIVER_VERSION, p->t_time); break; } *************** *** 54,63 **** expire = schedule_timeout_interruptible(expire); if (!expire) ! p->func (p->data); else { /* TODO: case "unregister_sys_timer" or other interrupt * i definitly assumed it was stemed from mine */ ! printk("%s thread exit\n", DRIVER_VERSION); return 1; } --- 53,62 ---- expire = schedule_timeout_interruptible(expire); if (!expire) ! p->func (p->data); else { /* TODO: case "unregister_sys_timer" or other interrupt * i definitly assumed it was stemed from mine */ ! printk("%s: timer exit by user request\n", DRIVER_VERSION); return 1; } *************** *** 66,70 **** } ! pid_t register_sys_timer ( struct sys_timer_t *timer ) { struct task_struct *tsk; --- 65,99 ---- } ! extern sysktimer_t * init_sysktimer (int (*func)(void *argument), ! void *data, ! unsigned long total_sec, ! unsigned long p_sec, ! unsigned long p_nsec) ! { ! static sysktimer_t *sysktimer = NULL; ! ! sysktimer = (sysktimer_t *)kmalloc (sizeof (sysktimer_t), ! in_interrupt()? GFP_ATOMIC : GFP_KERNEL); ! if (!sysktimer) { ! printk("%s: Failed to kmalloc\n", DRIVER_VERSION); ! return NULL; ! } ! sysktimer->func = func; ! ! if (data) ! sysktimer->data = data; ! else ! sysktimer->data = NULL; ! ! sysktimer->t_time = total_sec; ! sysktimer->t.tv_sec = p_sec; ! sysktimer->t.tv_nsec = p_nsec; ! ! printk("%s: successfully initialized sysktimer data\n", DRIVER_VERSION); ! return sysktimer; ! } ! EXPORT_SYMBOL_GPL (init_sysktimer); ! ! pid_t register_sysktimer (sysktimer_t *timer ) { struct task_struct *tsk; *************** *** 77,94 **** return tsk->pid; } ! EXPORT_SYMBOL_GPL (register_sys_timer); ! int unregister_sys_timer ( pid_t pid ) { struct task_struct *tsk; tsk = find_task_by_pid(pid); if (tsk) { ! return kthread_stop(tsk); } else { ! printk ("there is no such task : pid: %d\n", pid); ! return -1; } } ! EXPORT_SYMBOL_GPL (unregister_sys_timer); static int __init init_netadm_timer(void) --- 106,137 ---- return tsk->pid; } ! EXPORT_SYMBOL_GPL (register_sysktimer); ! int unregister_sysktimer (pid_t pid, sysktimer_t *sysktimer) { struct task_struct *tsk; + int ret = -1; + tsk = find_task_by_pid(pid); if (tsk) { ! ! ret = kthread_stop(tsk); ! if (ret < 0 ) { ! printk("%s: Failed to stop task(%d)\n", DRIVER_VERSION, pid); ! } ! else { ! printk("%s: Success to stop pid(%d)\n", DRIVER_VERSION, pid); ! } ! ! if (sysktimer) ! kfree (sysktimer); } else { ! printk("%s: There is no suck task(%d), sysktimer(%s)\n", ! DRIVER_VERSION, pid, sysktimer? "not null must be free":"null"); } + + return ret; } ! EXPORT_SYMBOL_GPL (unregister_sysktimer); static int __init init_netadm_timer(void) |
From: il-eok h. <ie...@gm...> - 2006-03-18 12:02:16
|
hi jeho-park. jeho-park wrote: i understand what you say, i just hope that gwc operate without installation of other external program as possible as it can. *=3D=3D> I got it what you want. I will consider the connection GWC and IP= S and rewrite the PPT.* jeho-park wrote: if your frame asolutely depends on DBM, i think we must provide installatio= n option to our user. for example, the option of "use IPS" or "no use IPS" during installation. i hope gwc to be small as possible as it can be *=3D=3D> Oh.. it's a very nice idea. After considering, if we will have to= use DBM, we do that as you said. **Thanks.* Have a nice day~~~ 2006/3/18, jeho-park <lin...@gm...>: > > hi il-eok > > > il-eok hwang wrote: > > hi.. everyone. > > jeho-park wrote: > 1. if possible, i don't want any specfied DB engine in gwc, > because i hope gwc operate with no dependency with other specfied > DB engine . so i think it is possible to use encrypted file to > store session infomation instead of using other DB engine. > i want to know how il-eok think about this point. > *=3D=3D> As i think, encrypted file is a kind of "flat DB". As you know, = we > need a DB in managing * > * the detection log. Anyway, we have to write the detection log.* > > i understand what you say, i just hope that gwc operate without > installation of other external program as possible as it can. if your fr= ame > asolutely depends on DBM, i think we must provide installation option to = our > user. for example, the option of "use IPS" or "no use IPS" during > installation. > i hope gwc to be small as possible as it can be. > > > jeho-park wrote: > and in the figure, does "DB wrapper", "Web wrapper" modules export > abstract interface function to external DB or web server ? i want to kn= ow > more about this wrapper. if so, it seems good~ > *=3D=3D> Yes. But sorry, give me a time to ready about those.* > > > yes. i will wait with pleasure. i think that's good idea. > > jeho-park wrote: > 2. in the figure of the file above, cli module interfaces with admd. > what infomation is shared in both admd and cli ? > *=3D=3D> some options. > > * > > > regards > > jeho park > > Have a nice day~~ > > > 2006/3/15, jeho-park <lin...@gm...>: > > > > > > hi netadm members > > > > todays, i received a file from il-eok. in that file, il-eok suggested > > IPS system which operate with gwc. > > > > directory : http://jhpark.guideline.co.kr/data/PROJECT/netadm/gwc/doc/g= wc-ips-frame-suggestion.pdf > > > > *gwc-ips-frame-suggestion.pdf<http://jhpark.guideline.co.kr/data/PROJEC= T/netadm/gwc/doc/gwc-ips-frame-suggestion.pdf> > > > > * > > i have a few questions to il-eok about his IPS frame. > > > > 1. if possible, i don't want any specfied DB engine in gwc, > > because i hope gwc operate with no dependency with other > > specfied > > DB engine . so i think it is possible to use encrypted file to > > store session infomation instead of using other DB engine. > > i want to know how il-eok think about this point. > > > > and in the figure, does "DB wrapper", "Web wrapper" modules export > > abstract interface function to external DB or web server ? i want to = know > > more about this wrapper. if so, it seems good~ > > * > > *2. in the figure of the file above, cli module interfaces with admd. > > what infomation is shared in both admd and cli ? > > * > > > > * > > > > |
From: jeho-park <lin...@gm...> - 2006-03-17 16:35:51
|
hi kwan-kyung i remember that you hope to develop virus checking module in gwc. about a few months later, i will schedule to check in my L4 proxy daemon source to our cvs, if you don't. this proxy may be just a general port proxy(just only relay proxy). and than i will expend its properity to the specified port proxy daemon. for example, HTTP and FTP if you want to make proxy daemon by yourself, i don't hesitate to throw away my proxy source. but if your proxy daemon come from other open source, i dont want to use it instead of my self made daemon. i want your reply about this idea! todays, i am analyzing and porting dansguard (content filtering module) of HTTP proxy daemon for money ^-^; and it is almost finished to make it to c library of contents filtering module. (supporting PICS, site rating) in this year, i will check in this content filtering library to our gwc, i want you to develop and check in your virus checking module to our HTTP proxy. how about this suggestion ? if possible, i also want you to develop web proxy as i described above. i will try to make our project more active and more profitable or money making. so i need more help. bye ~ regards jeho park. |
From: jeho-park <lin...@gm...> - 2006-03-17 16:13:38
|
hi il-eok il-eok hwang wrote: > hi.. everyone. > > jeho-park wrote: > 1. if possible, i don't want any specfied DB engine in gwc, > because i hope gwc operate with no dependency with other specfied > DB engine . so i think it is possible to use encrypted file to > store session infomation instead of using other DB engine. > i want to know how il-eok think about this point. > *==> As i think, encrypted file is a kind of "flat DB". As you know, > we need a DB in managing * > * the detection log. Anyway, we have to write the detection log.* i understand what you say, i just hope that gwc operate without installation of other external program as possible as it can. if your frame asolutely depends on DBM, i think we must provide installation option to our user. for example, the option of "use IPS" or "no use IPS" during installation. i hope gwc to be small as possible as it can be. > > jeho-park wrote: > and in the figure, does "DB wrapper", "Web wrapper" modules > export abstract interface function to external DB or web server ? i > want to know more about this wrapper. if so, it seems good~ > *==> Yes. But sorry, give me a time to ready about those.* yes. i will wait with pleasure. i think that's good idea. > jeho-park wrote: > 2. in the figure of the file above, cli module interfaces with admd. > what infomation is shared in both admd and cli ? > *==> some options. > > * regards jeho park > Have a nice day~~ > > > 2006/3/15, jeho-park <lin...@gm... > <mailto:lin...@gm...>>: > > > hi netadm members > > todays, i received a file from il-eok. in that file, il-eok > suggested IPS system which operate with gwc. > > directory : > http://jhpark.guideline.co.kr/data/PROJECT/netadm/gwc/doc/gwc-ips-frame-suggestion.pdf > <http://jhpark.guideline.co.kr/data/PROJECT/netadm/gwc/doc/gwc-ips-frame-suggestion.pdf> > *gwc-ips-frame-suggestion.pdf > <http://jhpark.guideline.co.kr/data/PROJECT/netadm/gwc/doc/gwc-ips-frame-suggestion.pdf> > > * > i have a few questions to il-eok about his IPS frame. > > 1. if possible, i don't want any specfied DB engine in gwc, > because i hope gwc operate with no dependency with other > specfied > DB engine . so i think it is possible to use encrypted > file to store session infomation instead of using other DB engine. > i want to know how il-eok think about this point. > > and in the figure, does "DB wrapper", "Web wrapper" modules > export abstract interface function to external DB or web server > ? i want to know more about this wrapper. if so, it seems good~ > * > *2. in the figure of the file above, cli module interfaces with admd. > what infomation is shared in both admd and cli ? > * > > * > > |
From: il-eok h. <ie...@gm...> - 2006-03-17 08:59:52
|
hi.. everyone. jeho-park wrote: 1. if possible, i don't want any specfied DB engine in gwc, because i hope gwc operate with no dependency with other specfied DB engine . so i think it is possible to use encrypted file to stor= e session infomation instead of using other DB engine. i want to know how il-eok think about this point. *=3D=3D> As i think, encrypted file is a kind of "flat DB". As you know, we= need a DB in managing * * the detection log. Anyway, we have to write the detection log.* jeho-park wrote: and in the figure, does "DB wrapper", "Web wrapper" modules export abstract interface function to external DB or web server ? i want to know more about this wrapper. if so, it seems good~ *=3D=3D> Yes. But sorry, give me a time to ready about those.* ** jeho-park wrote: 2. in the figure of the file above, cli module interfaces with admd. what infomation is shared in both admd and cli ? *=3D=3D> some options. *Have a nice day~~ 2006/3/15, jeho-park <lin...@gm...>: > > > hi netadm members > > todays, i received a file from il-eok. in that file, il-eok suggested IP= S > system which operate with gwc. > > directory : > http://jhpark.guideline.co.kr/data/PROJECT/netadm/gwc/doc/gwc-ips-frame-s= uggestion.pdf > *gwc-ips-frame-suggestion.pdf<http://jhpark.guideline.co.kr/data/PROJECT/= netadm/gwc/doc/gwc-ips-frame-suggestion.pdf> > > * > i have a few questions to il-eok about his IPS frame. > > 1. if possible, i don't want any specfied DB engine in gwc, > because i hope gwc operate with no dependency with other specfied > DB engine . so i think it is possible to use encrypted file to > store session infomation instead of using other DB engine. > i want to know how il-eok think about this point. > > and in the figure, does "DB wrapper", "Web wrapper" modules export > abstract interface function to external DB or web server ? i want to kn= ow > more about this wrapper. if so, it seems good~ > * > *2. in the figure of the file above, cli module interfaces with admd. > what infomation is shared in both admd and cli ? > * > > * |
From: jeho-park <lin...@gm...> - 2006-03-15 13:50:38
|
hi netadm members todays, i received a file from il-eok. in that file, il-eok suggested IPS system which operate with gwc. directory : http://jhpark.guideline.co.kr/data/PROJECT/netadm/gwc/doc/gwc-ips-frame-suggestion.pdf *gwc-ips-frame-suggestion.pdf <http://jhpark.guideline.co.kr/data/PROJECT/netadm/gwc/doc/gwc-ips-frame-suggestion.pdf> * i have a few questions to il-eok about his IPS frame. 1. if possible, i don't want any specfied DB engine in gwc, because i hope gwc operate with no dependency with other specfied DB engine . so i think it is possible to use encrypted file to store session infomation instead of using other DB engine. i want to know how il-eok think about this point. and in the figure, does "DB wrapper", "Web wrapper" modules export abstract interface function to external DB or web server ? i want to know more about this wrapper. if so, it seems good~ * *2. in the figure of the file above, cli module interfaces with admd. what infomation is shared in both admd and cli ? * * |
From: linuxpark <lin...@us...> - 2006-03-14 17:17:16
|
Update of /cvsroot/netadm/gwc/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14271/scripts Modified Files: install.sh Log Message: ADD: anyTCP, anyUDP, ICMP Index: install.sh =================================================================== RCS file: /cvsroot/netadm/gwc/scripts/install.sh,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** install.sh 8 Mar 2006 15:29:57 -0000 1.14 --- install.sh 14 Mar 2006 17:17:10 -0000 1.15 *************** *** 178,181 **** --- 178,184 ---- echo -e "[snmp]\t${SUPPORT_SNMP}" >> ${TMP_CONFIG} echo -e "[snmp_community]\t${SNMP_COMMUNITY_NAME}" >> ${TMP_CONFIG} + echo -e "[fc_svc]\tanyTCP\ttcp\t0" >> ${TMP_CONFIG} + echo -e "[fc_svc]\tanyUDP\tudp\t0" >> ${TMP_CONFIG} + echo -e "[fc_svc]\tICMP\ticmp\t0" >> ${TMP_CONFIG} return |
From: linuxpark <lin...@us...> - 2006-03-14 17:17:16
|
Update of /cvsroot/netadm/gwc/pf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14271/pf Modified Files: pf.c Log Message: ADD: anyTCP, anyUDP, ICMP Index: pf.c =================================================================== RCS file: /cvsroot/netadm/gwc/pf/pf.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pf.c 10 Mar 2006 16:48:49 -0000 1.6 --- pf.c 14 Mar 2006 17:17:08 -0000 1.7 *************** *** 332,336 **** udph = (struct udphdr *) ((char *) ip + ip->ihl * 4); ! if (udph->source != n->key.sport || udph->dest != n->key.dport) goto EXIT_ACCEPT; --- 332,342 ---- udph = (struct udphdr *) ((char *) ip + ip->ihl * 4); ! if ( !n->key.sport && !n->key.dport ) ! goto EXIT_SCHEDULE; ! else if (!n->key.sport && udph->dest == n->key.dport) ! goto EXIT_SCHEDULE; ! else if (!n->key.dport && udph->source == n->key.sport) ! goto EXIT_SCHEDULE; ! else goto EXIT_ACCEPT; *************** *** 340,352 **** tcph = (struct tcphdr *) ((__u32 *) ip + ip->ihl); ! if (tcph->source != n->key.sport || tcph->dest != n->key.dport) goto EXIT_ACCEPT; ! break; case IPPROTO_ICMP: icmph = skb_header_pointer(skb, ip->ihl * 4, sizeof (_icmph), &_icmph); ! if (icmph->type != n->key.dport) goto EXIT_ACCEPT; break; --- 346,369 ---- tcph = (struct tcphdr *) ((__u32 *) ip + ip->ihl); ! if ( !n->key.sport && !n->key.dport ) ! goto EXIT_SCHEDULE; ! else if (!n->key.sport && tcph->dest == n->key.dport) ! goto EXIT_SCHEDULE; ! else if (!n->key.dport && tcph->source == n->key.sport) ! goto EXIT_SCHEDULE; ! else goto EXIT_ACCEPT; ! break; case IPPROTO_ICMP: icmph = skb_header_pointer(skb, ip->ihl * 4, sizeof (_icmph), &_icmph); ! ! if ( !n->key.dport ) ! goto EXIT_SCHEDULE; ! else if (icmph->type != n->key.dport) goto EXIT_ACCEPT; + else + goto EXIT_SCHEDULE; break; *************** *** 357,360 **** --- 374,386 ---- } + /* TODO: NAT */ + + + EXIT_ACCEPT: + spin_unlock (&bucket->lock); + return NF_ACCEPT; + + EXIT_SCHEDULE: + n->host.eat += skb->len; if (n->host.rule & FC_PR_CONTROL) { *************** *** 364,370 **** n->host.protocol, n->host.daddr, n->key.dport); ! goto EXIT_SCHEDULE; } ! } else if (n->host.rule & FC_PR_MOD_HEADER ) { /* TODO: */ --- 390,398 ---- n->host.protocol, n->host.daddr, n->key.dport); ! ! spin_unlock (&bucket->lock); ! return NF_DROP; } ! } else if (n->host.rule & FC_PR_MOD_HEADER ) { /* TODO: */ *************** *** 373,388 **** n->host.protocol, n->host.daddr, n->key.dport); } - /* TODO: NAT */ - - - EXIT_ACCEPT: - spin_unlock (&bucket->lock); return NF_ACCEPT; - - EXIT_SCHEDULE: - spin_unlock (&bucket->lock); /* TODO: NF_DROP -> insert_pending (skb, ...) */ - return NF_DROP; } --- 401,410 ---- n->host.protocol, n->host.daddr, n->key.dport); + + spin_unlock (&bucket->lock); + return NF_ACCEPT; } return NF_ACCEPT; /* TODO: NF_DROP -> insert_pending (skb, ...) */ } |
From: linuxpark <lin...@us...> - 2006-03-14 17:17:14
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14271/gwclib Modified Files: confproc.c Log Message: ADD: anyTCP, anyUDP, ICMP Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** confproc.c 13 Mar 2006 14:15:05 -0000 1.19 --- confproc.c 14 Mar 2006 17:17:05 -0000 1.20 *************** *** 2103,2108 **** } else if (svc->proto == SYS_PROTO_ICMP) { ! if ((svc->u.icmptype = mapstrtoid(map_icmptype, argv[2])) == -1) frerrmap(fr, RET_EUSAGE, "ICMP type", map_icmptype); --- 2103,2110 ---- } else if (svc->proto == SYS_PROTO_ICMP) { + if (!strcmp(argv[0], "ICMP")) + svc->u.icmptype = atoi (argv[2]); ! else if ((svc->u.icmptype = mapstrtoid(map_icmptype, argv[2])) == -1) frerrmap(fr, RET_EUSAGE, "ICMP type", map_icmptype); *************** *** 2177,2180 **** --- 2179,2193 ---- if (argc == 1) { + + if (!strcmp(argv[0], "anyTCP") || !strcmp(argv[0], "anyUDP") || + !strcmp (argv[0], "ICMP")) + { + + frerr(fr, RET_EINTERNAL, + "[FC/Service name] \"%s\" cannot be deleted\n", argv[0]); + return; + + } + for (i = 0; i < csm->fc_svc_cnt; i++) { if (!strcmp(csm->fc_svc[i].name, argv[0])) { |
From: linuxpark <lin...@us...> - 2006-03-13 14:15:11
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10615/gwclib Modified Files: confproc.c conftab.c confutil.c Log Message: MOD: rearrange export symbol. Index: conftab.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/conftab.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** conftab.c 8 Mar 2006 15:29:55 -0000 1.8 --- conftab.c 13 Mar 2006 14:15:05 -0000 1.9 *************** *** 107,108 **** --- 107,172 ---- {0}, }; + + + qos_tos_t tostab[] = { + {APC_TOS_TYPE_MD, "MD", "Minimize-Delay"}, + {APC_TOS_TYPE_MT, "MT", "Maximize-Throughput"}, + {APC_TOS_TYPE_MR, "MR", "Maximize-Reliability"}, + {APC_TOS_TYPE_MMC, "MMC", "Minimize-Cost"}, + {APC_TOS_TYPE_NS, "NS", "Normal-Service"}, + {-1, ""}, + { 0 } + }; + + sys_strmap_t map_truefalse[] = { + { "true", TRUE }, + { "false", FALSE }, + { 0 } + }; + + sys_strmap_t map_nettype [] = { + { "net", SYS_NT_NET }, + { "host", SYS_NT_HOST }, + { 0 } + }; + + sys_strmap_t map_prototype [] = { + { "tcp", SYS_PROTO_TCP }, + { "udp", SYS_PROTO_UDP }, + { "icmp", SYS_PROTO_ICMP }, + { 0 } + }; + + sys_strmap_t map_icmptype [] = { + { "unreach", SYS_ICMP_UNREACH }, + { "echo", SYS_ICMP_ECHO }, + { "echorep", SYS_ICMP_ECHOREP }, + { "squench", SYS_ICMP_SQUENCH }, + { "redir", SYS_ICMP_REDIR }, + { "timex", SYS_ICMP_TIMEX }, + { "paramprob", SYS_ICMP_PARAMPROB }, + { "timest", SYS_ICMP_TIMEST }, + { "timestrep", SYS_ICMP_TIMESTREP }, + { "inforeq", SYS_ICMP_INFOREQ }, + { "inforep", SYS_ICMP_INFOREP }, + { "maskreq", SYS_ICMP_MASKREQ }, + { "maskrep", SYS_ICMP_MASKREP }, + { 0 } + }; + + sys_strmap_t map_thput_unit [] = { + { "bps", SYS_FLOW_BPS }, + { "kbps", SYS_FLOW_KBPS }, + { "mbps", SYS_FLOW_MBPS }, + { "byte", SYS_FLOW_BYTE }, + { "kbyte", SYS_FLOW_KBYTE }, + { "mbyte", SYS_FLOW_MBYTE }, + { 0 } + }; + + sys_strmap_t map_fc_rule [] = { + { "fc", FC_PR_CONTROL }, + { "mh", FC_PR_MOD_HEADER }, + { 0 } + }; + Index: confutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confutil.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** confutil.c 10 Mar 2006 18:13:58 -0000 1.10 --- confutil.c 13 Mar 2006 14:15:05 -0000 1.11 *************** *** 38,41 **** --- 38,42 ---- #include "linklist.h" #include "slog.h" + #include "confproc.h" #if !defined(TRUE) *************** *** 48,57 **** extern sys_cmd_t cmdtab[]; extern sys_ucmd_t ucmdtab[]; - extern sys_strmap_t map_truefalse[]; - extern sys_strmap_t map_nettype []; - extern sys_strmap_t map_prototype []; - extern sys_strmap_t map_icmptype []; - extern sys_strmap_t map_thput_unit []; - extern sys_strmap_t map_fc_rule []; void * sys_ucmd_msg (sys_ucmd_e cmd, void *arg, int len, frp_t fr) { --- 49,52 ---- Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** confproc.c 10 Mar 2006 18:13:58 -0000 1.18 --- confproc.c 13 Mar 2006 14:15:05 -0000 1.19 *************** *** 52,132 **** extern int errno; - #if 0 - static inline void - maxbw() - { - int i; - - for (i = 0; i < csm->cscnt; i++) { - csm->maxbw = max(csm->maxbw, csm->glass[i].bw); - } - } - #endif - - /* - * this tostab is used in both filter tos and pol mark - */ - qos_tos_t tostab[] = { - {APC_TOS_TYPE_MD, "MD", "Minimize-Delay"}, - {APC_TOS_TYPE_MT, "MT", "Maximize-Throughput"}, - {APC_TOS_TYPE_MR, "MR", "Maximize-Reliability"}, - {APC_TOS_TYPE_MMC, "MMC", "Minimize-Cost"}, - {APC_TOS_TYPE_NS, "NS", "Normal-Service"}, - {-1, ""}, - { 0 } - }; - - sys_strmap_t map_truefalse[] = { - { "true", TRUE }, - { "false", FALSE }, - { 0 } - }; - - sys_strmap_t map_nettype [] = { - { "net", SYS_NT_NET }, - { "host", SYS_NT_HOST }, - { 0 } - }; - - sys_strmap_t map_prototype [] = { - { "tcp", SYS_PROTO_TCP }, - { "udp", SYS_PROTO_UDP }, - { "icmp", SYS_PROTO_ICMP }, - { 0 } - }; - - sys_strmap_t map_icmptype [] = { - { "unreach", SYS_ICMP_UNREACH }, - { "echo", SYS_ICMP_ECHO }, - { "echorep", SYS_ICMP_ECHOREP }, - { "squench", SYS_ICMP_SQUENCH }, - { "redir", SYS_ICMP_REDIR }, - { "timex", SYS_ICMP_TIMEX }, - { "paramprob", SYS_ICMP_PARAMPROB }, - { "timest", SYS_ICMP_TIMEST }, - { "timestrep", SYS_ICMP_TIMESTREP }, - { "inforeq", SYS_ICMP_INFOREQ }, - { "inforep", SYS_ICMP_INFOREP }, - { "maskreq", SYS_ICMP_MASKREQ }, - { "maskrep", SYS_ICMP_MASKREP }, - { 0 } - }; - - sys_strmap_t map_thput_unit [] = { - { "bps", SYS_FLOW_BPS }, - { "kbps", SYS_FLOW_KBPS }, - { "mbps", SYS_FLOW_MBPS }, - { "byte", SYS_FLOW_BYTE }, - { "kbyte", SYS_FLOW_KBYTE }, - { "mbyte", SYS_FLOW_MBYTE }, - { 0 } - }; - - sys_strmap_t map_fc_rule [] = { - { "fc", FC_PR_CONTROL }, - { "mh", FC_PR_MOD_HEADER }, - { 0 } - }; - void list_apinfo(int argc, char *argv[], int modify, frp_t fr) --- 52,55 ---- |
From: linuxpark <lin...@us...> - 2006-03-13 14:15:10
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10615/include Modified Files: confproc.h sysdef.h Log Message: MOD: rearrange export symbol. Index: sysdef.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysdef.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sysdef.h 10 Mar 2006 16:52:04 -0000 1.8 --- sysdef.h 13 Mar 2006 14:15:05 -0000 1.9 *************** *** 27,30 **** --- 27,37 ---- } sys_strmap_t; + extern sys_strmap_t map_truefalse[]; + extern sys_strmap_t map_nettype []; + extern sys_strmap_t map_prototype []; + extern sys_strmap_t map_icmptype []; + extern sys_strmap_t map_thput_unit []; + extern sys_strmap_t map_fc_rule []; + typedef struct { struct in_addr addr; *************** *** 177,180 **** --- 184,189 ---- } qos_tos_t; + extern qos_tos_t tostab[]; + typedef struct { char name[OL]; Index: confproc.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confproc.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** confproc.h 8 Mar 2006 15:29:55 -0000 1.6 --- confproc.h 13 Mar 2006 14:15:05 -0000 1.7 *************** *** 11,21 **** #ifndef __SYS_PROC_H #define __SYS_PROC_H - - extern sys_strmap_t map_truefalse[]; - extern sys_strmap_t map_nettype []; - extern sys_strmap_t map_prototype []; - extern sys_strmap_t map_icmptype []; - extern sys_strmap_t map_thput_unit []; - extern sys_strmap_t map_fc_rule []; /* * void functionname (int argc, char *argv[], int modify, frp_t fr); --- 11,14 ---- *************** *** 38,42 **** void set_txpower(int argc, char *argv[], int modify, frp_t fr); void list_if(int argc, char *argv[], int modify, frp_t fr); - /* Q O S */ void list_qos_maxbw(int argc, char *argv[], int modify, frp_t fr); --- 31,34 ---- |