[Netadm-devel] gwc/gwclib confio.c,1.3,1.4 confproc.c,1.9,1.10 conftab.c,1.3,1.4
Status: Beta
Brought to you by:
linuxpark
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; |