buffer_layer.h
Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *---------------------           WMPSNIFFER          --------------------
00003  *------------------------------------------------------------------------
00004  *                                                         V7.0B  11/05/10
00005  *
00006  *
00007  *  File: buffer_layer.h
00008  *  Authors: Danilo Tardioli
00009  *  ----------------------------------------------------------------------
00010  *  Copyright (C) 2000-2012, Universidad de Zaragoza, SPAIN
00011  *
00012  *  Contact Addresses: Danilo Tardioli                   dantard@unizar.es
00013  *
00014  *  RT-WMP is free software; you can  redistribute it and/or  modify it
00015  *  under the terms of the GNU General Public License  as published by the
00016  *  Free Software Foundation;  either  version 2, or (at  your option) any
00017  *  later version.
00018  *
00019  *  RT-WMP  is distributed  in the  hope  that  it will be   useful, but
00020  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
00021  *  MERCHANTABILITY  or  FITNESS FOR A  PARTICULAR PURPOSE.    See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received  a  copy of  the  GNU General Public  License
00025  *  distributed with RT-WMP;  see file COPYING.   If not,  write to the
00026  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
00027  *  02111-1307, USA.
00028  *
00029  *  As a  special exception, if you  link this  unit  with other  files to
00030  *  produce an   executable,   this unit  does  not  by  itself cause  the
00031  *  resulting executable to be covered by the  GNU General Public License.
00032  *  This exception does  not however invalidate  any other reasons why the
00033  *  executable file might be covered by the GNU Public License.
00034  *
00035  *----------------------------------------------------------------------*/
00036 
00037 #ifndef BUFFER_LAYER_H_
00038 #define BUFFER_LAYER_H_
00039 
00040 #include <set>
00041 #include <map>
00042 #include "basic_io.h"
00043 
00044 #define QUEUE_LEN                       250
00045 #define SYNC_SAMPLE_LEN         250
00046 
00047 struct ts_key_t{
00048         unsigned int key;
00049         unsigned long long ts;
00050         int elem;
00051 };
00052 
00053 struct base_time_t{
00054         int count;
00055         long long time_us;
00056 };
00057 
00058 struct frame_t{
00059         bool rxd;
00060         unsigned long long time_us;
00061 };
00062 
00063 struct  robo_pose_t {
00064         bool reached;
00065         bool pose_is_valid;
00066         double x,y,a;
00067 };
00068 
00069 struct  remote_data_t {
00070         int size;
00071         int source;
00072         unsigned long long time;
00073         int pose_is_valid;
00074         double x,y,a;
00075         int type;
00076 };
00077 
00078 
00079 
00080 struct pac {
00081         simData_Hdr sdh;
00082         unsigned long long time_us;
00083         char data[2500];
00084         int size,data_source;
00085         std::set<int> reached;
00086         std::map<int,robo_pose_t> poses;
00087 };
00088 
00089 struct sniff_func_t {
00090         int (*sniff_func)(char * data, simData_Hdr & sd,
00091                         unsigned long long &time_us, std::map<int, robo_pose_t> & poses);
00092         bool predominant;
00093         int id;
00094 };
00095 
00096 enum sniff_type_t {
00097         ST_PCAP, ST_SOCKET, ST_MARTE, ST_FILE, ST_SIM, ST_SHARED_MEM
00098 };
00099 
00100 enum sniff_pkt_type_t {
00101         SP_MARTE_WMP_FRAME,SP_LKS_WMP_FRAME,SP_LUS_WMP_FRAME, SP_FOREIGN, SP_LUS_WMP_FRAME_DUP
00102 };
00103 
00104 int buffer_layer_init(int _st, int nnodes, char * iface);
00105 int buffer_layer_sniff_packet(char * data, simData_Hdr & sdh,
00106                 unsigned long long & time_us, std::set<int> & reached, std::map<int,robo_pose_t> & poses);
00107 void buffer_layer_stop();
00108 void buffer_layer_clear();
00109 void buffer_layer_activate(bool activate);
00110 #endif /* BUFFER_LAYER_H_ */


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