Update of /cvsroot/netadm/gwc/gwclib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16776/gwclib
Modified Files:
confproc.c
Log Message:
MOD:
1. Replace current linkedlist in pf to hashtable for better performance.
as there are more rules of pf, the performance will be better than linkedlist.
it was inspired by route cache in linux of alan cox's
debug flag will print the result of pf.
2. Add IOCTLPF_REFLESH
from now, only the rules in GUI or cli of pf will be applied only if
user click "apply" or hostpol_apply in cli command.
TODO: support subnet in "flow control"
Index: confproc.c
===================================================================
RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** confproc.c 9 Feb 2006 17:54:06 -0000 1.2
--- confproc.c 17 Feb 2006 06:58:59 -0000 1.3
***************
*** 2218,2224 ****
int i;
int slot;
! #if 1
int fd;
! wibro_kuio_msg_t msg;
int ret;
#endif
--- 2218,2224 ----
int i;
int slot;
! #if 0
int fd;
! kuio_msg_t msg;
int ret;
#endif
***************
*** 2243,2247 ****
if (fr->ret != RET_OK)
return;
! #if 1 /* 2005. 11. 30 AM: 2, i can't understand why i define the code as #if 0
11. 12 */
/* remove from module */
--- 2243,2247 ----
if (fr->ret != RET_OK)
return;
! #if 0 /* 2005. 11. 30 AM: 2, i can't understand why i define the code as #if 0
11. 12 */
/* remove from module */
***************
*** 2253,2257 ****
msg.ip = csm->hostpol[i].ip;
! if ((ret = ioctl(fd, IOCTLWIBRO_UNREGISTER_HOST, &msg)) < 0) {
if (errno != EBADSLT) { /* EBADSLT is not fatal */
--- 2253,2257 ----
msg.ip = csm->hostpol[i].ip;
! if ((ret = ioctl(fd, IOCTLPF_UNREGISTER_HOST, &msg)) < 0) {
if (errno != EBADSLT) { /* EBADSLT is not fatal */
***************
*** 2292,2296 ****
hostpol_apply(int argc, char *argv[], int modify, frp_t fr)
{
! wibro_kuio_msg_t msg;
int fd;
int idx;
--- 2292,2296 ----
hostpol_apply(int argc, char *argv[], int modify, frp_t fr)
{
! kuio_msg_t msg;
int fd;
int idx;
***************
*** 2305,2315 ****
}
for (i = 0; i < csm->hpolcnt; i++) {
switch (csm->hostpol[i].flag) {
case BLOCK_HOST:
! idx = IOCTLWIBRO_REGISTER_SRCBLOCK;
break;
case MODIFY_SEQ:
! idx = IOCTLWIBRO_REGISTER_MODSEQ;
break;
}
--- 2305,2316 ----
}
+ ioctl (fd, IOCTLPF_REFLESH, 0);
for (i = 0; i < csm->hpolcnt; i++) {
switch (csm->hostpol[i].flag) {
case BLOCK_HOST:
! idx = IOCTLPF_REGISTER_SRCBLOCK;
break;
case MODIFY_SEQ:
! idx = IOCTLPF_REGISTER_MODSEQ;
break;
}
|