[Netadm-devel] gwc/include confutil.h,1.2,1.3 sysdef.h,1.6,1.7 sysioctl.h,1.3,1.4 sysshm.h,1.6,1.7 s
Status: Beta
Brought to you by:
linuxpark
From: linuxpark <lin...@us...> - 2006-03-05 01:11:05
|
Update of /cvsroot/netadm/gwc/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2507/include Modified Files: confutil.h sysdef.h sysioctl.h sysshm.h sysutil.h Log Message: ADD: <flow control concerned> from now, pf temporary will be not compiled properly. because between user data structure and pf are different. This will be updated in one or two days later. sorry. i will upload new presentation file which illustrate what has been happen since starting gwc-v0.1-pre3 development. 2006. 2.15 ADD1: add_fc_pol, del_fc_pol, list_fc_pol these files will be modified again. and updated todays. ADD2: _get_fc_net ~ _dmp_fc_ipol about 8 function. and it's map data struct. these functoin can be accessed by sys_ucmd_msg. ADD3: sys_ucmd_msg : this function exported library function about ADD2. this function is somewhat useful to access a specified object in system config (shared memory). ADD4: runpol_list list : This list was made for supporting extended address for example, if user enter network hostinfo(not subnet) in flow control as like 192.168.1.1-100, then the real packet filter policy extend it's real address 192.168.1.1, 192.168.1.2 ... so runpol_list is for this extending IP address of network object but this data structure will be updated by gwcadmd at not the moment "apply flow control rule" but the moment whenever user enter one policy. MOD: kuio_msg_t in include/sysioctl.h All of updating to gwc-v0.1-pre3 may be completed in about one week. jeho park Index: confutil.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/confutil.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** confutil.h 28 Feb 2006 23:41:50 -0000 1.2 --- confutil.h 5 Mar 2006 01:11:00 -0000 1.3 *************** *** 14,24 **** /* 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 { --- 14,28 ---- /* U T I L F U N C I D X */ typedef enum { ! _CMD_GET_FC_NET = 0, /* get fc net pointer in the shared memory by name*/ ! _CMD_GET_FC_SVC, /* get fc svc pointer in the shared memory by name*/ ! _CMD_GET_FC_FW, /* get fc fw pointer in the shared memory by name*/ ! _CMD_GET_FC_POL, /* get fc fw pointer in the shared memory by name*/ ! _CMD_MOD_FC_IPOL, /* modify one internal fc policy (runpol_list) */ ! _CMD_ADD_FC_IPOL, /* insert one internal fc policy (runpol_list) */ ! _CMD_DEL_FC_IPOL, /* delete one internal fc policy */ ! _CMD_DMP_FC_IPOL, /* dump all internal fc policies to stout */ } sys_ucmd_e; ! typedef void* (*ucmdcallback_t) (void *arg, int len, frp_t fr); typedef struct { *************** *** 30,37 **** * 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 --- 34,45 ---- * these functions will be call by sys_ucmd_msg with it's cmd (index) */ ! void * _get_fc_net (void *arg, int len, frp_t fr); ! void * _get_fc_svc (void *arg, int len, frp_t fr); ! void * _get_fc_fw (void *arg, int len, frp_t fr); ! void * _get_fc_pol (void *arg, int len, frp_t fr); ! void * _mod_fc_ipol (void *arg, int len, frp_t fr); ! void * _add_fc_ipol (void *arg, int len, frp_t fr); ! void * _del_fc_ipol (void *arg, int len, frp_t fr); ! void * _dmp_fc_ipol (void *arg, int len, frp_t fr); /* sys_ucmd_msg *************** *** 40,44 **** * @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); --- 48,52 ---- * @len : sizeof arg */ ! void * sys_ucmd_msg (sys_ucmd_e cmd, void *arg, int len, frp_t fr); fr_t *ipc_msg(sys_cmd_e cmd, void *p, unsigned short plen, int argc); Index: sysshm.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysshm.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sysshm.h 28 Feb 2006 23:41:50 -0000 1.6 --- sysshm.h 5 Mar 2006 01:11:00 -0000 1.7 *************** *** 9,15 **** #ident "@(#) $Header$" - #include "sysdef.h" #ifndef __SYS_SHM_INCLUDED #define __SYS_SHM_INCLUDED #define APCSHMID 0x94376329 --- 9,16 ---- #ident "@(#) $Header$" #ifndef __SYS_SHM_INCLUDED #define __SYS_SHM_INCLUDED + #include "sysdef.h" + #include "linklist.h" #define APCSHMID 0x94376329 *************** *** 78,81 **** --- 79,83 ---- int fc_pol_cnt; fc_pol_t fc_pol [MAXSHM_FC_POL]; + list fc_ipol_list; /* pointer of running fc polic list */ /* TODO: delete this after finishing up FC */ Index: sysutil.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysutil.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sysutil.h 30 Jan 2006 17:41:29 -0000 1.1.1.1 --- sysutil.h 5 Mar 2006 01:11:00 -0000 1.2 *************** *** 185,188 **** --- 185,189 ---- void get_sigpw_max(int idx, int *cck, int *ofdm, int *client); void set_power(int idx, int pw_index, int val, frp_t fr); + int parse_iprange (const char *ip, unsigned char *parsed, frp_t fr); #endif /* __SYSUTIL_H */ Index: sysioctl.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysioctl.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sysioctl.h 28 Feb 2006 00:52:07 -0000 1.3 --- sysioctl.h 5 Mar 2006 01:11:00 -0000 1.4 *************** *** 14,20 **** #define IOCTLPF_MAGIC 't' typedef struct { ! __u32 ip; ! __u32 max_pktrate; } __attribute__ ((packed)) kuio_msg_t; --- 14,36 ---- #define IOCTLPF_MAGIC 't' + #ifndef OL + #define OL 16 + #endif + #include <linux/types.h> + typedef struct { ! char indev[OL]; /* name of input interface */ ! __u8 protocol; /* hash resource: OSI 3 layer protocl { TCP | UDP | ICMP } */ ! __u8 rule; /* flow control or modify header : mh will be deleted later */ ! __u32 saddr; /* hash resource: source IP address */ ! __u16 smask; /* hash resource: source netmask */ ! __u16 sport; /* destination port or icmptype */ ! ! __u32 daddr; /* hash resource: destination IP address */ ! __u16 dmask; /* hash resource: destination netmask */ ! __u16 dport; /* destination port or icmptype */ ! ! __u32 quota; /* maximum alloted data quota (unit: byte) */ ! } __attribute__ ((packed)) kuio_msg_t; Index: sysdef.h =================================================================== RCS file: /cvsroot/netadm/gwc/include/sysdef.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sysdef.h 1 Mar 2006 03:20:20 -0000 1.6 --- sysdef.h 5 Mar 2006 01:11:00 -0000 1.7 *************** *** 201,208 **** /* 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; --- 201,210 ---- /* 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; ! char addr[OL*2]; /* normal IP or ranged IP */ ! unsigned short mask; char net_if[OL]; /* reserved */ } fc_net_t; *************** *** 217,229 **** } fc_svc_t; typedef struct { char name[OL]; ! int val; sys_thput_unit_e unit; } fc_fw_t; typedef enum { ! FC_PR_CONTROL = 1, /* flow control */ ! FC_PR_MOD_HEADER = 2, /* modify packet header */ } fc_pol_rule_e; --- 219,234 ---- } fc_svc_t; + #define MINDEF_FW_VAL 8 + #define MAXDEF_FW_VAL 1024 * 1024 * 999 + typedef struct { char name[OL]; ! int quota; sys_thput_unit_e unit; } fc_fw_t; typedef enum { ! FC_PR_CONTROL = 0x01, /* flow control */ ! FC_PR_MOD_HEADER = 0x02, /* modify packet header */ } fc_pol_rule_e; *************** *** 238,241 **** --- 243,259 ---- fc_pol_rule_e rule; } fc_pol_t; + + /* + * fc_umsg_t struct will be accessed only by runpol_list + * runpol_list is initialized by gwcadmd + * and + * be accessed globaly. + */ + #include "sysioctl.h" + typedef struct { + char polname[OL]; /* same as policy name of fc */ + kuio_msg_t msg; /* msg which will be go to pf */ + } fc_umsg_t; + /* F L O W C O N T R O L O B J E C T end */ |