ioctl_interface.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *--------------------------- RT-WMP IP INTERFACE -------------------------
00003  *-------------------------------------------------------------------------
00004  *
00005  * File: ioctl_interface.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 _PASARELA_INTERFACE_H_
00027 #define _PASARELA_INTERFACE_H_
00028 
00029 #include <linux/if.h>
00030 #include "core/interface/Msg.h"
00031 
00032 /* Private ioctl's */
00033 #define SIO_TRANSMISSION         (SIOCDEVPRIVATE + 0)
00034 #define SIO_NODEINFO             (SIOCDEVPRIVATE + 1)
00035 #define SIO_GETLATESTLQM         (SIOCDEVPRIVATE + 2)
00036 #define SIO_NETWORKCONNECTED     (SIOCDEVPRIVATE + 3)
00037 #define SIO_QUEUEACTIONS         (SIOCDEVPRIVATE + 4)
00038 #define SIO_QUEUEELEMSINFO       (SIOCDEVPRIVATE + 5)
00039 #define SIO_RTWMPSETGET          (SIOCDEVPRIVATE + 6)
00040 #define SIO_RTWMPPLUGIN          (SIOCDEVPRIVATE + 7)
00041 #define SIO_GETLATESTDISTANCES  (SIOCDEVPRIVATE + 8)
00042 
00043 /* Data to use with SIO_TRANSMISION */
00044 typedef enum {PUSH, PUSH_DATA, POP_DATA,POP_DATA_TIMEOUT, POP, TIMEDPOP, NONBLOCKINGPOP} tpTransmission;
00045 typedef struct {
00046    tpTransmission type;
00047    Msg *m;
00048    unsigned int port;
00049    unsigned int dest;
00050    unsigned char source;
00051    unsigned int size;
00052    char priority;
00053    int timeout_ms;            // Only for TIMEDPOP
00054    int ret;
00055    char * data;
00056 } tpTransmissionInfo;
00057 
00058 /* Data to use with SIO_NODEINFO */
00059 typedef enum {NODEID, NUMOFNODES} tpNodeI;
00060 typedef struct {
00061    tpNodeI type;
00062    char ret;
00063 } tpNodeInfo;
00064 
00065 /* Data to use with SIO_NETWORKCONNECTED */
00066 typedef enum {BLOCKING, NONBLOCKING} tpNetworkConnected;
00067 typedef struct {
00068    tpNetworkConnected type;
00069    int timeout;               // Only for BLOCKING 
00070    int ret;
00071 } tpNetworkConnectedInfo;
00072 
00073 /* Data to use with SIO_QUEUEACTIONS */
00074 // THE ORDER OF THE ELEMENTS IN THIS ENUM IS IMPORTANT
00075 typedef enum { REMOVETXMSG, GETCPUDELAY, GETTIMEOUT, GETWCMULT, GETRATE,
00076                SETCPUDELAY, SETTIMEOUT, SETWCMULT, SETRATE} tpQueueAction;
00077 typedef struct {
00078    tpQueueAction queueAction;
00079    int ival;                  // For CPUDELAY and TIMEOUT
00080    int fval;                // For WCMULT and RATE
00081    int ret;                   // For REMOVETXMSG
00082 } tpQueueActionInfo;
00083 
00084 /* Data to use with SIO_QUEUEELEMSINFO */
00085 typedef enum {NUMOFFREEPOSITIONSTX, NUMOFELEMSTX, NUMOFELEMSRX} tpGetQueueElems;
00086 typedef struct {
00087    tpGetQueueElems type;
00088    int ret;
00089 } tpGetQueueElemsInfo;
00090 
00091 /* Data to use with SIO_RTWMPSETGET */
00092 // THE ORDER OF THE ELEMENTS IN THIS ENUM IS IMPORTANT
00093 typedef enum { NETIT, GETMTU, GETAS, SERIAL, LOOPID, GINSTANCEID,
00094                GPRIMBASEDROUTING, GMESSAGERESCHEDULE, GFLOWCONTROL, SETAS,
00095                SINSTANCEID, SPRIMBASEDROUTING, SMESSAGERESCHEDULE, SFLOWCONTROL} tpRTWMPSetGet;
00096 typedef struct {
00097    tpRTWMPSetGet type;
00098    union {
00099       int netIT;
00100       unsigned int mtu;
00101       int activeSearch;
00102       unsigned int serial;
00103       unsigned int loopId;
00104       short instanceId;
00105       int primBasedRouting;
00106       int messageReschedule;
00107       int flowControl;
00108    };
00109 } tpRTWMPSetGetInfo;
00110 
00111 /* Data to use with SIO_RTWMPPLUGIN */
00112 typedef enum {QOS, BC_PLUS} tpPlugin;
00113 
00114 /* Data to use with SIO_BROADCAST */
00115 typedef enum {PUSHBC, POPBC, TIMEDPOPBC, ELEMSINRXBC, ELEMSINTXBC, FREEPOSINTXBC} tpBCAcc;
00116 typedef struct {
00117    tpBCAcc type;
00118    Msg *m;
00119    int timeout_ms;            // Only for TIMEDPOPBC
00120    int ret;
00121 } tpBCInfo;
00122 
00123 /* Data to use with SIO_QOS */
00124 typedef enum {PUSHQOS, POPQOS, TIMEDPOPQOS, FREEPOSQOS} tpQoSAcc;
00125 typedef struct {
00126    tpQoSAcc type;
00127    Msg *m;
00128    int timeout_ms;            // Only for TIMEDPOPQOS
00129    int ret;
00130 } tpQoSInfo;
00131 
00132 /* Union passed as data when calling to ioctl() */
00133 typedef union {
00134    tpTransmissionInfo transmissionInfo;
00135    tpNodeInfo nodeInfo;
00136    char *lqm;
00137    tpNetworkConnectedInfo networkConnected;
00138    tpQueueActionInfo queueAction;
00139    tpGetQueueElemsInfo queueElemsInfo;
00140    tpRTWMPSetGetInfo RTWMPSetGetInfo;
00141    tpPlugin RTWMPplugin;
00142 
00143    tpBCInfo BCInfo;
00144    tpQoSInfo QoSInfo;
00145 } tpIOCTL_data;
00146 
00147 #endif


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