conf.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *--------------------------- RT-WMP IP INTERFACE -------------------------
00003  *-------------------------------------------------------------------------
00004  *
00005  * File: conf.h
00006  * Authors: Rubén Durán
00007  *          Danilo Tardioli
00008  *-------------------------------------------------------------------------
00009  *  Copyright (C) 2011, Universidad de Zaragoza, SPAIN
00010  *
00011  *  This program is free software: you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation, either version 3 of the License, or
00014  *  (at your option) any later version.
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU General Public License for more details.
00020  *
00021  *  You should have received a copy of the GNU General Public License
00022  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
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 /* Type of the message to be sent */
00035 typedef enum {QoS, BROADCAST, OTHER, DROP} tpTraffic;
00036 
00037 /* Generic configuration structure */
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 /* Structure for ICMP configuration
00051    ICMP has no port, so there is just one configuration */
00052 typedef struct{
00053    signed char        priority;
00054    tpTraffic   traffic;
00055    short       count;
00056 }tpPortConfICMP;
00057 
00058 
00059 /* Global configuration structure */
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 /* Internal or external port */
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


ros_rt_wmp
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:09