DESERT 3.5.1
Loading...
Searching...
No Matches
uwip-clmsg.h
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//
29
39#ifndef UWIP_CLMSG_H
40#define UWIP_CLMSG_H
41
42#include <clmessage.h>
43
44#define UWIP_CLMSG_VERBOSITY 5
45#define UWIP_CLMSG_UPD_ROUTE_VERBOSITY 2
47extern ClMessage_t UWIP_CLMSG_SEND_ADDR;
48extern ClMessage_t UWIP_CLMSG_REQ_ADDR;
49extern ClMessage_t UWIP_CLMSG_UPD_ROUTE;
50
56class UWIPClMsgReqAddr : public ClMessage
57{
58public:
59 UWIPClMsgReqAddr(int src);
61 ClMessage *copy();
62};
63
67class UWIPClMsgSendAddr : public ClMessage
68{
69public:
71 UWIPClMsgSendAddr(DestinationType dtype, int value);
73 ClMessage *copy();
74 void setAddr(nsaddr_t addr);
75 nsaddr_t getAddr();
76
77private:
78 nsaddr_t addr_;
79};
80
81class Packet;
82
88class UWIpClMsgUpdRoute : public ClMessage
89{
90public:
91 UWIpClMsgUpdRoute(Packet *p);
92
94 {
95 }
96 virtual ClMessage *copy(); // copy the message
97
98 Packet *
100 {
101 return packet;
102 }
103
104 void
105 setPacket(Packet *p)
106 {
107 packet = p;
108 }
109
110protected:
111 Packet *packet;
112};
113
114#endif // UWIP_CLMSG_H
Class that manages cross layer messages that require the IP of the node.
Definition uwip-clmsg.h:57
ClMessage * copy()
Class used to answer to UWIPClMsgReqAddr cross layer messages.
Definition uwip-clmsg.h:68
nsaddr_t getAddr()
void setAddr(nsaddr_t addr)
ClMessage * copy()
Class that manages cross layer messages that contain route updates.
Definition uwip-clmsg.h:89
Packet * getPacket()
Definition uwip-clmsg.h:99
virtual ClMessage * copy()
void setPacket(Packet *p)
Definition uwip-clmsg.h:105
virtual ~UWIpClMsgUpdRoute()
Definition uwip-clmsg.h:93