Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CONF_H_
00027 #define _CONF_H_
00028
00029 #define NUM_PORTS 50
00030
00031 #include <asm/uaccess.h>
00032 #include <linux/proc_fs.h>
00033
00034
00035 typedef enum {QoS, BROADCAST, OTHER, DROP} tpTraffic;
00036
00037
00038 typedef struct {
00039 u16 number;
00040 signed char priority;
00041 tpTraffic traffic;
00042 struct proc_dir_entry *proc_entry;
00043 }tpPort;
00044
00045 typedef struct{
00046 tpPort port[NUM_PORTS];
00047 short count;
00048 }tpPortConf;
00049
00050
00051
00052 typedef struct{
00053 signed char priority;
00054 tpTraffic traffic;
00055 short count;
00056 }tpPortConfICMP;
00057
00058
00059
00060 typedef struct{
00061 tpPortConf udp_in;
00062 tpPortConf udp_out;
00063 tpPortConf tcp_in;
00064 tpPortConf tcp_out;
00065 tpPortConfICMP icmp;
00066 }tpConfig;
00067
00068 typedef enum {UDP, TCP} tpProto;
00069
00070
00071 typedef enum {FROM, TO} tpDir;
00072
00073
00077 int readConfig(tpConfig *conf);
00078
00084 int getPortConf (tpConfig *conf, tpProto proto, tpDir dir, u16 port, signed char *priority, tpTraffic *traffic);
00085
00090 int getConfICMP (tpConfig* conf, signed char *priority, tpTraffic *traffic);
00091
00092 int conf_init_proc(void);
00093 int conf_close_proc(tpConfig *conf);
00094 struct proc_dir_entry * get_proc_root(void);
00095
00096 #endif