⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 winsng2.hh

📁 定向扩散路由协议
💻 HH
字号:
//// WINSng2.hh    : WINSng2 Radio Support Include File// Authors       : Fabio Silva//// Copyright (C) 2000-2002 by the University of Southern California// $Id: WINSng2.hh,v 1.9 2002/06/27 22:04:31 fabio Exp $//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License,// version 2, as published by the Free Software Foundation.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License along// with this program; if not, write to the Free Software Foundation, Inc.,// 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.////#ifndef _WINSNG2_HH_#define _WINSNG2_HH_#ifdef HAVE_CONFIG_H#include "config.h"#endif // HAVE_CONFIG_H#include <unistd.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h> #include "main/iodev.hh"#include "rf.h"#define DIFFUSION_PACKET_TYPE  60#define WINS_BROADCAST        255// Cooked device files#define WINS_RF_DEVICE_0 "/dev/rf/0/flink"#define WINS_RF_DEVICE_1 "/dev/rf/1/flink"class RFIdCacheEntry {public:  RFIdCacheEntry(int32_t diffusion_id, if_id_t radio_id, int radio_fd) :    diffusion_id_(diffusion_id), radio_id_(radio_id), radio_fd_(radio_fd)  {};  int32_t diffusion_id_;  if_id_t radio_id_;  int radio_fd_;};typedef list<RFIdCacheEntry *> RFIdCache;class WINSNG2 : public DiffusionIO {public:  WINSNG2();  DiffPacket recvPacket(int fd);  void sendPacket(DiffPacket pkt, int len, int dst);protected:  RFIdCache RfCache_;  void addCache(int fd, int32_t diffusion_id, if_id_t radio_id);  int findInCache(int32_t diffusion_id, if_id_t *radio_id);  DiffPacket assemblePacket(if_id_t radio_id, int len, DiffPacket pkt);};#endif // !_WINSNG2_HH_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -