netadm-devel Mailing List for netadm (Page 6)
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-03-01 19:13:36
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16007/gwclib Modified Files: confproc.c confutil.c Log Message: FIX: fix a lot of cli interface bug about flow control. Index: confutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confutil.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** confutil.c 28 Feb 2006 23:41:50 -0000 1.2 --- confutil.c 1 Mar 2006 19:13:24 -0000 1.3 *************** *** 114,118 **** map++; } ! return "Unknown..."; } --- 114,118 ---- map++; } ! return NULL; } Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** confproc.c 1 Mar 2006 04:06:33 -0000 1.10 --- confproc.c 1 Mar 2006 19:13:23 -0000 1.11 *************** *** 2130,2134 **** int slot = -1; int i; ! unsigned short port; if (argc == 3) { --- 2130,2134 ---- int slot = -1; int i; ! int port; if (argc == 3) { *************** *** 2172,2176 **** svc->u.icmptype = (unsigned short)strtol(argv[2], (char **)NULL, 16); ! if ( mapidtostr ( map_icmptype, svc->u.icmptype ) < 0 ) frerrmap(fr, RET_EUSAGE, "ICMP type", map_icmptype); --- 2172,2176 ---- svc->u.icmptype = (unsigned short)strtol(argv[2], (char **)NULL, 16); ! if ( !mapidtostr ( map_icmptype, svc->u.icmptype ) ) frerrmap(fr, RET_EUSAGE, "ICMP type", map_icmptype); *************** *** 2181,2197 **** else if (svc->proto == SYS_PROTO_ICMP) { ! if ((svc->proto = mapstrtoid(map_icmptype, argv[2])) == -1) frerrmap(fr, RET_EUSAGE, "ICMP type", map_icmptype); } else{ ! port = (unsigned short)atoi(argv[2]); if (port >= 65535){ frerr(fr, RET_EPORTRANGE, "[Port] cannot be greater than 65535\n"); } ! svc->u.port = port; } ! if (fr->ret != RET_OK) return; --- 2181,2218 ---- 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); } else{ ! port = atoi(argv[2]); if (port >= 65535){ frerr(fr, RET_EPORTRANGE, "[Port] cannot be greater than 65535\n"); } ! svc->u.port = (unsigned short)port; } ! for (i = 0; i < csm->fc_svc_cnt; i++) { ! if (i == slot) ! continue; ! ! if ( csm->fc_svc[i].proto != svc->proto ) ! continue; ! ! if ( csm->fc_svc[i].proto == SYS_PROTO_ICMP ) { ! if ( csm->fc_svc[i].u.icmptype != svc->u.icmptype ) ! continue; ! } ! else { ! if ( csm->fc_svc[i].u.port != svc->u.port ) ! continue; ! } ! ! frerr(fr, RET_ENOTUNIQ, ! "%s: Same service protocol already defined as %s\n", ! svc->name, csm->fc_svc[i].name); ! } ! ! if (fr->ret != RET_OK) return; *************** *** 2407,2412 **** strcpy(net->net_if,argv[4]); ! if (fr->ret != RET_OK) ! return; for (i = 0; i < csm->fc_net_cnt; i++) { --- 2428,2441 ---- strcpy(net->net_if,argv[4]); ! /* TODO */ ! for (i = 0; i < csm->ifcnt; i++) { ! if (!strcmp(csm->dev[i].if_name, net->net_if)) { ! break; ! } ! } ! ! if ( i == csm->ifcnt ) ! frerr(fr, RET_EUSAGE, "[Interface name] There is no such active interface \"%s\" " ! "in this localsystem.\n",net->net_if); for (i = 0; i < csm->fc_net_cnt; i++) { *************** *** 2420,2426 **** continue; frerr(fr, RET_ENOTUNIQ, ! "%s: Same Host/Network already defined as %s\n", net->name, csm->fc_net[i].name); } for (slot = 0, i = 0; i < csm->fc_net_cnt; i++) { --- 2449,2458 ---- continue; frerr(fr, RET_ENOTUNIQ, ! "%s: Same Network already defined as %s\n", net->name, csm->fc_net[i].name); } + + if (fr->ret != RET_OK) + return; for (slot = 0, i = 0; i < csm->fc_net_cnt; i++) { *************** *** 2624,2630 **** frerrmap(fr, RET_EUSAGE, "flow unit", map_thput_unit); - if (fr->ret != RET_OK) - return; - for (i = 0; i < csm->fc_fw_cnt; i++) { if (i == slot) --- 2656,2659 ---- *************** *** 2639,2642 **** --- 2668,2674 ---- return; } + + if (fr->ret != RET_OK) + return; for (slot = 0, i = 0; i < csm->fc_fw_cnt; i++) { *************** *** 2759,2766 **** } else { ! if (csm->polcnt == 0) return; start = 0; ! end = csm->polcnt; } --- 2791,2798 ---- } else { ! if (csm->fc_pol_cnt == 0) return; start = 0; ! end = csm->fc_pol_cnt; } *************** *** 2797,2800 **** --- 2829,2834 ---- int slot = -1; int i; + fc_svc_t *ssvc; + fc_svc_t *dsvc; if (argc == 8) { *************** *** 2818,2824 **** strcpy(pol->name, argv[0]); ! if ( !sys_ucmd_msg (_CMD_GET_FC_POL, argv[0], strlen(argv[0]))) frerr(fr, RET_ENOTUNIQ, ! "[FC/Network name] \"%s\" does not exists\n", argv[0]); if ((pol->enable = mapstrtoid(map_truefalse, argv[1])) == -1) --- 2852,2858 ---- strcpy(pol->name, argv[0]); ! if (sys_ucmd_msg (_CMD_GET_FC_POL, argv[0], strlen(argv[0]))) frerr(fr, RET_ENOTUNIQ, ! "[FC/policy name] \"%s\" already exists\n", argv[0]); if ((pol->enable = mapstrtoid(map_truefalse, argv[1])) == -1) *************** *** 2851,2855 **** strcpy(pol->ssvc, argv[3]); ! if ( !sys_ucmd_msg (_CMD_GET_FC_SVC, argv[3], strlen(argv[3]))) frerr(fr, RET_ENOTUNIQ, "[FC/source service protocol name] \"%s\" does not exists\n", argv[3]); --- 2885,2889 ---- strcpy(pol->ssvc, argv[3]); ! if ( !(ssvc = (fc_svc_t*)sys_ucmd_msg (_CMD_GET_FC_SVC, argv[3], strlen(argv[3]))) ) frerr(fr, RET_ENOTUNIQ, "[FC/source service protocol name] \"%s\" does not exists\n", argv[3]); *************** *** 2881,2888 **** strcpy(pol->dsvc, argv[5]); ! if ( !sys_ucmd_msg (_CMD_GET_FC_SVC, argv[5], strlen(argv[5]))) frerr(fr, RET_ENOTUNIQ, "[FC/destination service protocol name] \"%s\" does not exists\n",argv[5]); /* fw */ if (!str_nospace(argv[6])) --- 2915,2929 ---- strcpy(pol->dsvc, argv[5]); ! if ( !(dsvc = (fc_svc_t*)sys_ucmd_msg (_CMD_GET_FC_SVC, argv[5], strlen(argv[5]))) ) frerr(fr, RET_ENOTUNIQ, "[FC/destination service protocol name] \"%s\" does not exists\n",argv[5]); + if ( ssvc->proto != dsvc->proto ) + frerr(fr, RET_EINTERNAL, + "both source service proto and destination service proto must be same but" + " source service proto \"%s\" and destination service proto \"%s\"\n", + mapidtostr (map_prototype, ssvc->proto), + mapidtostr(map_prototype, dsvc->proto)); + /* fw */ if (!str_nospace(argv[6])) *************** *** 2903,2910 **** frerrmap(fr, RET_EUSAGE, "Rule", map_fc_rule); - - if (fr->ret != RET_OK) - return; - for (i = 0; i < csm->fc_pol_cnt; i++) { if (i == slot) --- 2944,2947 ---- *************** *** 2919,2929 **** if (strcmp(pol->dsvc, csm->fc_pol[i].dsvc)) continue; /* * FIXME: if only fw is different in a policy, we have to decide more low * whether in pf or fc_apply */ if (strcmp(pol->fw, csm->fc_pol[i].fw)) continue; - #if 0 /* * FIXME: if only rule is different in a policy, we have to decide more low --- 2956,2970 ---- if (strcmp(pol->dsvc, csm->fc_pol[i].dsvc)) continue; + /* WARNING! + * if snet/sport ->dnet/dport was determined already, + * any other rule will be consider as error + */ /* * FIXME: if only fw is different in a policy, we have to decide more low * whether in pf or fc_apply */ + #if 0 if (strcmp(pol->fw, csm->fc_pol[i].fw)) continue; /* * FIXME: if only rule is different in a policy, we have to decide more low *************** *** 2935,2941 **** #endif frerr(fr, RET_ENOTUNIQ, ! "%s: Same FC/policy already defined as %s\n", pol->name, csm->fc_pol[i].name); } for (slot = 0, i = 0; i < csm->fc_pol_cnt; i++) { --- 2976,2985 ---- #endif frerr(fr, RET_ENOTUNIQ, ! "%s: Same policy already defined as %s\n", pol->name, csm->fc_pol[i].name); } + + if (fr->ret != RET_OK) + return; for (slot = 0, i = 0; i < csm->fc_pol_cnt; i++) { |
From: linuxpark <lin...@us...> - 2006-03-01 04:06:37
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28700/include Modified Files: confproc.h message.h sysipc.h Log Message: ADD: add saveconf/loadconf routine about flow control. i verified 2 bug during in/output user interface in add_fc_pol(icmp) and add_fc_pol (sys_ucmd_msg return ..logical error). Index: message.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/message.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** message.h 26 Feb 2006 16:43:29 -0000 1.4 --- message.h 1 Mar 2006 04:06:33 -0000 1.5 *************** *** 58,64 **** #define INFO_CLI_ADD_FC_NET "Add a network protocol in flow control" #define INFO_CLI_DEL_FC_NET "Delete a service protocol in flow control" ! #define INFO_CLI_LIST_FC_FLOW "List flow object in flow control" ! #define INFO_CLI_ADD_FC_FLOW "Add a flow object in flow control" ! #define INFO_CLI_DEL_FC_FLOW "Delete a flow object in flow control" #define INFO_CLI_LIST_FC_POL "List policies in flow control" #define INFO_CLI_ADD_FC_POL "Add a policy in flow control" --- 58,64 ---- #define INFO_CLI_ADD_FC_NET "Add a network protocol in flow control" #define INFO_CLI_DEL_FC_NET "Delete a service protocol in flow control" ! #define INFO_CLI_LIST_FC_FW "List flow object in flow control" ! #define INFO_CLI_ADD_FC_FW "Add a flow object in flow control" ! #define INFO_CLI_DEL_FC_FW "Delete a flow object in flow control" #define INFO_CLI_LIST_FC_POL "List policies in flow control" #define INFO_CLI_ADD_FC_POL "Add a policy in flow control" *************** *** 83,86 **** --- 83,90 ---- #define STR_HOST_POLICY "host_policy" #define STR_AUTO_TEST "auto_test" + #define STR_FC_SVC "fc_svc" + #define STR_FC_NET "fc_net" + #define STR_FC_FW "fc_fw" + #define STR_FC_POL "fc_pol" /* EM_ : Error Message */ Index: sysipc.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysipc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sysipc.h 28 Feb 2006 23:41:50 -0000 1.3 --- sysipc.h 1 Mar 2006 04:06:33 -0000 1.4 *************** *** 97,103 **** CMD_ADD_FC_NET, CMD_DEL_FC_NET, ! CMD_LIST_FC_FLOW, ! CMD_ADD_FC_FLOW, ! CMD_DEL_FC_FLOW, CMD_LIST_FC_POL, CMD_ADD_FC_POL, --- 97,103 ---- CMD_ADD_FC_NET, CMD_DEL_FC_NET, ! CMD_LIST_FC_FW, ! CMD_ADD_FC_FW, ! CMD_DEL_FC_FW, CMD_LIST_FC_POL, CMD_ADD_FC_POL, Index: confproc.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confproc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** confproc.h 28 Feb 2006 23:41:50 -0000 1.3 --- confproc.h 1 Mar 2006 04:06:33 -0000 1.4 *************** *** 17,21 **** extern sys_strmap_t map_icmptype []; extern sys_strmap_t map_thput_unit []; ! extern sys_strmap_t map_fcpolrule []; /* * void functionname (int argc, char *argv[], int modify, frp_t fr); --- 17,21 ---- 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); *************** *** 60,66 **** void add_fc_net(int argc, char *argv[], int modify, frp_t fr); void del_fc_net(int argc, char *argv[], int modify, frp_t fr); ! void list_fc_flow(int argc, char *argv[], int modify, frp_t fr); ! void add_fc_flow(int argc, char *argv[], int modify, frp_t fr); ! void del_fc_flow(int argc, char *argv[], int modify, frp_t fr); void list_fc_pol(int argc, char *argv[], int modify, frp_t fr); void add_fc_pol(int argc, char *argv[], int modify, frp_t fr); --- 60,66 ---- void add_fc_net(int argc, char *argv[], int modify, frp_t fr); void del_fc_net(int argc, char *argv[], int modify, frp_t fr); ! void list_fc_fw(int argc, char *argv[], int modify, frp_t fr); ! void add_fc_fw(int argc, char *argv[], int modify, frp_t fr); ! void del_fc_fw(int argc, char *argv[], int modify, frp_t fr); void list_fc_pol(int argc, char *argv[], int modify, frp_t fr); void add_fc_pol(int argc, char *argv[], int modify, frp_t fr); |
From: linuxpark <lin...@us...> - 2006-03-01 04:06:37
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28700/gwclib Modified Files: confio.c confproc.c conftab.c Log Message: ADD: add saveconf/loadconf routine about flow control. i verified 2 bug during in/output user interface in add_fc_pol(icmp) and add_fc_pol (sys_ucmd_msg return ..logical error). Index: confio.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confio.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** confio.c 26 Feb 2006 16:43:29 -0000 1.3 --- confio.c 1 Mar 2006 04:06:33 -0000 1.4 *************** *** 210,214 **** } else if (!strcmp(cmd, "[qos_policy]")) { add_qos_pol(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[host_policy]")) { add_fc_pol(argc, argv, 0, &fr); } else if (!strcmp(cmd, "[auto_test]")) { --- 210,220 ---- } else if (!strcmp(cmd, "[qos_policy]")) { add_qos_pol(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[fc_net]")) { ! add_fc_net(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[fc_svc]")) { ! add_fc_svc(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[fc_fw]")) { ! add_fc_fw(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[fc_pol]")) { add_fc_pol(argc, argv, 0, &fr); } else if (!strcmp(cmd, "[auto_test]")) { *************** *** 354,357 **** --- 360,413 ---- } + /* FC_NET */ + for (i = 0; i < csm->fc_net_cnt; i++) { + prenc(fp, "[%s]\t%s\t%s\t%s\t%d\t%s\n", + STR_FC_NET, + csm->fc_net[i].name, + mapidtostr(map_nettype, csm->fc_net[i].type), + inet_ntoa(csm->fc_net[i].net.addr), + csm->fc_net[i].net.mask, + csm->fc_net[i].net_if); + } + + /* FC_SVC */ + for (i = 0; i < csm->fc_svc_cnt; i++) { + char port[12]; + + if (csm->fc_svc[i].proto == SYS_PROTO_ICMP ) + sprintf(port, "%s", mapidtostr (map_icmptype, csm->fc_svc[i].u.icmptype)); + else + sprintf(port, "%d", csm->fc_svc[i].u.port); + + prenc(fp, "[%s]\t%s\t%s\t%s\n", + STR_FC_SVC, + csm->fc_svc[i].name, + mapidtostr(map_prototype, csm->fc_svc[i].proto), + port); + } + + /* FC_FW */ + for (i = 0; i < csm->fc_fw_cnt; i++) { + prenc(fp, "[%s]\t%s\t%d\t%s\n", + STR_FC_FW, + csm->fc_fw[i].name, + csm->fc_fw[i].val, + mapidtostr (map_thput_unit, csm->fc_fw[i].unit)); + + } + /* FC_POL */ + for (i = 0; i < csm->fc_pol_cnt; i++) { + prenc(fp, "[%s]\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", + STR_FC_POL, + csm->fc_pol[i].name, + mapidtostr (map_truefalse, csm->fc_pol[i].enable), + csm->fc_pol[i].snet, + csm->fc_pol[i].ssvc, + csm->fc_pol[i].dnet, + csm->fc_pol[i].dsvc, + csm->fc_pol[i].fw, + mapidtostr (map_fc_rule, csm->fc_pol[i].rule)); + } + #if 0 /* host policy */ for (i = 0; i < csm->hpolcnt; i++) { *************** *** 363,367 **** csm->hostpol[i].flag, csm->hostpol[i].max_pktrate); } ! /* auto test */ prenc(fp, "[%s]\t%d\t%d\t%d\t%d\t%d\t%d\n", STR_AUTO_TEST, --- 419,423 ---- csm->hostpol[i].flag, csm->hostpol[i].max_pktrate); } ! #endif /* auto test */ prenc(fp, "[%s]\t%d\t%d\t%d\t%d\t%d\t%d\n", STR_AUTO_TEST, Index: conftab.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/conftab.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** conftab.c 28 Feb 2006 23:41:50 -0000 1.3 --- conftab.c 1 Mar 2006 04:06:33 -0000 1.4 *************** *** 83,89 **** {CMD_ADD_FC_NET, "add_fc_net", PR(add_fc_net), INFO_CLI_ADD_FC_NET}, {CMD_DEL_FC_NET, "del_fc_net", PR(del_fc_net), INFO_CLI_DEL_FC_NET}, ! {CMD_LIST_FC_FLOW, "list_fc_flow", PR(list_fc_flow), INFO_CLI_LIST_FC_FLOW}, ! {CMD_ADD_FC_FLOW, "add_fc_flow", PR(add_fc_flow), INFO_CLI_ADD_FC_FLOW}, ! {CMD_DEL_FC_FLOW, "del_fc_flow", PR(del_fc_flow), INFO_CLI_DEL_FC_FLOW}, {CMD_LIST_FC_POL, "list_fc_pol", PR(list_fc_pol), INFO_CLI_LIST_FC_POL}, {CMD_ADD_FC_POL, "add_fc_pol", PR(add_fc_pol), INFO_CLI_ADD_FC_POL}, --- 83,89 ---- {CMD_ADD_FC_NET, "add_fc_net", PR(add_fc_net), INFO_CLI_ADD_FC_NET}, {CMD_DEL_FC_NET, "del_fc_net", PR(del_fc_net), INFO_CLI_DEL_FC_NET}, ! {CMD_LIST_FC_FW, "list_fc_fw", PR(list_fc_fw), INFO_CLI_LIST_FC_FW}, ! {CMD_ADD_FC_FW, "add_fc_fw", PR(add_fc_fw), INFO_CLI_ADD_FC_FW}, ! {CMD_DEL_FC_FW, "del_fc_fw", PR(del_fc_fw), INFO_CLI_DEL_FC_FW}, {CMD_LIST_FC_POL, "list_fc_pol", PR(list_fc_pol), INFO_CLI_LIST_FC_POL}, {CMD_ADD_FC_POL, "add_fc_pol", PR(add_fc_pol), INFO_CLI_ADD_FC_POL}, Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** confproc.c 1 Mar 2006 03:20:20 -0000 1.9 --- confproc.c 1 Mar 2006 04:06:33 -0000 1.10 *************** *** 2514,2518 **** } ! void list_fc_flow(int argc, char *argv[], int modify, frp_t fr) { int len; --- 2514,2518 ---- } ! void list_fc_fw(int argc, char *argv[], int modify, frp_t fr) { int len; *************** *** 2569,2573 **** } ! void add_fc_flow(int argc, char *argv[], int modify, frp_t fr) { fc_fw_t fwcfw; --- 2569,2573 ---- } ! void add_fc_fw(int argc, char *argv[], int modify, frp_t fr) { fc_fw_t fwcfw; *************** *** 2670,2674 **** } ! void del_fc_flow(int argc, char *argv[], int modify, frp_t fr) { fc_fw_t *fw = NULL; --- 2670,2674 ---- } ! void del_fc_fw(int argc, char *argv[], int modify, frp_t fr) { fc_fw_t *fw = NULL; |
From: linuxpark <lin...@us...> - 2006-03-01 03:20:28
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23465/gwclib Modified Files: confproc.c Log Message: ADD: complete add_fc_pol, del_fc_pol Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** confproc.c 28 Feb 2006 23:41:50 -0000 1.8 --- confproc.c 1 Mar 2006 03:20:20 -0000 1.9 *************** *** 120,124 **** }; ! sys_strmap_t map_fc_polrule [] = { { "fc", FC_PR_CONTROL }, { "mh", FC_PR_MOD_HEADER }, --- 120,124 ---- }; ! sys_strmap_t map_fc_rule [] = { { "fc", FC_PR_CONTROL }, { "mh", FC_PR_MOD_HEADER }, *************** *** 2783,2787 **** n += 1 + sprintf(&fr->p[n], "%s", csm->fc_pol[i].fw); n += 1 + sprintf(&fr->p[n], "%s", ! mapidtostr(map_fc_polrule, csm->fc_pol[i].rule)); } --- 2783,2787 ---- n += 1 + sprintf(&fr->p[n], "%s", csm->fc_pol[i].fw); n += 1 + sprintf(&fr->p[n], "%s", ! mapidtostr(map_fc_rule, csm->fc_pol[i].rule)); } *************** *** 2793,2879 **** add_fc_pol(int argc, char *argv[], int modify, frp_t fr) { ! fc_net_t fwcnet; ! fc_net_t *net; int slot = -1; int i; ! if (argc == 5) { ! if (csm->fc_net_cnt < MAXSHM_FC_NET) { ! net = &fwcnet; } else { frerr(fr, RET_EINTERNAL, ! "FC Network buffer full, Max network is limited to %d\n",MAXSHM_FC_NET); return; } if (!str_nospace(argv[0])) ! frerr(fr, RET_EUSAGE,"[FC/Network name] cannot contain spaces\n"); else if (strlen(argv[0]) == 0) ! frerr(fr, RET_EUSAGE, "You must enter [Network name]\n"); ! else if (strlen(argv[0]) >= sizeof(net->name)) ! frerr(fr, RET_EUSAGE, "Max Length of the [Network name] is %d\n", ! sizeof(net->name) - 1); else ! strcpy(net->name, argv[0]); ! for (i = 0; i < csm->fc_net_cnt; i++) { ! if (!strcmp(csm->fc_net[i].name, argv[0])) { ! frerr(fr, RET_ENOTUNIQ, ! "[FC/Network name] \"%s\" already exists\n", argv[0]); ! } ! } ! if ((net->type = mapstrtoid(map_nettype, argv[1])) == -1) ! frerrmap(fr, RET_EUSAGE, "Type", map_nettype); ! if (!str_inetaddr(argv[2], ! (net->type == SYS_NT_HOST) ? TRUE : FALSE)) ! frerr(fr, RET_EUSAGE, ! "Invalid [IP address] \"%s\" entered\n", argv[2]); ! else if ((net->net.addr.s_addr = inet_addr(argv[2])) == (in_addr_t)(-1)) { ! frerr(fr, RET_EUSAGE, "Invalid [IP address] \"%s\" entered\n", argv[2]); ! } ! if (!str_isdigit(argv[3])) { ! frerr(fr, RET_EUSAGE, ! "[Netmask] must be valid number between 0 and 32\n"); ! } ! else { ! net->net.mask = atoi(argv[3]); ! if (net->type == SYS_NT_HOST && net->net.mask != 32) ! frerr(fr, RET_EUSAGE, "[Netmask] must be 32 with host type\n"); ! if (net->net.mask > 32 ) ! frerr(fr, RET_EUSAGE, "[Netmask] must be between 0 and 32\n"); ! } if (!str_nospace(argv[4])) ! frerr(fr, RET_EUSAGE, "[Interface name] cannot contain spaces\n"); ! else if (strlen(argv[4]) >= sizeof(net->net_if)) ! frerr(fr, RET_EUSAGE, ! "Max Length of the [Interface name] is %d\n", ! sizeof(net->net_if) - 1); else ! strcpy(net->net_if,argv[4]); if (fr->ret != RET_OK) return; ! for (i = 0; i < csm->fc_net_cnt; i++) { if (i == slot) continue; ! if (net->net.addr.s_addr != csm->fc_net[i].net.addr.s_addr) continue; ! if (net->net.mask != csm->fc_net[i].net.mask) continue; ! if (strcmp(net->net_if, csm->fc_net[i].net_if)) continue; frerr(fr, RET_ENOTUNIQ, ! "%s: Same Host/Network already defined as %s\n", ! net->name, csm->fc_net[i].name); } ! for (slot = 0, i = 0; i < csm->fc_net_cnt; i++) { ! if (strcasecmp(csm->fc_net[i].name, net->name) < 0) { slot = i + 1; } --- 2793,2944 ---- add_fc_pol(int argc, char *argv[], int modify, frp_t fr) { ! fc_pol_t fwcpol; ! fc_pol_t *pol; int slot = -1; int i; ! if (argc == 8) { ! if (csm->fc_pol_cnt < MAXSHM_FC_POL) { ! pol = &fwcpol; } else { frerr(fr, RET_EINTERNAL, ! "FC policy buffer full, Max policy is limited to %d\n",MAXSHM_FC_POL); return; } + if (!str_nospace(argv[0])) ! frerr(fr, RET_EUSAGE,"[FC/policy name] cannot contain spaces\n"); else if (strlen(argv[0]) == 0) ! frerr(fr, RET_EUSAGE, "You must enter [FC/policy name]\n"); ! else if (strlen(argv[0]) >= sizeof(pol->name)) ! frerr(fr, RET_EUSAGE, "Max Length of the [FC/policy name] is %d\n", ! sizeof(pol->name) - 1); else ! strcpy(pol->name, argv[0]); ! if ( !sys_ucmd_msg (_CMD_GET_FC_POL, argv[0], strlen(argv[0]))) ! frerr(fr, RET_ENOTUNIQ, ! "[FC/Network name] \"%s\" does not exists\n", argv[0]); ! if ((pol->enable = mapstrtoid(map_truefalse, argv[1])) == -1) ! frerrmap(fr, RET_EUSAGE, "Enable", map_truefalse); ! /* snet */ ! if (!str_nospace(argv[2])) ! frerr(fr, RET_EUSAGE,"[FC/source network name] cannot contain spaces\n"); ! else if (strlen(argv[2]) == 0) ! frerr(fr, RET_EUSAGE, "You must enter [FC/source network name]\n"); ! else if (strlen(argv[2]) >= sizeof(pol->snet)) ! frerr(fr, RET_EUSAGE, "Max Length of the [FC/source network name] is %d\n", ! sizeof(pol->snet) - 1); ! else ! strcpy(pol->snet, argv[2]); ! if ( !sys_ucmd_msg (_CMD_GET_FC_NET, argv[2], strlen(argv[2]))) ! frerr(fr, RET_ENOTUNIQ, ! "[FC/source network name] \"%s\" does not exists\n", argv[2]); + /* ssvc */ + if (!str_nospace(argv[3])) + frerr(fr, RET_EUSAGE,"[FC/source service protocol name] cannot contain spaces\n"); + else if (strlen(argv[3]) == 0) + frerr(fr, RET_EUSAGE, "You must enter [FC/source service protocol name]\n"); + else if (strlen(argv[3]) >= sizeof(pol->ssvc)) + frerr(fr, RET_EUSAGE, "Max Length of the [FC/source service protocol name] is " + "%d\n", sizeof(pol->ssvc) - 1); + else + strcpy(pol->ssvc, argv[3]); + + if ( !sys_ucmd_msg (_CMD_GET_FC_SVC, argv[3], strlen(argv[3]))) + frerr(fr, RET_ENOTUNIQ, + "[FC/source service protocol name] \"%s\" does not exists\n", argv[3]); + + /* dnet */ if (!str_nospace(argv[4])) ! frerr(fr, RET_EUSAGE,"[FC/destination network name] cannot contain spaces\n"); ! else if (strlen(argv[4]) == 0) ! frerr(fr, RET_EUSAGE, "You must enter [FC/destination network name]\n"); ! else if (strlen(argv[4]) >= sizeof(pol->dnet)) ! frerr(fr, RET_EUSAGE, "Max Length of the [FC/destination network name] is %d\n", ! sizeof(pol->dnet) - 1); ! else ! strcpy(pol->dnet, argv[4]); + if ( !sys_ucmd_msg (_CMD_GET_FC_NET, argv[4], strlen(argv[4]))) + frerr(fr, RET_ENOTUNIQ, + "[FC/destination network name] \"%s\" does not exists\n", argv[4]); + + /* dsvc */ + if (!str_nospace(argv[5])) + frerr(fr, RET_EUSAGE,"[FC/destination service protocol name] cannot contain spaces\n"); + else if (strlen(argv[5]) == 0) + frerr(fr, RET_EUSAGE, "You must enter [FC/destination service protocol name]\n"); + else if (strlen(argv[5]) >= sizeof(pol->ssvc)) + frerr(fr, RET_EUSAGE, "Max Length of the [FC/destination service protocol name]" + "is %d\n", sizeof(pol->dsvc) - 1); else ! strcpy(pol->dsvc, argv[5]); ! ! if ( !sys_ucmd_msg (_CMD_GET_FC_SVC, argv[5], strlen(argv[5]))) ! frerr(fr, RET_ENOTUNIQ, ! "[FC/destination service protocol name] \"%s\" does not exists\n",argv[5]); + /* fw */ + if (!str_nospace(argv[6])) + frerr(fr, RET_EUSAGE,"[FC/flow control name] cannot contain spaces\n"); + else if (strlen(argv[6]) == 0) + frerr(fr, RET_EUSAGE, "You must enter [FC/flow control name]\n"); + else if (strlen(argv[6]) >= sizeof(pol->fw)) + frerr(fr, RET_EUSAGE, "Max Length of the [FC/flow control name] is %d\n", + sizeof(pol->fw) - 1); + else + strcpy(pol->fw, argv[6]); + + if ( !sys_ucmd_msg (_CMD_GET_FC_FW, argv[6], strlen(argv[6]))) + frerr(fr, RET_ENOTUNIQ, + "[FC/flow control name] \"%s\" does not exists\n", argv[6]); + + if ((pol->rule = mapstrtoid(map_fc_rule, argv[7])) == -1) + frerrmap(fr, RET_EUSAGE, "Rule", map_fc_rule); + + if (fr->ret != RET_OK) return; ! for (i = 0; i < csm->fc_pol_cnt; i++) { if (i == slot) continue; ! ! if (strcmp(pol->snet, csm->fc_pol[i].snet)) continue; ! if (strcmp(pol->ssvc, csm->fc_pol[i].ssvc)) continue; ! if (strcmp(pol->dnet, csm->fc_pol[i].dnet)) continue; + if (strcmp(pol->dsvc, csm->fc_pol[i].dsvc)) + continue; + /* + * FIXME: if only fw is different in a policy, we have to decide more low + * whether in pf or fc_apply + */ + if (strcmp(pol->fw, csm->fc_pol[i].fw)) + continue; + #if 0 + /* + * FIXME: if only rule is different in a policy, we have to decide more low + * whether in pf or fc_apply + * or ignore + */ + if (strcmp(pol->rule, csm->fc_pol[i].rule)) + continue; + #endif frerr(fr, RET_ENOTUNIQ, ! "%s: Same FC/policy already defined as %s\n", ! pol->name, csm->fc_pol[i].name); } ! for (slot = 0, i = 0; i < csm->fc_pol_cnt; i++) { ! if (strcasecmp(csm->fc_pol[i].name, pol->name) < 0) { slot = i + 1; } *************** *** 2883,2893 **** } ! if (slot < csm->fc_net_cnt) { ! memmove(&csm->fc_net[slot + 1], ! &csm->fc_net[slot], ! sizeof(fc_net_t) * (csm->fc_net_cnt - slot)); } ! memcpy(&csm->fc_net[slot], net, sizeof(fc_net_t)); ! csm->fc_net_cnt++; if (modify != CBFROM_SYSTEM) { --- 2948,2958 ---- } ! if (slot < csm->fc_pol_cnt) { ! memmove(&csm->fc_pol[slot + 1], ! &csm->fc_pol[slot], ! sizeof(fc_pol_t) * (csm->fc_pol_cnt - slot)); } ! memcpy(&csm->fc_pol[slot], pol, sizeof(fc_pol_t)); ! csm->fc_pol_cnt++; if (modify != CBFROM_SYSTEM) { *************** *** 2900,2904 **** else { frerr(fr, RET_EUSAGE, ! "Usage: [FC/Network name] [Type:\"net\"|\"host\"] "); } } --- 2965,2972 ---- else { frerr(fr, RET_EUSAGE, ! "Usage: [FC/policy name] [enable: \"true\"|\"false\"] [source network name] " ! "[source service protocol name] [destination network name]" ! "[destination service protocol name] [flow control name] " ! "[rule: \"fc\"|\"mh\"]"); } } *************** *** 2907,2911 **** --- 2975,3019 ---- del_fc_pol(int argc, char *argv[], int modify, frp_t fr) { + fc_pol_t *pol = NULL; + int i; + int slot; + + if (argc == 1) { + for (i = 0; i < csm->fc_pol_cnt; i++) { + if (!strcmp(csm->fc_pol[i].name, argv[0])) { + pol = &csm->fc_pol[i]; + slot = i; + break; + } + } + + if (pol == NULL) { + frerr(fr, RET_ENOTFOUND, + "[FC/policy name] \"%s\" does not exist\n", argv[0]); + return; + } + + if (fr->ret != RET_OK) + return; + + if (slot < (csm->fc_pol_cnt - 1)) { + memcpy(&csm->fc_pol[slot], &csm->fc_pol[slot + 1], + sizeof(fc_pol_t) * (csm->fc_pol_cnt - slot - 1)); + } + memset(&csm->fc_pol[csm->fc_pol_cnt - 1], 0, sizeof(fc_pol_t)); + csm->fc_pol_cnt--; + + if (modify != CBFROM_SYSTEM) { + if ((fr->ret = saveconf(csm)) != RET_OK) { + frerr(fr, fr->ret, + "Cannot save configuration (%d)\n", fr->ret); + return; + } + } + } + else { + frerr(fr, RET_EUSAGE, "Usage: [FC/policy name]\n"); + } } |
From: linuxpark <lin...@us...> - 2006-03-01 03:20:28
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23465/include Modified Files: sysdef.h Log Message: ADD: complete add_fc_pol, del_fc_pol Index: sysdef.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysdef.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sysdef.h 28 Feb 2006 23:41:50 -0000 1.5 --- sysdef.h 1 Mar 2006 03:20:20 -0000 1.6 *************** *** 230,234 **** typedef struct { char name[OL]; ! unsigned short enable; char snet[OL]; char ssvc[OL]; --- 230,234 ---- typedef struct { char name[OL]; ! int enable; char snet[OL]; char ssvc[OL]; |
From: linuxpark <lin...@us...> - 2006-02-28 23:41:56
|
Update of /cvsroot/netadm/gwc/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13557/scripts Modified Files: install.sh Log Message: ADD: ADD: internal routine below in confproc.c, confproc.h add_fc_svc add_fc_net add_fc_fw add_fc_pol : definitly not list_fc_svc list_fc_net list_fc_fw list_fc_pol: not complete yet. del_fc_svc del_fc_net del_fc_fw del_fc_pol: definitly not ADD: internal routine for utils to access shared memory in confutil.c confutil.h conftab.c sys_ucmd_e ucmdtab sys_ucmd_msg ( sys_ucmd_e cmd, void *arg, int len ) : exported library. MOD: rename object name in shared memory (sysshm.h) ADD: Warning message during installation this warning message will be existed until gtk GUI will be completed for gwc-v0.1-pre3. GTK+ daemon will be improved by hyseok hwang <o2...@ho...> gwc-v0.1-pre3 will be released until march. 15. 1006. Index: install.sh =================================================================== RCS file: /cvsroot/netadm/gwc/scripts/install.sh,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** install.sh 28 Feb 2006 00:52:07 -0000 1.12 --- install.sh 28 Feb 2006 23:41:50 -0000 1.13 *************** *** 68,71 **** --- 68,91 ---- } + warning() { + local msg=$(xmsg " + %s + + cvs-version %s + + WARNING! WARNING! + + This version is CVS temporary version + + You Can't use full functionalities of gwc + + Flow control will not operatate until releasing gwc-v0.1-pre3. + + 2006. 03. 01. jeho Park <lin...@ga...> + " ${PROD} ${VERSION}) + + + $DIALOG --msgbox "$msg" 20 75 || acex 0 + } intro() { *************** *** 511,514 **** --- 531,536 ---- fi + warning + warning intro trap abort_install 1 2 6 12 15 |
From: linuxpark <lin...@us...> - 2006-02-28 23:41:56
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13557/include Modified Files: confproc.h confutil.h sysdef.h sysipc.h sysshm.h Log Message: ADD: ADD: internal routine below in confproc.c, confproc.h add_fc_svc add_fc_net add_fc_fw add_fc_pol : definitly not list_fc_svc list_fc_net list_fc_fw list_fc_pol: not complete yet. del_fc_svc del_fc_net del_fc_fw del_fc_pol: definitly not ADD: internal routine for utils to access shared memory in confutil.c confutil.h conftab.c sys_ucmd_e ucmdtab sys_ucmd_msg ( sys_ucmd_e cmd, void *arg, int len ) : exported library. MOD: rename object name in shared memory (sysshm.h) ADD: Warning message during installation this warning message will be existed until gtk GUI will be completed for gwc-v0.1-pre3. GTK+ daemon will be improved by hyseok hwang <o2...@ho...> gwc-v0.1-pre3 will be released until march. 15. 1006. Index: confutil.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confutil.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** confutil.h 30 Jan 2006 17:41:29 -0000 1.1.1.1 --- confutil.h 28 Feb 2006 23:41:50 -0000 1.2 *************** *** 12,25 **** #define __SYS_CONFUTIL_H ! void frinit(frp_t fr); ! void frerr(frp_t fr, ipc_ret_e ret, char *fmt, ...); char *mapidtostr(sys_strmap_t * map, int id); int mapstrtoid(sys_strmap_t * map, char *str); ! int frerrmap(frp_t fr, ipc_ret_e ret, char *key, sys_strmap_t * map); ! void frfree(frp_t fr); - fr_t *ipc_msg(sys_cmd_e cmd, void *p, unsigned short plen, int argc); char *mapidtostr(sys_strmap_t * map, int id); int cshmattach(sm_t ** csm); int cshmdetach(sm_t * csm); #endif /* __SYS_UTIL_H */ --- 12,55 ---- #define __SYS_CONFUTIL_H ! /* U T I L F U N C I D X */ ! typedef enum { ! _CMD_GET_FC_NET = 0, ! _CMD_GET_FC_SVC, ! _CMD_GET_FC_FW, ! _CMD_GET_FC_POL, ! } sys_ucmd_e; ! ! typedef void* (*ucmdcallback_t) (void *arg, int len); ! ! typedef struct { ! sys_ucmd_e cmd; ! ucmdcallback_t func; ! } sys_ucmd_t; ! /* ! * TODO : these are internal function, don't call directly ! * these functions will be call by sys_ucmd_msg with it's cmd (index) ! */ ! void * _get_fc_net (void *arg, int len); ! void * _get_fc_svc (void *arg, int len); ! void * _get_fc_fw (void *arg, int len); ! void * _get_fc_pol (void *arg, int len); ! ! /* sys_ucmd_msg ! * @cmd : cmd of handler ! * @arg : random arg which will be used in handler ! * @len : sizeof arg ! */ ! void * sys_ucmd_msg (sys_ucmd_e cmd, void *arg, int len); ! fr_t *ipc_msg(sys_cmd_e cmd, void *p, unsigned short plen, int argc); ! char *mapidtostr(sys_strmap_t * map, int id); int mapstrtoid(sys_strmap_t * map, char *str); ! void frinit(frp_t fr); ! void frerr(frp_t fr, ipc_ret_e ret, char *fmt, ...); ! void frerrmap(frp_t fr, ipc_ret_e ret, char *key, sys_strmap_t * map); void frfree(frp_t fr); char *mapidtostr(sys_strmap_t * map, int id); int cshmattach(sm_t ** csm); int cshmdetach(sm_t * csm); + #endif /* __SYS_UTIL_H */ Index: sysshm.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysshm.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sysshm.h 25 Feb 2006 22:59:00 -0000 1.5 --- sysshm.h 28 Feb 2006 23:41:50 -0000 1.6 *************** *** 39,66 **** #define MUTEX_UNLOCK 0 typedef struct { ! int state; /* state being able to query */ ! int target; /* flag whether target is gw, ap, or CISCO ap */ ! sys_net_t ap; /* network infomation of AP or general gw */ ! int snmp; /* flag whether target can support SNMP */ ! char community[MAXCOMMNAME]; /* SNMP community */ ! int shared_mutex; /* shared mutex for radio state */ ! int ridx_slot; sys_802dot11if_t radiodev[MAXSHM_RADIO]; ! int ifcnt; ! qos_if_t dev[MAXSHM_IF]; ! int maxbw; ! int tcifcnt; /* TC dev info for its max bandwidth */ ! qos_dev_t tc_dev[MAXSHM_IF]; ! int cscnt; ! qos_class_t glass[MAXSHM_QOS_CLASS]; ! int ftcnt; ! qos_filter_t filter[MAXSHM_QOS_FILTER]; ! int polused; ! int polcnt; ! qos_pol_t pol[MAXSHM_QOS_POL]; ! int hpolcnt; /* error packet */ ! sys_host_pol_t hostpol[MAXSHM_HOST_POL]; ! sys_autoconf_t auto_test; } sm_t; --- 39,86 ---- #define MUTEX_UNLOCK 0 + /* F L O W C O N T R O L O B J E C T L I M I T */ + #define MAXSHM_FC_NET 256 + #define MAXSHM_FC_SVC 256 + #define MAXSHM_FC_FW 128 + #define MAXSHM_FC_POL 1024 + typedef struct { ! int state; /* state being able to query */ ! int target; /* flag whether target is gw, ap, or CISCO ap */ ! sys_net_t ap; /* network infomation of AP or general gw */ ! int snmp; /* flag whether target can support SNMP */ ! char community[MAXCOMMNAME]; /* SNMP community */ ! int shared_mutex; /* shared mutex for radio state */ ! int ridx_slot; sys_802dot11if_t radiodev[MAXSHM_RADIO]; ! int ifcnt; ! qos_if_t dev[MAXSHM_IF]; ! int maxbw; /* Q O S */ ! int tcifcnt; /* TC dev info for its max bandwidth */ ! qos_dev_t tc_dev[MAXSHM_IF]; ! int cscnt; ! qos_class_t glass[MAXSHM_QOS_CLASS]; ! int ftcnt; ! qos_filter_t filter[MAXSHM_QOS_FILTER]; ! int polused; ! int polcnt; ! qos_pol_t pol[MAXSHM_QOS_POL]; ! ! int fc_net_cnt; /* F L O W C O N T R O L */ ! fc_net_t fc_net [MAXSHM_FC_NET]; ! ! int fc_svc_cnt; ! fc_svc_t fc_svc [MAXSHM_FC_SVC]; ! ! int fc_fw_cnt; ! fc_fw_t fc_fw [MAXSHM_FC_FW]; ! ! int fc_pol_cnt; ! fc_pol_t fc_pol [MAXSHM_FC_POL]; ! ! /* TODO: delete this after finishing up FC */ ! int hpolcnt; /* error packet */ ! sys_host_pol_t hostpol[MAXSHM_HOST_POL]; ! sys_autoconf_t auto_test; } sm_t; Index: confproc.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confproc.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** confproc.h 25 Feb 2006 22:59:00 -0000 1.2 --- confproc.h 28 Feb 2006 23:41:50 -0000 1.3 *************** *** 13,16 **** --- 13,21 ---- 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_fcpolrule []; /* * void functionname (int argc, char *argv[], int modify, frp_t fr); *************** *** 34,37 **** --- 39,43 ---- 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); void add_qos_maxbw(int argc, char *argv[], int modify, frp_t fr); *************** *** 47,51 **** void del_qos_pol(int argc, char *argv[], int modify, frp_t fr); void qos_apply(int argc, char *argv[], int modify, frp_t fr); ! void list_fc_svc(int argc, char *argv[], int modify, frp_t fr); void add_fc_svc(int argc, char *argv[], int modify, frp_t fr); --- 53,57 ---- void del_qos_pol(int argc, char *argv[], int modify, frp_t fr); void qos_apply(int argc, char *argv[], int modify, frp_t fr); ! /* F C */ void list_fc_svc(int argc, char *argv[], int modify, frp_t fr); void add_fc_svc(int argc, char *argv[], int modify, frp_t fr); *************** *** 61,64 **** --- 67,71 ---- void del_fc_pol(int argc, char *argv[], int modify, frp_t fr); void fc_apply(int argc, char *argv[], int modify, frp_t fr); + /* A P A U T O */ void list_auto(int argc, char *argv[], int modify, frp_t fr); void set_auto(int argc, char *argv[], int modify, frp_t fr); Index: sysipc.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysipc.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sysipc.h 25 Feb 2006 22:59:00 -0000 1.2 --- sysipc.h 28 Feb 2006 23:41:50 -0000 1.3 *************** *** 109,112 **** --- 109,116 ---- } sys_cmd_e; + #define CBFROM_MAIN 1 + #define CBFROM_MOD 2 + #define CBFROM_SYSTEM 3 + #define __IOCTL_IDX_BASE CMD_LISTTHRESHOLD Index: sysdef.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysdef.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sysdef.h 27 Feb 2006 18:34:26 -0000 1.4 --- sysdef.h 28 Feb 2006 23:41:50 -0000 1.5 *************** *** 210,214 **** typedef struct { char name[OL]; ! sys_proto_type_e type; union { unsigned short port; --- 210,214 ---- typedef struct { char name[OL]; ! sys_proto_type_e proto; union { unsigned short port; *************** *** 221,225 **** int val; sys_thput_unit_e unit; ! } fc_flow_t; typedef enum { --- 221,225 ---- int val; sys_thput_unit_e unit; ! } fc_fw_t; typedef enum { *************** *** 235,239 **** char dnet[OL]; char dsvc[OL]; ! char flow[OL]; fc_pol_rule_e rule; } fc_pol_t; --- 235,239 ---- char dnet[OL]; char dsvc[OL]; ! char fw[OL]; fc_pol_rule_e rule; } fc_pol_t; |
From: linuxpark <lin...@us...> - 2006-02-28 23:41:55
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13557/gwclib Modified Files: Makefile confproc.c conftab.c confutil.c sysutil.c Log Message: ADD: ADD: internal routine below in confproc.c, confproc.h add_fc_svc add_fc_net add_fc_fw add_fc_pol : definitly not list_fc_svc list_fc_net list_fc_fw list_fc_pol: not complete yet. del_fc_svc del_fc_net del_fc_fw del_fc_pol: definitly not ADD: internal routine for utils to access shared memory in confutil.c confutil.h conftab.c sys_ucmd_e ucmdtab sys_ucmd_msg ( sys_ucmd_e cmd, void *arg, int len ) : exported library. MOD: rename object name in shared memory (sysshm.h) ADD: Warning message during installation this warning message will be existed until gtk GUI will be completed for gwc-v0.1-pre3. GTK+ daemon will be improved by hyseok hwang <o2...@ho...> gwc-v0.1-pre3 will be released until march. 15. 1006. Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/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 28 Feb 2006 23:41:50 -0000 1.2 *************** *** 11,15 **** rely=`uname -r | cut -f 2 -d .` ! SYSOBJS = conftab.o \ confutil.o \ confproc.o \ --- 11,15 ---- rely=`uname -r | cut -f 2 -d .` ! SYSOBJS = conftab.o \ confutil.o \ confproc.o \ Index: sysutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/sysutil.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sysutil.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- sysutil.c 28 Feb 2006 23:41:50 -0000 1.2 *************** *** 720,721 **** --- 720,722 ---- free(vp); } + Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** confproc.c 28 Feb 2006 00:52:07 -0000 1.7 --- confproc.c 28 Feb 2006 23:41:50 -0000 1.8 *************** *** 47,51 **** #define max(A,B) ((A) > (B) ? (A):(B)) ! extern sys_cmd_t cmdtab[]; extern sm_t *csm; #if 0 --- 47,52 ---- #define max(A,B) ((A) > (B) ? (A):(B)) ! extern sys_cmd_t cmdtab[]; ! extern sys_ucmd_t ucmdtab[]; [...1254 lines suppressed...] --- 2907,2911 ---- *************** *** 2395,2401 **** msg.max_pktrate = csm->hostpol[i].max_pktrate; if ((ret = ioctl(fd, idx, &msg)) < 0) { ! if (errno != EBADSLT) { /* EBADSLT , slot error example no instance in module */ frerr(fr, RET_EIOCTL, ! "%s: Ioctl Failed [name:%s] [IP:%u.%u.%u.%u] [flag:%d] [rate:%d]\n", SZPFDEV, csm->hostpol[i].name, NIPQUAD(csm->hostpol[i].ip), --- 2940,2948 ---- msg.max_pktrate = csm->hostpol[i].max_pktrate; if ((ret = ioctl(fd, idx, &msg)) < 0) { ! if (errno != EBADSLT) { ! /* EBADSLT , slot error example no instance in module */ frerr(fr, RET_EIOCTL, ! "%s: Ioctl Failed [name:%s] [IP:%u.%u.%u.%u] " ! "[flag:%d] [rate:%d]\n", SZPFDEV, csm->hostpol[i].name, NIPQUAD(csm->hostpol[i].ip), Index: confutil.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confutil.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** confutil.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- confutil.c 28 Feb 2006 23:41:50 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- #include "sysnio.h" #include "sysdef.h" + #include "confutil.h" #if !defined(TRUE) *************** *** 40,44 **** --- 41,107 ---- #endif + extern sm_t *csm; + #define FC_CNT(X) csm->fc_##X ##_cnt + #define FC_OBJ(X, I) csm->fc_##X[I] + #define FC_OBJ_NAME(X, I) csm->fc_##X[I].name + extern sys_cmd_t cmdtab[]; + extern sys_ucmd_t ucmdtab[]; + + void * sys_ucmd_msg (sys_ucmd_e cmd, void *arg, int len) { + /* + * TODO: someday later, lock for shared mem will be needed + * to support multiprocessing by admin + */ + return ucmdtab[cmd].func (arg, len); + } + + void * _get_fc_net ( void *arg, int len) { + int i; + char *name = (char *)arg; + + for ( i = 0 ; i < FC_CNT(net); i++) { + if ( !strncmp (FC_OBJ_NAME(net, i), name, len)) + return &FC_OBJ(net, i); + } + + return NULL; + } + + void * _get_fc_svc ( void *arg, int len) { + int i; + char *name = (char *)arg; + + for ( i = 0 ; i < FC_CNT(svc); i++) { + if ( !strncmp (FC_OBJ_NAME(svc, i), name, len)) + return &FC_OBJ(svc, i); + } + + return NULL; + } + + void * _get_fc_fw ( void *arg, int len) { + int i; + char *name = (char *)arg; + + for ( i = 0 ; i < FC_CNT(fw); i++) { + if ( !strncmp (FC_OBJ_NAME(fw, i), name, len)) + return &FC_OBJ(fw, i); + } + + return NULL; + } + + void * _get_fc_pol ( void *arg, int len) { + int i; + char *name = (char *)arg; + + for ( i = 0 ; i < FC_CNT(pol); i++) { + if ( !strncmp (FC_OBJ_NAME(pol, i), name, len)) + return &FC_OBJ(pol, i); + } + + return NULL; + } char * *************** *** 79,82 **** --- 142,146 ---- map++; } + return frerr(fr, ret, "[%s] must be one of the %s\n", key, msg); } Index: conftab.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/conftab.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** conftab.c 25 Feb 2006 22:59:00 -0000 1.2 --- conftab.c 28 Feb 2006 23:41:50 -0000 1.3 *************** *** 21,26 **** --- 21,28 ---- #include "sysutil.h" #include "sysdef.h" + #include "sysshm.h" #include "confproc.h" #include "message.h" + #include "confutil.h" #ifdef NOPROCNEED #define PR(func) NULL *************** *** 94,95 **** --- 96,105 ---- , }; + + sys_ucmd_t ucmdtab [] = { + { _CMD_GET_FC_NET, _get_fc_net }, + { _CMD_GET_FC_SVC, _get_fc_svc }, + { _CMD_GET_FC_FW, _get_fc_fw }, + { _CMD_GET_FC_POL, _get_fc_pol }, + {0}, + }; |
From: linuxpark <lin...@us...> - 2006-02-28 23:07:55
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21531 Modified Files: slog.c Log Message: MOD: syslog LOCAL0 -> gwcadmd syslog LOCAL1 -> gwcguid Index: slog.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/slog.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** slog.c 30 Jan 2006 17:41:28 -0000 1.1.1.1 --- slog.c 28 Feb 2006 23:07:49 -0000 1.2 *************** *** 45,53 **** */ ! if (!strcmp(ident, "admd")) { ! openlog(ident, LOG_PID | LOG_NDELAY, LOG_LOCAL1); ! } else { openlog(ident, LOG_PID | LOG_NDELAY, LOG_LOCAL0); } pri[SYSLA] = 'A'; --- 45,54 ---- */ ! if (!strcmp(ident, "gwcadmd")) { openlog(ident, LOG_PID | LOG_NDELAY, LOG_LOCAL0); } + else { + openlog(ident, LOG_PID | LOG_NDELAY, LOG_LOCAL1); + } pri[SYSLA] = 'A'; |
From: linuxpark <lin...@us...> - 2006-02-28 23:05:23
|
Update of /cvsroot/netadm/gwc/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19008 Modified Files: syslog.conf Log Message: MOD: redirect syslog to gwcadmd.log or gwcguid.log Index: syslog.conf =================================================================== RCS file: /cvsroot/netadm/gwc/scripts/syslog.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** syslog.conf 31 Jan 2006 14:19:38 -0000 1.2 --- syslog.conf 28 Feb 2006 23:05:17 -0000 1.3 *************** *** 9,14 **** #ident "@(#) $Header$" ! local0.* /usr/local/gwc/log/daemon.log ! local1.* /usr/local/gwc/log/daemon.log # Kernel Mode log --- 9,14 ---- #ident "@(#) $Header$" ! local0.* /usr/local/gwc/log/gwcadmd.log ! local1.* /usr/local/gwc/log/gwcguid.log # Kernel Mode log |
From: linuxpark <lin...@us...> - 2006-02-28 01:00:12
|
Update of /cvsroot/netadm/gwc/pf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32294 Modified Files: sysktimer.c sysktimer.h Log Message: MOD: return type from int to pid_t. Index: sysktimer.h =================================================================== RCS file: /cvsroot/netadm/gwc/pf/sysktimer.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sysktimer.h 28 Feb 2006 00:47:16 -0000 1.1 --- sysktimer.h 28 Feb 2006 01:00:09 -0000 1.2 *************** *** 22,26 **** }; ! extern int register_sys_timer ( struct sys_timer_t *timer ); extern int unregister_sys_timer ( pid_t pid ); --- 22,26 ---- }; ! extern pid_t register_sys_timer ( struct sys_timer_t *timer ); extern int unregister_sys_timer ( pid_t pid ); Index: sysktimer.c =================================================================== RCS file: /cvsroot/netadm/gwc/pf/sysktimer.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sysktimer.c 28 Feb 2006 00:47:16 -0000 1.1 --- sysktimer.c 28 Feb 2006 01:00:09 -0000 1.2 *************** *** 66,70 **** } ! int register_sys_timer ( struct sys_timer_t *timer ) { struct task_struct *tsk; --- 66,70 ---- } ! pid_t register_sys_timer ( struct sys_timer_t *timer ) { struct task_struct *tsk; |
From: linuxpark <lin...@us...> - 2006-02-28 00:52:10
|
Update of /cvsroot/netadm/gwc/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26831/scripts Modified Files: gwc install.sh Log Message: MOD: MOD: install sysktimer in install.sh MOD: some ugly code of logging in install.sh MOD: add rm/insmod code for sysktimer MOD: renaming macro var in sysioctl.h Index: gwc =================================================================== RCS file: /cvsroot/netadm/gwc/scripts/gwc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gwc 19 Feb 2006 21:59:59 -0000 1.3 --- gwc 28 Feb 2006 00:52:07 -0000 1.4 *************** *** 181,184 **** --- 181,185 ---- start gwcadmd start gwcguid + insmod ${MODDIR}/sysktimer.ko insmod ${MODDIR}/pf.ko debug=0 reload ip_tables *************** *** 200,203 **** --- 201,205 ---- stop gwcguid rmmod pf + rmmod sysktimer rmmod ipt_MASQUERADE rmmod iptable_mangle Index: install.sh =================================================================== RCS file: /cvsroot/netadm/gwc/scripts/install.sh,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** install.sh 26 Feb 2006 16:43:29 -0000 1.11 --- install.sh 28 Feb 2006 00:52:07 -0000 1.12 *************** *** 131,134 **** --- 131,135 ---- $DIALOG --msgbox "${ERROR}" 20 75 || acex 0 abort_install + log "$ERROR" exit 1 fi *************** *** 236,239 **** --- 237,241 ---- ${INST} -m 700 -o root -g root gwcadmd/gwcadmd ${BINDIR} ${INST} -m 644 -o root -g root pf/pf.ko ${MODDIR} + ${INST} -m 644 -o root -g root pf/sysktimer.ko ${MODDIR} ${INST} -m 700 -o root -g root scripts/${RUNSHELL} ${BINDIR} ${INST} -m 644 -o root -g root scripts/syslog.conf /etc *************** *** 255,258 **** --- 257,261 ---- sleep 2 abort_install + log "$ERROR" exit 1 fi *************** *** 275,279 **** sleep 2 abort_install ! log "gwccli binary does not exist , abort ..." exit 1 fi --- 278,282 ---- sleep 2 abort_install ! log "$ERROR" exit 1 fi *************** *** 284,288 **** sleep 2 abort_install ! log "gwcguid binary does not exist , abort install ..." exit 1 fi --- 287,291 ---- sleep 2 abort_install ! log "$ERROR" exit 1 fi *************** *** 293,297 **** sleep 2 abort_install ! log "gwcadmd binary does not exist , abort ..." exit 1 fi --- 296,300 ---- sleep 2 abort_install ! log "$ERROR" exit 1 fi *************** *** 303,307 **** sleep 2 abort_install ! log "pf.ko does not exist , abort ..." exit 1 fi --- 306,319 ---- sleep 2 abort_install ! log "$ERROR" ! exit 1 ! fi ! ! if [ ! -f pf/sysktimer.ko ]; then ! ERROR="sysktimer module does not exist, compile first! abort install ..." ! $DIALOG --infobox "${ERROR}" 5 75 ! sleep 2 ! abort_install ! log "$ERROR" exit 1 fi *************** *** 313,317 **** sleep 2 abort_install ! log "gwc binary does not exist , abort ..." exit 1 fi --- 325,329 ---- sleep 2 abort_install ! log "$ERROR" exit 1 fi *************** *** 322,326 **** sleep 2 abort_install ! log "iproute tools does not exist , abort ..." exit 1 fi --- 334,338 ---- sleep 2 abort_install ! log "$ERROR" exit 1 fi *************** *** 331,335 **** sleep 2 abort_install ! log "iproute tools does not exist , abort ..." exit 1 fi --- 343,347 ---- sleep 2 abort_install ! log "$ERROR" exit 1 fi *************** *** 343,347 **** sleep 2 abort_install ! log "config file does not exist , abort install ..." exit 1 fi --- 355,359 ---- sleep 2 abort_install ! log "$ERROR" exit 1 fi *************** *** 517,521 **** sleep 2 abort_install ! log "Can't support for OS: ${OS}" >&2 exit 1 fi --- 529,533 ---- sleep 2 abort_install ! log "$ERROR" >&2 exit 1 fi *************** *** 525,529 **** $DIALOG --infobox "${ERROR}" 5 75 || acex 0 sleep 2 ! log "Already installed, abort ...">&2 exit 1 fi --- 537,541 ---- $DIALOG --infobox "${ERROR}" 5 75 || acex 0 sleep 2 ! log "$ERROR">&2 exit 1 fi |
From: linuxpark <lin...@us...> - 2006-02-28 00:52:10
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26831/include Modified Files: sysioctl.h Log Message: MOD: MOD: install sysktimer in install.sh MOD: some ugly code of logging in install.sh MOD: add rm/insmod code for sysktimer MOD: renaming macro var in sysioctl.h Index: sysioctl.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysioctl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sysioctl.h 17 Feb 2006 06:58:59 -0000 1.2 --- sysioctl.h 28 Feb 2006 00:52:07 -0000 1.3 *************** *** 9,14 **** #ident "@(#) $Header$" ! #ifndef _IOCTLPF_H_ ! #define _IOCTLPF_H_ #define IOCTLPF_MAGIC 't' --- 9,14 ---- #ident "@(#) $Header$" ! #ifndef __SYS_IOCTL_H_ ! #define __SYS_IOCTL_H_ #define IOCTLPF_MAGIC 't' *************** *** 20,27 **** #define IOCTLPF_REGISTER_SRCBLOCK _IO (IOCTLPF_MAGIC, 0) ! #define IOCTLPF_REGISTER_MODSEQ _IO (IOCTLPF_MAGIC, 1) ! #define IOCTLPF_UNREGISTER_HOST _IO (IOCTLPF_MAGIC, 2) ! #define IOCTLPF_REFLESH _IO (IOCTLPF_MAGIC, 3) ! #define IOCTLPF_MAXNR 4 ! #endif /* _IOCTLPF_H_ */ --- 20,27 ---- #define IOCTLPF_REGISTER_SRCBLOCK _IO (IOCTLPF_MAGIC, 0) ! #define IOCTLPF_REGISTER_MODSEQ _IO (IOCTLPF_MAGIC, 1) ! #define IOCTLPF_UNREGISTER_HOST _IO (IOCTLPF_MAGIC, 2) ! #define IOCTLPF_REFLESH _IO (IOCTLPF_MAGIC, 3) ! #define IOCTLPF_MAXNR 4 ! #endif /* __SYS_IOCTL_H_ */ |
From: linuxpark <lin...@us...> - 2006-02-28 00:52:10
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26831/gwclib Modified Files: confproc.c Log Message: MOD: MOD: install sysktimer in install.sh MOD: some ugly code of logging in install.sh MOD: add rm/insmod code for sysktimer MOD: renaming macro var in sysioctl.h Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** confproc.c 27 Feb 2006 18:34:26 -0000 1.6 --- confproc.c 28 Feb 2006 00:52:07 -0000 1.7 *************** *** 2102,2105 **** --- 2102,2106 ---- list_fc_pol(int argc, char *argv[], int modify, frp_t fr) { + int len; int start; *************** *** 2149,2153 **** n += 1 + sprintf(&fr->p[n], "%d", csm->hostpol[i].max_pktrate); } ! fr->cols = 4; fr->rows = end - start; --- 2150,2154 ---- n += 1 + sprintf(&fr->p[n], "%d", csm->hostpol[i].max_pktrate); } ! fr->cols = 4; fr->rows = end - start; |
From: linuxpark <lin...@us...> - 2006-02-28 00:49:57
|
Update of /cvsroot/netadm/gwc/pf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25775 Modified Files: Makefile pf.c pf.h sysioctl.h Log Message: MOD: MOD: replace the code using kernel dynamic timer in pf to our sysktimer ADD: sysktimer in Makefile MOD: renaming macro in sysioctl Index: pf.h =================================================================== RCS file: /cvsroot/netadm/gwc/pf/pf.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pf.h 17 Feb 2006 06:59:00 -0000 1.2 --- pf.h 28 Feb 2006 00:49:54 -0000 1.3 *************** *** 9,25 **** #ident "@(#) $Header$" ! #ifndef __ASRV_PFILTER_H ! #define __ASRV_PFILTER_H #include <linux/udp.h> #include <linux/types.h> #if !defined(PFINFO) ! #define PFINFO "cherokee-pf" #endif #ifndef DEVICE_NAME ! #define DEVICE_NAME "cherokee-pf" #endif #ifndef KUIO_DEVICE_NAME ! #define KUIO_DEVICE_NAME "cherokee-kuio" #endif #define KUIO_MAJOR_NUM 253 --- 9,25 ---- #ident "@(#) $Header$" ! #ifndef __SYS_PF_H ! #define __SYS_PF_H #include <linux/udp.h> #include <linux/types.h> #if !defined(PFINFO) ! #define PFINFO "gwc-pf" #endif #ifndef DEVICE_NAME ! #define DEVICE_NAME "gwc-pf" #endif #ifndef KUIO_DEVICE_NAME ! #define KUIO_DEVICE_NAME "gwc-kuio" #endif #define KUIO_MAJOR_NUM 253 Index: pf.c =================================================================== RCS file: /cvsroot/netadm/gwc/pf/pf.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pf.c 17 Feb 2006 07:31:35 -0000 1.3 --- pf.c 28 Feb 2006 00:49:54 -0000 1.4 *************** *** 43,53 **** #include "pf.h" #include "sysioctl.h" static int debug __initdata = 0; static int kuio_rdopen = 0; static int kuio_wdopen = 0; static struct nf_hook_ops iphook_tab; - static struct timer_list pc_alz; - static void set_timer(void); /* block list hash table */ --- 43,58 ---- #include "pf.h" #include "sysioctl.h" + #include "sysktimer.h" + #include "../include/global.h" + + #define DRIVER_AUTHOR "jeho park <lin...@gm...>" + #define DRIVER_VERSION "gwc-pf-" SZSYSVERSION + #define DRIVER_DESC "pf of gwc in netadm project " DRIVER_VERSION + static pid_t tid; /* timer thread id */ static int debug __initdata = 0; static int kuio_rdopen = 0; static int kuio_wdopen = 0; static struct nf_hook_ops iphook_tab; /* block list hash table */ *************** *** 135,139 **** } ! static void update_pktcnt( unsigned long ptr ){ struct blk *blkh, **blkhp; int i; --- 140,144 ---- } ! static int update_pktcnt( void *arg ){ struct blk *blkh, **blkhp; int i; *************** *** 150,154 **** spin_unlock(&blk_hash_table[i].lock); } ! set_timer(); } --- 155,160 ---- spin_unlock(&blk_hash_table[i].lock); } ! ! return 1; } *************** *** 266,275 **** } ! static void set_timer(void) { ! pc_alz.function = update_pktcnt; ! pc_alz.data = 0; ! pc_alz.expires = jiffies + HZ; ! add_timer(&pc_alz); } --- 272,282 ---- } ! static void init_systimer (struct sys_timer_t * t) { ! t->func = update_pktcnt; /* 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 */ } *************** *** 534,539 **** static int __init ! cherokee_pf_init(void) { printk("%s: Loading %s module ...\n", DEVICE_NAME, DEVICE_NAME); --- 541,548 ---- static int __init ! gwc_pf_init(void) { + static struct sys_timer_t timer; + printk("%s: Loading %s module ...\n", DEVICE_NAME, DEVICE_NAME); *************** *** 544,555 **** init_pf(); init_kuio(); ! init_timer(&pc_alz); ! set_timer(); return 0; } static void __exit ! cherokee_pf_exit(void) { printk("%s: Unloading %s modules...\n", DEVICE_NAME, DEVICE_NAME); exit_pf(); --- 553,575 ---- 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; } + module_init(gwc_pf_init); static void __exit ! gwc_pf_exit(void) { + + if ( tid > 0 && unregister_sys_timer(tid) < 0 ) { + printk("%s: Failed to unregister timer\n", DEVICE_NAME); + } + printk("%s: Unloading %s modules...\n", DEVICE_NAME, DEVICE_NAME); exit_pf(); *************** *** 559,570 **** } exit_kuio(); - del_timer(&pc_alz); } - module_init(cherokee_pf_init); - module_exit(cherokee_pf_exit); module_param(debug, int, 0444); MODULE_PARM_DESC(debug, "enable pfilter debug output (default 0 off)"); ! MODULE_LICENSE("Dual BSD/GPL"); ! MODULE_AUTHOR("jeho park <par...@ho...>"); ! MODULE_DESCRIPTION("wibro pf modules"); --- 579,590 ---- } exit_kuio(); } + module_exit(gwc_pf_exit); module_param(debug, int, 0444); MODULE_PARM_DESC(debug, "enable pfilter debug output (default 0 off)"); ! MODULE_AUTHOR(DRIVER_AUTHOR); ! MODULE_DESCRIPTION(DRIVER_DESC); ! MODULE_LICENSE("GPL"); ! MODULE_VERSION(DRIVER_VERSION); ! Index: Makefile =================================================================== RCS file: /cvsroot/netadm/gwc/pf/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:25 -0000 1.1.1.1 --- Makefile 28 Feb 2006 00:49:54 -0000 1.2 *************** *** 8,12 **** #ident "@(#) $Header$" ! obj-m := pf.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) --- 8,13 ---- #ident "@(#) $Header$" ! obj-m += sysktimer.o ! obj-m += pf.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) Index: sysioctl.h =================================================================== RCS file: /cvsroot/netadm/gwc/pf/sysioctl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sysioctl.h 17 Feb 2006 06:59:00 -0000 1.2 --- sysioctl.h 28 Feb 2006 00:49:54 -0000 1.3 *************** *** 9,14 **** #ident "@(#) $Header$" ! #ifndef _IOCTLPF_H_ ! #define _IOCTLPF_H_ #define IOCTLPF_MAGIC 't' --- 9,14 ---- #ident "@(#) $Header$" ! #ifndef __SYS_IOCTL_H_ ! #define __SYS_IOCTL_H_ #define IOCTLPF_MAGIC 't' *************** *** 20,27 **** #define IOCTLPF_REGISTER_SRCBLOCK _IO (IOCTLPF_MAGIC, 0) ! #define IOCTLPF_REGISTER_MODSEQ _IO (IOCTLPF_MAGIC, 1) ! #define IOCTLPF_UNREGISTER_HOST _IO (IOCTLPF_MAGIC, 2) ! #define IOCTLPF_REFLESH _IO (IOCTLPF_MAGIC, 3) ! #define IOCTLPF_MAXNR 4 ! #endif /* _IOCTLPF_H_ */ --- 20,27 ---- #define IOCTLPF_REGISTER_SRCBLOCK _IO (IOCTLPF_MAGIC, 0) ! #define IOCTLPF_REGISTER_MODSEQ _IO (IOCTLPF_MAGIC, 1) ! #define IOCTLPF_UNREGISTER_HOST _IO (IOCTLPF_MAGIC, 2) ! #define IOCTLPF_REFLESH _IO (IOCTLPF_MAGIC, 3) ! #define IOCTLPF_MAXNR 4 ! #endif /* __SYS_IOCTL_H_ */ |
From: linuxpark <lin...@us...> - 2006-02-28 00:47:23
|
Update of /cvsroot/netadm/gwc/pf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23719 Added Files: sysktimer.c sysktimer.h Log Message: Initial Check-in Replace current dynamic kernel timer of linux API with more simple netadm made timer called "sysktimer" --- NEW FILE: sysktimer.h --- /* * filename : timer.h * 2006. 02. 28. (thu) 08:39:39 KST * lin...@gm... */ #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/timer.h> #include <linux/interrupt.h> #ifndef __SYS_TIMER_H #define __SYS_TIMER_H struct sys_timer_t { int (*func)(void *argument); void *data; int t_time; struct timespec t; }; extern int register_sys_timer ( struct sys_timer_t *timer ); extern int unregister_sys_timer ( pid_t pid ); #endif --- NEW FILE: sysktimer.c --- /* * filename : timer.c * 2006. 02. 28. (thu) 08:38:14 KST * lin...@gm... */ #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/timer.h> #include <linux/interrupt.h> #include <linux/kthread.h> #include "sysktimer.h" #include "../include/global.h" #define DRIVER_AUTHOR "jeho park <lin...@gm...>" #define DRIVER_VERSION "gwc-timer-" SZSYSVERSION #define DRIVER_DESC "gwc of netadm project " DRIVER_VERSION 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"); } if (ret < 0 ) return ret; printk("%s start, total time: %d\n", __FUNCTION__, p->t_time); expire = timespec_to_jiffies(&p->t) + (p->t.tv_sec || p->t.tv_nsec); while (1) { if ( p->t_time > 0 && jiffies > ( p->t_time * HZ + i_time) ) { printk("%s: timer thread exit\n", DRIVER_VERSION); break; } expire = timespec_to_jiffies(&p->t) + (p->t.tv_sec || p->t.tv_nsec); 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 exit\n", __FUNCTION__); return 1; } } return 1; } int register_sys_timer ( struct sys_timer_t *timer ) { struct task_struct *tsk; tsk = kthread_create ( netadm_timer_thread, timer, "%s", DRIVER_VERSION); if (IS_ERR(tsk)) { printk("can't create netadm_timer\n"); return -EAGAIN; } wake_up_process (tsk); 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) { printk("%s: register netadm timer\n", DRIVER_VERSION); return 0; } module_init(init_netadm_timer); static void __exit exit_netadm_timer(void) { printk("%s: unregister netadm timer\n", DRIVER_VERSION); } module_exit(exit_netadm_timer); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); MODULE_VERSION(DRIVER_VERSION); |
From: linuxpark <lin...@us...> - 2006-02-27 18:34:35
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30628/gwclib Modified Files: confproc.c Log Message: ADD: define strmap to use in gwc-v1.0-pre3 Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** confproc.c 26 Feb 2006 16:43:29 -0000 1.5 --- confproc.c 27 Feb 2006 18:34:26 -0000 1.6 *************** *** 64,75 **** */ 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} ! , }; --- 64,120 ---- */ 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_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 }, ! { "mbypte", SYS_FLOW_MBYTE }, ! { 0 }, ! }; ! ! sys_strmap_t map_polrule [] = { ! { "fc", FC_PR_CONTROL }, ! { "mh", FC_PR_MOD_HEADER }, ! { 0 }, }; |
From: linuxpark <lin...@us...> - 2006-02-27 18:34:35
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30628/include Modified Files: sysdef.h Log Message: ADD: define strmap to use in gwc-v1.0-pre3 Index: sysdef.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysdef.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sysdef.h 25 Feb 2006 23:41:14 -0000 1.3 --- sysdef.h 27 Feb 2006 18:34:26 -0000 1.4 *************** *** 213,217 **** union { unsigned short port; ! unsigned short icmptype; } u; } fc_svc_t; --- 213,217 ---- union { unsigned short port; ! sys_icmp_type_e icmptype; } u; } fc_svc_t; *************** *** 242,271 **** /* TODO: delete soon after completing flow control */ /* sys_host_pol_t/flag */ ! #define BLOCK_HOST 0x0001 ! #define MODIFY_SEQ 0x0002 ! #define MAX_PKTRATE 65535 typedef struct { /* struct in_addr ip; */ ! char name[OL]; ! int ip; ! unsigned short flag; ! int max_pktrate; } sys_host_pol_t; ! #define AUTO_STATE_INIT 0 ! #define AUTO_STATE_S1 1 ! #define AUTO_STATE_M1 2 ! #define AUTO_STATE_S2 3 ! #define AUTO_STATE_M2 4 ! #define MIN_AUTO_SINT 1 ! #define MAX_AUTO_SINT 2147 /* If one step is over 35.783 min, error will occur */ ! #define MIN_AUTO_MINT MIN_AUTO_SINT ! #define MAX_AUTO_MINT MAX_AUTO_SINT ! #define AUTO_FROMMIN 0 ! #define AUTO_FROMMAX 1 ! #define MIN_AUTO_CNUM 1 ! #define MAX_AUTO_CNUM 1280 /* --- 242,271 ---- /* TODO: delete soon after completing flow control */ /* sys_host_pol_t/flag */ ! #define BLOCK_HOST 0x0001 ! #define MODIFY_SEQ 0x0002 ! #define MAX_PKTRATE 65535 typedef struct { /* struct in_addr ip; */ ! char name[OL]; ! int ip; ! unsigned short flag; ! int max_pktrate; } sys_host_pol_t; ! #define AUTO_STATE_INIT 0 ! #define AUTO_STATE_S1 1 ! #define AUTO_STATE_M1 2 ! #define AUTO_STATE_S2 3 ! #define AUTO_STATE_M2 4 ! #define MIN_AUTO_SINT 1 ! #define MAX_AUTO_SINT 2147 /* If one step is over 35.783 min, error will occur */ ! #define MIN_AUTO_MINT MIN_AUTO_SINT ! #define MAX_AUTO_MINT MAX_AUTO_SINT ! #define AUTO_FROMMIN 0 ! #define AUTO_FROMMAX 1 ! #define MIN_AUTO_CNUM 1 ! #define MAX_AUTO_CNUM 1280 /* *************** *** 273,287 **** */ typedef struct { ! int type; ! int state; } arg_t; typedef struct { ! int sint_1; /* stopping interval */ ! int sint_2; ! int mint_1; /* moving interval */ ! int mint_2; ! int ilevel; /* 0: from min, 1: from max */ ! int cnum; /* number of cycle */ } sys_autoconf_t; --- 273,287 ---- */ typedef struct { ! int type; ! int state; } arg_t; typedef struct { ! int sint_1; /* stopping interval */ ! int sint_2; ! int mint_1; /* moving interval */ ! int mint_2; ! int ilevel; /* 0: from min, 1: from max */ ! int cnum; /* number of cycle */ } sys_autoconf_t; |
From: jeho-park <lin...@gm...> - 2006-02-27 04:59:13
|
kwan-kyung i thought you would be better researching IDS and IPS solution than translating korean document to english. because i asked my friend to help us with translating korean document to english. his major was psychology, but he is now teaching english at school. so he may be better than me at writing english. i hope this pratical method ease your pain ^--^ |
From: linuxpark <lin...@us...> - 2006-02-26 16:43:33
|
Update of /cvsroot/netadm/gwc/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28685/scripts Modified Files: install.sh Log Message: MOD: modifiy saveconf/loadconf to be more flexible and use built-in api. renaming. Index: install.sh =================================================================== RCS file: /cvsroot/netadm/gwc/scripts/install.sh,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** install.sh 25 Feb 2006 23:41:14 -0000 1.10 --- install.sh 26 Feb 2006 16:43:29 -0000 1.11 *************** *** 38,44 **** REMOTE="" TARGET_IP="" CISCO_AP="" SUPPORT_SNMP="" ! SNMP_COMMUNITY_NAME="" ERROR="" --- 38,47 ---- REMOTE="" TARGET_IP="" + #default NETMASK 24 + TARGET_MASK="24" CISCO_AP="" SUPPORT_SNMP="" ! #default COMMUNITY public ! SNMP_COMMUNITY_NAME="public" ERROR="" *************** *** 142,153 **** #SNMP_COMMUNITY_NAME echo -e "#SYS" > ${TMP_CONFIG} ! echo -e "# Last Updated: $(date)" >> ${TMP_CONFIG} echo -e "[qry_state]\t3" >> ${TMP_CONFIG} if [ ${CISCO_AP} == "" ]; then CISCO_AP="0" fi ! echo -e "[target]\t${CISCO_AP}" >> ${TMP_CONFIG} ! echo -e "[target_ip]\t${TARGET_IP}" >> ${TMP_CONFIG} ! echo -e "[target_mask]\t${TARGET_MASK}" >> ${TMP_CONFIG} if [ ${SUPPORT_SNMP} == "" ]; then SUPPORT_SNMP="0" --- 145,155 ---- #SNMP_COMMUNITY_NAME echo -e "#SYS" > ${TMP_CONFIG} ! echo -e "#Last Updated: $(date)" >> ${TMP_CONFIG} echo -e "[qry_state]\t3" >> ${TMP_CONFIG} if [ ${CISCO_AP} == "" ]; then CISCO_AP="0" fi ! echo -e "[target_type]\t${CISCO_AP}" >> ${TMP_CONFIG} ! echo -e "[target]\t${TARGET_IP}\t${TARGET_MASK}" >> ${TMP_CONFIG} if [ ${SUPPORT_SNMP} == "" ]; then SUPPORT_SNMP="0" *************** *** 155,158 **** --- 157,161 ---- echo -e "[snmp]\t${SUPPORT_SNMP}" >> ${TMP_CONFIG} echo -e "[snmp_community]\t${SNMP_COMMUNITY_NAME}" >> ${TMP_CONFIG} + echo -e "[auto_test]\t1\t1\t1\t1\t1\t1">> ${TMP_CONFIG} return |
From: linuxpark <lin...@us...> - 2006-02-26 16:43:33
|
Update of /cvsroot/netadm/gwc/gwclib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28685/gwclib Modified Files: confio.c confproc.c Log Message: MOD: modifiy saveconf/loadconf to be more flexible and use built-in api. renaming. Index: confio.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confio.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** confio.c 31 Jan 2006 14:19:38 -0000 1.2 --- confio.c 26 Feb 2006 16:43:29 -0000 1.3 *************** *** 39,43 **** --- 39,45 ---- #include "slog.h" #include "sysutil.h" + #include "confproc.h" + extern qos_tos_t tostab[]; void prenc(FILE * fp, char *fmt, ...) *************** *** 71,74 **** --- 73,77 ---- loadconf(sm_t * csm, char *fn) { + fr_t fr; FILE *fp; int lines; *************** *** 83,86 **** --- 86,97 ---- i = 0; + csm->ifcnt = 0; + csm->tcifcnt = 0; + csm->cscnt = 0; + csm->ftcnt = 0; + csm->polcnt = 0; + csm->hpolcnt = 0; + csm->ridx_slot = 0; + if (access(fn, R_OK | W_OK) == -1) { out("%s Access error", fn); *************** *** 93,98 **** } - csm->ridx_slot = 0; - for (lines = 0;; lines++) { memset(line, 0, sizeof (line)); --- 104,107 ---- *************** *** 136,139 **** --- 145,149 ---- if (argc >= 0) argc++; + frinit(&fr); if (!strcmp(cmd, "[qry_state]")) { *************** *** 145,149 **** } csm->state = val; ! } else if (!strcmp (cmd, "[target]")) { int val = atoi (argv[0]); if (val < TARGET_GW || val > TARGET_CISCO_AP ) { --- 155,159 ---- } csm->state = val; ! } else if (!strcmp (cmd, "[target_type]")) { int val = atoi (argv[0]); if (val < TARGET_GW || val > TARGET_CISCO_AP ) { *************** *** 153,183 **** } csm->target = val; ! } else if (!strcmp(cmd, "[target_ip]")) { ! if (!str_inetaddr(argv[0], TRUE)) { ! out("invalid AP IP address:\"%s\"\n", ! argv[0]); ! return RET_ECONFIG; ! } ! if ((csm->ap.addr.s_addr = ! inet_addr(argv[0])) == (in_addr_t) - 1) { ! out("invalid AP IP address:\"%s\"\n", ! argv[0]); ! return RET_ECONFIG; ! } ! } else if (!strcmp(cmd, "[target_mask]")) { ! if (!str_isdigit(argv[0])) { ! out("invalid AP mask :\"%s\"\n", ! argv[0]); ! return RET_ECONFIG; ! } ! ! if (atoi(argv[0]) > 32) { ! out("invalid AP mask :\"%s\"\n", ! argv[0]); ! return RET_ECONFIG; ! } ! csm->ap.mask = atoi(argv[0]); ! ! } else if (!strcmp(cmd, "[snmp]")) { int val = atoi (argv[0]); --- 163,169 ---- } csm->target = val; ! } else if (!strcmp(cmd, "[target]")) { ! add_apinfo(argc, argv, 0, &fr); ! }else if (!strcmp(cmd, "[snmp]")) { int val = atoi (argv[0]); *************** *** 187,205 **** } csm->snmp = val; ! } else if (!strcmp(cmd, "[snmp_community]")) { ! ! if (strlen(argv[0]) > MAXCOMMNAME || ! (csm->snmp == SNMP_SUPPORT && (strlen(argv[0]) == 0))) { ! out("invalid commnunity :\"%s\"\n", argv[0]); ! return RET_ECONFIG; ! } ! strncpy(csm->community, argv[0], ! strlen(argv[0])); } else if (!strcmp(cmd, "[radio_idx]")) { csm->radiodev[csm->ridx_slot++].idx = atoi(argv[0]); ! } else if (!strcmp(cmd, "[interface]")) { strcpy(csm->dev[csm->ifcnt].if_name, argv[0]); strcpy(csm->dev[csm->ifcnt].if_hostname, --- 173,186 ---- } csm->snmp = val; ! add_snmpcomm(argc, argv, 0, &fr); } else if (!strcmp(cmd, "[snmp_community]")) { ! add_snmpcomm(argc, argv, 0, &fr); } else if (!strcmp(cmd, "[radio_idx]")) { + csm->radiodev[csm->ridx_slot++].idx = atoi(argv[0]); ! } else if (!strcmp(cmd, "[interface]")) { + strcpy(csm->dev[csm->ifcnt].if_name, argv[0]); strcpy(csm->dev[csm->ifcnt].if_hostname, *************** *** 220,298 **** csm->dev[csm->ifcnt].bw = atoi(argv[4]); csm->dev[csm->ifcnt++].root_id = atoi(argv[5]); ! } else if (!strcmp(cmd, "[tc_dev]")) { ! strcpy(csm->tc_dev[csm->tcifcnt].if_name, ! argv[0]); ! ! for (i = 0; i < csm->ifcnt; i++) { ! if (!strcmp ! (csm->dev[i].if_name, argv[0])) { ! csm->dev[i].bw = atoi(argv[1]); ! break; ! } ! } ! ++csm->tcifcnt; ! } else if (!strcmp(cmd, "[tc_class]")) { ! strcpy(csm->glass[csm->cscnt].name, argv[0]); ! csm->glass[csm->cscnt].bw = atoi(argv[1]); ! ! strcpy(csm->glass[csm->cscnt].if_name, argv[2]); ! for (i = 0; i < csm->tcifcnt; i++) { ! if (!strcmp ! (csm->tc_dev[i].if_name, argv[2])) { ! csm->tc_dev[i].bw += ! atoi(argv[1]); ! break; ! } ! } ! ++csm->cscnt; ! } else if (!strcmp(cmd, "[tc_filter]")) { ! strcpy(csm->filter[csm->ftcnt].name, argv[0]); ! csm->filter[csm->ftcnt].type = atoi(argv[1]); ! ! if (csm->filter[csm->ftcnt].type == ! APC_FILTER_TYPE_TOS) { ! csm->filter[csm->ftcnt].u.tos = ! atoi(argv[2]); ! } else { ! csm->filter[csm->ftcnt].u.proto.type = ! atoi(argv[2]); ! csm->filter[csm->ftcnt].u.proto.port = ! atoi(argv[3]); ! ! } ! ++csm->ftcnt; ! } else if (!strcmp(cmd, "[tc_policy]")) { ! strcpy(csm->pol[csm->polcnt].name, argv[0]); ! strcpy(csm->pol[csm->polcnt].filter_name, ! argv[1]); ! strcpy(csm->pol[csm->polcnt].class_name, ! argv[2]); ! csm->pol[csm->polcnt].mark_used = atoi(argv[3]); ! ! if (csm->pol[csm->polcnt].mark_used == USEMARK) { ! strcpy(csm->pol[csm->polcnt].mark_name, ! argv[4]); ! } ! ++csm->polcnt; } else if (!strcmp(cmd, "[host_policy]")) { ! strcpy(csm->hostpol[csm->hpolcnt].name, ! argv[0]); ! inet_pton(AF_INET, argv[1], ! &csm->hostpol[csm->hpolcnt].ip); ! csm->hostpol[csm->hpolcnt].flag = atoi(argv[2]); ! csm->hostpol[csm->hpolcnt].max_pktrate = ! atoi(argv[3]); ! ++csm->hpolcnt; } else if (!strcmp(cmd, "[auto_test]")) { ! csm->auto_test.sint_1 = atoi(argv[0]); ! csm->auto_test.sint_2 = atoi(argv[1]); ! csm->auto_test.mint_1 = atoi(argv[2]); ! csm->auto_test.mint_2 = atoi(argv[3]); ! csm->auto_test.ilevel = atoi(argv[4]); ! csm->auto_test.cnum = atoi(argv[5]); } ! } else { ! out("Found unknown config line '%s'\n", line); ! continue; } } --- 201,229 ---- csm->dev[csm->ifcnt].bw = atoi(argv[4]); csm->dev[csm->ifcnt++].root_id = atoi(argv[5]); ! ! } else if (!strcmp(cmd, "[qos_dev]")) { ! add_qos_maxbw(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[qos_class]")) { ! add_qos_class(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[qos_filter]")) { ! add_qos_filter(argc, argv, 0, &fr); ! } else if (!strcmp(cmd, "[qos_policy]")) { ! add_qos_pol(argc, argv, 0, &fr); } else if (!strcmp(cmd, "[host_policy]")) { ! add_fc_pol(argc, argv, 0, &fr); } else if (!strcmp(cmd, "[auto_test]")) { ! set_auto(argc, argv, 0, &fr); ! }else { ! out("Unknown section \"%s\"\n", tmp); } ! ! if (fr.errcnt) { ! printf("Total %d Error @%d: \"%s\"\n", fr.errcnt, lines, tmp); ! printf("%s", fr.errmsg); ! } ! free(tmp); ! }else { ! out("Unknown line \"%s\"\n", line); ! continue; } } *************** *** 307,316 **** saveconf(sm_t * csm) { - FILE *fp; - #if 0 time_t clock; ! #endif ! char fn[256]; bool backupdone = FALSE; int i; --- 238,246 ---- saveconf(sm_t * csm) { FILE *fp; time_t clock; ! char buf[MINBUF]; ! char fn[MINBUF]; ! bool backupdone = FALSE; int i; *************** *** 334,349 **** } ! fseek(fp, 0l, SEEK_SET); prenc(fp, "%s\n", CONFMAGIC); ! #if 0 prenc(fp, buf); time(&clock); prenc(fp, "# Last Updated: %s", ctime(&clock)); - #endif prenc(fp, "[%s]\t%d\n", STR_STATE, csm->state); ! prenc(fp, "[%s]\t%d\n", STR_TARGET, csm->target); ! prenc(fp, "[%s]\t%s\n", STR_AP_IP, inet_ntoa(csm->ap.addr)); ! prenc(fp, "[%s]\t%d\n", STR_AP_MASK, csm->ap.mask); prenc(fp, "[%s]\t%d\n", STR_SNMP, csm->snmp); prenc(fp, "[%s]\t%s\n", STR_COMMUNITY, csm->community); --- 264,278 ---- } ! //fseek(fp, 0l, SEEK_SET); prenc(fp, "%s\n", CONFMAGIC); ! prenc(fp, "#\n"); ! sprintf(buf, "#%s Configuration\n", SZSYSVERSION); prenc(fp, buf); time(&clock); prenc(fp, "# Last Updated: %s", ctime(&clock)); prenc(fp, "[%s]\t%d\n", STR_STATE, csm->state); ! prenc(fp, "[%s]\t%d\n", STR_TARGET_TYPE, csm->target); ! prenc(fp, "[%s]\t%s\t%d\n", STR_TARGET, inet_ntoa(csm->ap.addr), csm->ap.mask); prenc(fp, "[%s]\t%d\n", STR_SNMP, csm->snmp); prenc(fp, "[%s]\t%s\n", STR_COMMUNITY, csm->community); *************** *** 392,395 **** --- 321,325 ---- /* TC_FILTER */ for (i = 0; i < csm->ftcnt; i++) { + qos_tos_t *p; prenc(fp, "[%s]\t%s\t%d", STR_TC_FILTER, *************** *** 397,404 **** if (csm->filter[i].type == APC_FILTER_TYPE_TOS) { ! prenc(fp, "\t%d\n", csm->filter[i].u.tos); } else { ! prenc(fp, "\t%d\t%d\n", ! csm->filter[i].u.proto.type, csm->filter[i].u.proto.port); } --- 327,338 ---- if (csm->filter[i].type == APC_FILTER_TYPE_TOS) { ! for (p = tostab; p <= 0; p++ ) ! if ( p->tos == csm->filter[i].u.tos ) ! break; ! ! prenc(fp, "\t%s\n", p->name); } else { ! prenc(fp, "\t%s\t%d\n", ! csm->filter[i].u.proto.type == SYS_PROTO_TCP ? "TCP" : "UDP" , csm->filter[i].u.proto.port); } Index: confproc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwclib/confproc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** confproc.c 25 Feb 2006 22:59:00 -0000 1.4 --- confproc.c 26 Feb 2006 16:43:29 -0000 1.5 *************** *** 64,79 **** */ 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} , --- 64,73 ---- */ 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} , |
From: linuxpark <lin...@us...> - 2006-02-26 16:43:33
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28685/include Modified Files: message.h Log Message: MOD: modifiy saveconf/loadconf to be more flexible and use built-in api. renaming. Index: message.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/message.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** message.h 25 Feb 2006 22:59:00 -0000 1.3 --- message.h 26 Feb 2006 16:43:29 -0000 1.4 *************** *** 71,85 **** /* STR_ : normal STRing */ #define STR_STATE "qry_state" #define STR_TARGET "target" - #define STR_AP_IP "target_ip" - #define STR_AP_MASK "target_mask" #define STR_SNMP "snmp" #define STR_COMMUNITY "snmp_community" #define STR_RADIO_IDX "radio_idx" #define STR_INTERFACE "interface" ! #define STR_TC_DEV "tc_dev" ! #define STR_TC_CLASS "tc_class" ! #define STR_TC_FILTER "tc_filter" ! #define STR_TC_POLICY "tc_policy" #define STR_HOST_POLICY "host_policy" #define STR_AUTO_TEST "auto_test" --- 71,84 ---- /* STR_ : normal STRing */ #define STR_STATE "qry_state" + #define STR_TARGET_TYPE "target_type" #define STR_TARGET "target" #define STR_SNMP "snmp" #define STR_COMMUNITY "snmp_community" #define STR_RADIO_IDX "radio_idx" #define STR_INTERFACE "interface" ! #define STR_TC_DEV "qos_dev" ! #define STR_TC_CLASS "qos_class" ! #define STR_TC_FILTER "qos_filter" ! #define STR_TC_POLICY "qos_policy" #define STR_HOST_POLICY "host_policy" #define STR_AUTO_TEST "auto_test" |
From: linuxpark <lin...@us...> - 2006-02-25 23:41:17
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15777/include Modified Files: sysdef.h Log Message: ADD: [ step2. start to gwc-v1.0-pre3 ] finished up defining each object of "flow control" in sysdef.h fc_net_t, fc_svc_t, fc_flow_t, fc_pol_t and some enum types. Index: sysdef.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysdef.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sysdef.h 25 Feb 2006 22:59:00 -0000 1.2 --- sysdef.h 25 Feb 2006 23:41:14 -0000 1.3 *************** *** 46,49 **** --- 46,65 ---- typedef enum { + SYS_ICMP_UNREACH = 0x0001, + SYS_ICMP_ECHO = 0x0002, + SYS_ICMP_ECHOREP = 0x0004, + SYS_ICMP_SQUENCH = 0x0008, + SYS_ICMP_REDIR = 0x0010, + SYS_ICMP_TIMEX = 0x0020, + SYS_ICMP_PARAMPROB = 0x0040, + SYS_ICMP_TIMEST = 0x0080, + SYS_ICMP_TIMESTREP = 0x0100, + SYS_ICMP_INFOREQ = 0x0200, + SYS_ICMP_INFOREP = 0x0400, + SYS_ICMP_MASKREQ = 0x0800, + SYS_ICMP_MASKREP = 0x1000, + } sys_icmp_type_e; + + typedef enum { SYS_PROTO_TCP = IPPROTO_TCP, SYS_PROTO_UDP = IPPROTO_UDP, *************** *** 90,94 **** } sys_802dot11if_t; ! /* QoS object start */ typedef struct { char if_name[OL]; --- 106,110 ---- } sys_802dot11if_t; ! /* Q O S O B J E C T start */ typedef struct { char if_name[OL]; *************** *** 182,194 **** char mark_name[OL / 4]; } qos_pol_t; ! /* QoS object start */ ! ! /* F L O W C O N T R O L start */ typedef struct { ! char name[OL]; ! sys_net_type_e type; ! sys_net_t net; ! char net_if[OL]; } fc_net_t; --- 198,209 ---- char mark_name[OL / 4]; } qos_pol_t; + /* Q O S O B J E C T end */ ! /* F L O W C O N T R O L O B J E C T start */ typedef struct { ! char name[OL]; ! sys_net_type_e type; ! sys_net_t net; ! char net_if[OL]; /* reserved */ } fc_net_t; *************** *** 199,232 **** unsigned short port; unsigned short icmptype; ! } ext; } fc_svc_t; typedef struct { ! char name[OL]; ! int value; ! sys_thput_unit_e unit; } fc_flow_t; /* sys_host_pol_t/flag */ #define BLOCK_HOST 0x0001 #define MODIFY_SEQ 0x0002 #define MAX_PKTRATE 65535 - typedef struct { ! /* struct in_addr ip; */ char name[OL]; - char src_net[OL]; - char src_svc[OL]; int ip; unsigned short flag; int max_pktrate; - } sys_fc_pol_t; - typedef struct { - /* struct in_addr ip; */ - char name[OL]; - int ip; - unsigned short flag; - int max_pktrate; } sys_host_pol_t; --- 214,254 ---- unsigned short port; unsigned short icmptype; ! } u; } fc_svc_t; typedef struct { ! char name[OL]; ! int val; ! sys_thput_unit_e unit; } fc_flow_t; + typedef enum { + FC_PR_CONTROL = 1, /* flow control */ + FC_PR_MOD_HEADER = 2, /* modify packet header */ + } fc_pol_rule_e; + + typedef struct { + char name[OL]; + unsigned short enable; + char snet[OL]; + char ssvc[OL]; + char dnet[OL]; + char dsvc[OL]; + char flow[OL]; + fc_pol_rule_e rule; + } fc_pol_t; + /* F L O W C O N T R O L O B J E C T end */ + /* TODO: delete soon after completing flow control */ /* sys_host_pol_t/flag */ #define BLOCK_HOST 0x0001 #define MODIFY_SEQ 0x0002 #define MAX_PKTRATE 65535 typedef struct { ! /* struct in_addr ip; */ char name[OL]; int ip; unsigned short flag; int max_pktrate; } sys_host_pol_t; |
From: linuxpark <lin...@us...> - 2006-02-25 23:41:17
|
Update of /cvsroot/netadm/gwc/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15777/scripts Modified Files: install.sh Log Message: ADD: [ step2. start to gwc-v1.0-pre3 ] finished up defining each object of "flow control" in sysdef.h fc_net_t, fc_svc_t, fc_flow_t, fc_pol_t and some enum types. Index: install.sh =================================================================== RCS file: /cvsroot/netadm/gwc/scripts/install.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** install.sh 20 Feb 2006 18:40:48 -0000 1.9 --- install.sh 25 Feb 2006 23:41:14 -0000 1.10 *************** *** 21,25 **** CONFILE=config PROD="Netadm-gwc" ! VERSION="gwc-v0.1-pre2" INST=/usr/bin/install LOGFILE=install.log --- 21,25 ---- CONFILE=config PROD="Netadm-gwc" ! VERSION="gwc-v0.1-pre3" INST=/usr/bin/install LOGFILE=install.log |
From: linuxpark <lin...@us...> - 2006-02-25 22:59:13
|
Update of /cvsroot/netadm/gwc/gwcguid In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22273/gwcguid Modified Files: fwc.c qos.c qos.h Log Message: MOD: [ start to gwc-v1.0-pre3, not completed ] ADD: 1. command index, handler (but not main routine, just null), message for gwc-v1.0-pre3 functionalities. sysipc.h, message.h, confproc.h confproc.c, conftab.c 2. data structure for gwc-v1.0-pre3. for example, service protocol object, network object, flow object, policy object in sysdef.h but i didn't insert these object in shared memory (sysshm.h) MOD: 1. version info in global.h 2. renamed current qos concerned data structure from _tc_ to _qos_ else ADD and MOD Index: fwc.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwcguid/fwc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** fwc.c 17 Feb 2006 03:06:03 -0000 1.4 --- fwc.c 25 Feb 2006 22:58:59 -0000 1.5 *************** *** 120,124 **** int i; ! list = sysclist(CMD_LIST_HOSTPOL, NULL, &col, &row); if (row == -1) { --- 120,124 ---- int i; ! list = sysclist(CMD_LIST_FC_POL, NULL, &col, &row); if (row == -1) { *************** *** 168,172 **** // code here ! error = syscmd(CMD_ADD_HOSTPOL, gErrPktPolicy[gPolicyIndex].name, gErrPktPolicy[gPolicyIndex].ip, gErrPktPolicy[gPolicyIndex].policy, --- 168,172 ---- // code here ! error = syscmd(CMD_ADD_FC_POL, gErrPktPolicy[gPolicyIndex].name, gErrPktPolicy[gPolicyIndex].ip, gErrPktPolicy[gPolicyIndex].policy, *************** *** 197,201 **** } ! error = syscmd(CMD_DEL_HOSTPOL, delRow, EOA); if (error != NULL) { userwin( USERWIN_ERROR, error); --- 197,201 ---- } ! error = syscmd(CMD_DEL_FC_POL, delRow, EOA); if (error != NULL) { userwin( USERWIN_ERROR, error); *************** *** 216,220 **** char *error = NULL; ! error = syscmd(CMD_HOSTPOL_APPLY, EOA); if (error != NULL) { --- 216,220 ---- char *error = NULL; ! error = syscmd(CMD_FC_APPLY, EOA); if (error != NULL) { Index: qos.h =================================================================== RCS file: /cvsroot/netadm/gwc/gwcguid/qos.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** qos.h 9 Feb 2006 17:54:06 -0000 1.2 --- qos.h 25 Feb 2006 22:58:59 -0000 1.3 *************** *** 64,68 **** extern QosSize uQosSize; extern char band_interface[MAXSHM_IF][DL]; ! extern char class_interface[MAXSHM_TC_CLASS][DL]; extern char qosTos[5][MAX_CHAR_LENGTH]; extern char qosProto[2][MAX_CHAR_LENGTH]; --- 64,68 ---- extern QosSize uQosSize; extern char band_interface[MAXSHM_IF][DL]; ! extern char class_interface[MAXSHM_QOS_CLASS][DL]; extern char qosTos[5][MAX_CHAR_LENGTH]; extern char qosProto[2][MAX_CHAR_LENGTH]; Index: qos.c =================================================================== RCS file: /cvsroot/netadm/gwc/gwcguid/qos.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** qos.c 17 Feb 2006 03:06:03 -0000 1.4 --- qos.c 25 Feb 2006 22:58:59 -0000 1.5 *************** *** 35,46 **** // global variable QosBand uQosBand[MAXSHM_IF]; ! QosClass uQosClass[MAXSHM_TC_CLASS]; ! QosFilter uQosFilter[MAXSHM_TC_FILTER]; ! QosPolicy uQosPolicy[MAXSHM_TC_POL]; OpenQos uOpenQos; QosSize uQosSize; char band_interface[MAXSHM_IF][DL]; ! char class_interface[MAXSHM_TC_CLASS][DL]; char qosTos[5][MAX_CHAR_LENGTH] = { "MD", "MT", "MR", "MMC", "NS" }; char qosProto[2][MAX_CHAR_LENGTH] = { "TCP", "UDP" }; --- 35,46 ---- // global variable QosBand uQosBand[MAXSHM_IF]; ! QosClass uQosClass[MAXSHM_QOS_CLASS]; ! QosFilter uQosFilter[MAXSHM_QOS_FILTER]; ! QosPolicy uQosPolicy[MAXSHM_QOS_POL]; OpenQos uOpenQos; QosSize uQosSize; char band_interface[MAXSHM_IF][DL]; ! char class_interface[MAXSHM_QOS_CLASS][DL]; char qosTos[5][MAX_CHAR_LENGTH] = { "MD", "MT", "MR", "MMC", "NS" }; char qosProto[2][MAX_CHAR_LENGTH] = { "TCP", "UDP" }; *************** *** 111,115 **** char *error = NULL; ! error = syscmd(CMD_TC_APPLY, EOA); if (error != NULL) { --- 111,115 ---- char *error = NULL; ! error = syscmd(CMD_QOS_APPLY, EOA); if (error != NULL) { *************** *** 340,348 **** int i; ! list = sysclist(CMD_LIST_TC_MAXBW, NULL, &col, &row); if (row == -1) { userwin(USERWIN_ERROR,list[0]); ! set_item_statusbar("CMD_LIST_TC_MAXBW error"); return -1; } --- 340,348 ---- int i; ! list = sysclist(CMD_LIST_QOS_MAXBW, NULL, &col, &row); if (row == -1) { userwin(USERWIN_ERROR,list[0]); ! set_item_statusbar("CMD_LIST_QOS_MAXBW error"); return -1; } *************** *** 364,368 **** int i; ! list = sysclist(CMD_LIST_TC_MAXBW, NULL, &col, &row); if (row == -1) { --- 364,368 ---- int i; ! list = sysclist(CMD_LIST_QOS_MAXBW, NULL, &col, &row); if (row == -1) { *************** *** 390,394 **** int i; ! list = sysclist(CMD_LIST_TC_CLASS, NULL, &col, &row); if (row == -1) { --- 390,394 ---- int i; ! list = sysclist(CMD_LIST_QOS_CLASS, NULL, &col, &row); if (row == -1) { *************** *** 417,421 **** int i; ! list = sysclist(CMD_LIST_TC_FILTER, NULL, &col, &row); if (row == -1) { --- 417,421 ---- int i; ! list = sysclist(CMD_LIST_QOS_FILTER, NULL, &col, &row); if (row == -1) { *************** *** 445,449 **** int i; ! list = sysclist(CMD_LIST_TC_POL, NULL, &col, &row); if (row == -1) { --- 445,449 ---- int i; ! list = sysclist(CMD_LIST_QOS_POL, NULL, &col, &row); if (row == -1) { *************** *** 641,650 **** strcpy(strInterface, band_interface[index]); ! error = syscmd(CMD_ADD_TC_MAXBW, strInterface, strBand, EOA); if (error != NULL) { userwin(USERWIN_ERROR,error); ! set_item_statusbar("CMD_ADD_TC_MAXBW Error"); return; } --- 641,650 ---- strcpy(strInterface, band_interface[index]); ! error = syscmd(CMD_ADD_QOS_MAXBW, strInterface, strBand, EOA); if (error != NULL) { userwin(USERWIN_ERROR,error); ! set_item_statusbar("CMD_ADD_QOS_MAXBW Error"); return; } *************** *** 693,697 **** strcpy(strInterface, class_interface[index]); ! error = syscmd(CMD_ADD_TC_CLASS, strName, strBand, strInterface, EOA); if (error != NULL) { --- 693,697 ---- strcpy(strInterface, class_interface[index]); ! error = syscmd(CMD_ADD_QOS_CLASS, strName, strBand, strInterface, EOA); if (error != NULL) { *************** *** 762,769 **** if (radio == 1) { ! error = syscmd(CMD_ADD_TC_FILTER, tName, tType, tDetail, EOA); } else { error = ! syscmd(CMD_ADD_TC_FILTER, tName, tType, tDetail, tPort, EOA); } --- 762,769 ---- if (radio == 1) { ! error = syscmd(CMD_ADD_QOS_FILTER, tName, tType, tDetail, EOA); } else { error = ! syscmd(CMD_ADD_QOS_FILTER, tName, tType, tDetail, tPort, EOA); } *************** *** 856,860 **** error = ! syscmd(CMD_ADD_TC_POL, tName, tFilter, tClass, tUMark, EOA); } else if (radio == 0) { --- 856,860 ---- error = ! syscmd(CMD_ADD_QOS_POL, tName, tFilter, tClass, tUMark, EOA); } else if (radio == 0) { *************** *** 863,867 **** qosTos[comboMark]); error = ! syscmd(CMD_ADD_TC_POL, tName, tFilter, tClass, tUMark, tMark, EOA); --- 863,867 ---- qosTos[comboMark]); error = ! syscmd(CMD_ADD_QOS_POL, tName, tFilter, tClass, tUMark, tMark, EOA); *************** *** 886,890 **** { char *error = NULL; ! error = syscmd(CMD_DEL_TC_MAXBW, delBand, EOA); if (error != NULL) { userwin(USERWIN_ERROR,error); --- 886,890 ---- { char *error = NULL; ! error = syscmd(CMD_DEL_QOS_MAXBW, delBand, EOA); if (error != NULL) { userwin(USERWIN_ERROR,error); *************** *** 903,907 **** if (uQosSize.sizeClass > 0) uQosSize.sizeClass--; ! error = syscmd(CMD_DEL_TC_CLASS, delClass, EOA); if (error != NULL) { --- 903,907 ---- if (uQosSize.sizeClass > 0) uQosSize.sizeClass--; ! error = syscmd(CMD_DEL_QOS_CLASS, delClass, EOA); if (error != NULL) { *************** *** 922,926 **** if (uQosSize.sizeFilter > 0) uQosSize.sizeFilter--; ! error = syscmd(CMD_DEL_TC_FILTER, delFilter, EOA); if (error != NULL) { --- 922,926 ---- if (uQosSize.sizeFilter > 0) uQosSize.sizeFilter--; ! error = syscmd(CMD_DEL_QOS_FILTER, delFilter, EOA); if (error != NULL) { *************** *** 940,944 **** if (uQosSize.sizePolicy > 0) uQosSize.sizePolicy--; ! error = syscmd(CMD_DEL_TC_POL, delPolicy, EOA); if (error != NULL) { --- 940,944 ---- if (uQosSize.sizePolicy > 0) uQosSize.sizePolicy--; ! error = syscmd(CMD_DEL_QOS_POL, delPolicy, EOA); if (error != NULL) { |