DESERT 3.5.1
Loading...
Searching...
No Matches
DESERT_Framework/DESERT/data_link/uwUFetch/initlib.cpp
Go to the documentation of this file.
1//
2// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
37#include <tclcl.h>
38#include "packet.h"
39#include "uwUFetch_AUV.h"
40#include "uwUFetch_NODE.h"
41#include "uwUFetch_cmn_hdr.h"
42
50
58
62static class TRIGGERHeaderClass : public PacketHeaderClass
63{
64public:
69 : PacketHeaderClass(
70 "PacketHeader/TRIGGER_UFETCH", sizeof(hdr_TRIGGER_UFETCH))
71 {
72 this->bind();
73 bind_offset(&hdr_TRIGGER_UFETCH::offset_);
74 }
76
80static class RTSHeaderClass : public PacketHeaderClass
81{
82public:
87 : PacketHeaderClass("PacketHeader/RTS_UFETCH", sizeof(hdr_RTS_UFETCH))
88 {
89 this->bind();
90 bind_offset(&hdr_RTS_UFETCH::offset_);
91 }
93
97static class CTSHeaderClass : public PacketHeaderClass
98{
99public:
104 : PacketHeaderClass("PacketHeader/CTS_UFETCH", sizeof(hdr_CTS_UFETCH))
105 {
106 this->bind();
107 bind_offset(&hdr_CTS_UFETCH::offset_);
108 }
110
114static class BEACONHeaderClass : public PacketHeaderClass
115{
116public:
121 : PacketHeaderClass(
122 "PacketHeader/BEACON_UFETCH", sizeof(hdr_BEACON_UFETCH))
123 {
124 this->bind();
125 bind_offset(&hdr_BEACON_UFETCH::offset_);
126 }
128
132static class PROBEHeaderClass : public PacketHeaderClass
133{
134public:
139 : PacketHeaderClass(
140 "PacketHeader/PROBE_UFETCH", sizeof(hdr_PROBE_UFETCH))
141 {
142 this->bind();
143 bind_offset(&hdr_PROBE_UFETCH::offset_);
144 }
146
150static class POLLHeaderClass : public PacketHeaderClass
151{
152public:
157 : PacketHeaderClass("PacketHeader/POLL_UFETCH", sizeof(hdr_POLL_UFETCH))
158 {
159 this->bind();
160 bind_offset(&hdr_POLL_UFETCH::offset_);
161 }
163
167static class CBEACONHeaderClass : public PacketHeaderClass
168{
169public:
174 : PacketHeaderClass(
175 "PacketHeader/CBEACON_UFETCH", sizeof(hdr_CBEACON_UFETCH))
176 {
177 this->bind();
178 bind_offset(&hdr_CBEACON_UFETCH::offset_);
179 }
181
182extern EmbeddedTcl UwUFetchTclCode;
183
184extern "C" int
186{
187 PT_TRIGGER_UFETCH = p_info::addPacket("PacketHeader/TRIGGER_UFETCH");
188 PT_RTS_UFETCH = p_info::addPacket("PacketHeader/RTS_UFETCH");
189 PT_CTS_UFETCH = p_info::addPacket("PacketHeader/CTS_UFETCH");
190 PT_BEACON_UFETCH = p_info::addPacket("PacketHeader/BEACON_UFETCH");
191 PT_PROBE_UFETCH = p_info::addPacket("PacketHeader/PROBE_UFETCH");
192 PT_POLL_UFETCH = p_info::addPacket("PacketHeader/POLL_UFETCH");
193 PT_CBEACON_UFETCH = p_info::addPacket("PacketHeader/CBEACON_UFETCH");
194
195 UwUFetchTclCode.load();
196 return 0;
197}
Class that describe the header of BEACON Packet.
Class that describe the header of DATA Packet.
Class that describe the header of CTS Packet.
Class that describe the header of POLL Packet.
Class that describe the header of PROBE Packet.
Class that describe the header of RTS Packet.
Class that describe the header of TRIGGER Packet.
Content header of BEACON packet.
static int offset_
Required by the PacketHeaderManager.
Content header of CBEACON packet.
static int offset_
Required by the PacketHeaderManager.
Content header of CTS packet.
static int offset_
Required by the PacketHeaderManager.
Content header of POLL packet.
static int offset_
Required by the PacketHeaderManager.
Content header of PROBE packet.
static int offset_
Required by the PacketHeaderManager.
Content header of RTS packet.
static int offset_
Required by the PacketHeaderManager.
Content header of TRIGGER packet.
static int offset_
Required by the PacketHeaderManager.
Declaration of class that implement AUV for UFetch protocol.
Declaration of uwUFetch_NODE class.
Common structures and variables in the protocol.