nidas  v1.2-1520
Inet4PacketInfo.h
Go to the documentation of this file.
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2 // vim: set shiftwidth=4 softtabstop=4 expandtab:
3 /*
4  ********************************************************************
5  ** NIDAS: NCAR In-situ Data Acquistion Software
6  **
7  ** 2009, Copyright University Corporation for Atmospheric Research
8  **
9  ** This program is free software; you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation; either version 2 of the License, or
12  ** (at your option) any later version.
13  **
14  ** This program is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** The LICENSE.txt file accompanying this software contains
20  ** a copy of the GNU General Public License. If it is not found,
21  ** write to the Free Software Foundation, Inc.,
22  ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  **
24  ********************************************************************
25 */
26 
27 #ifndef NIDAS_UTIL_INET4PACKETINFO_H
28 #define NIDAS_UTIL_INET4PACKETINFO_H
29 
30 #include "Inet4NetworkInterface.h"
31 #include "Inet4SocketAddress.h"
32 
33 namespace nidas { namespace util {
34 
40 {
41 public:
43  _localaddr(), _destaddr(), _iface(), _flags(0)
44  {
45  }
46 
47  virtual ~Inet4PacketInfo() {}
48 
54  virtual Inet4Address getLocalAddress() const { return _localaddr; }
55 
56  virtual void setLocalAddress(const Inet4Address& val) { _localaddr = val; }
57 
63  virtual const Inet4Address& getDestinationAddress() const { return _destaddr; }
64 
65  virtual void setDestinationAddress(const Inet4Address& val) { _destaddr = val; }
66 
70  virtual const Inet4NetworkInterface& getInterface() const { return _iface; }
71 
72  virtual void setInterface(const Inet4NetworkInterface& val ) { _iface = val; }
73 
78  virtual int getFlags() const { return _flags; }
79 
80  virtual void setFlags(int val) { _flags = val; }
81 
82 private:
84 
86 
88 
89  int _flags;
90 };
91 
93 {
94 public:
96 
103 
105 
106 private:
108 };
109 
110 }} // namespace nidas namespace util
111 
112 #endif
virtual void setFlags(int val)
Definition: Inet4PacketInfo.h:80
Inet4PacketInfo()
Definition: Inet4PacketInfo.h:42
virtual Inet4Address getLocalAddress() const
The local address of the packet.
Definition: Inet4PacketInfo.h:54
void setRemoteSocketAddress(const Inet4SocketAddress &val)
Definition: Inet4PacketInfo.h:104
Inet4SocketAddress _remotesaddr
Definition: Inet4PacketInfo.h:107
virtual ~Inet4PacketInfo()
Definition: Inet4PacketInfo.h:47
A IP version 4 socket address, containing a host address, and a port number.
Definition: Inet4SocketAddress.h:41
virtual void setLocalAddress(const Inet4Address &val)
Definition: Inet4PacketInfo.h:56
virtual const Inet4Address & getDestinationAddress() const
The destination address of the packet.
Definition: Inet4PacketInfo.h:63
Definition: Inet4PacketInfo.h:92
virtual int getFlags() const
The flags on the received packet.
Definition: Inet4PacketInfo.h:78
Inet4PacketInfoX()
Definition: Inet4PacketInfo.h:95
Inet4Address _destaddr
Definition: Inet4PacketInfo.h:85
virtual const Inet4NetworkInterface & getInterface() const
The interface that the packet was received on.
Definition: Inet4PacketInfo.h:70
Definition: Inet4NetworkInterface.h:35
virtual void setInterface(const Inet4NetworkInterface &val)
Definition: Inet4PacketInfo.h:72
Inet4NetworkInterface _iface
Definition: Inet4PacketInfo.h:87
Inet4SocketAddress getRemoteSocketAddress() const
The remote address of the packet.
Definition: Inet4PacketInfo.h:102
Ancillary information that can be determined about an incoming UDP packet.
Definition: Inet4PacketInfo.h:39
Inet4Address _localaddr
Definition: Inet4PacketInfo.h:83
virtual void setDestinationAddress(const Inet4Address &val)
Definition: Inet4PacketInfo.h:65
Support for IP version 4 host address.
Definition: Inet4Address.h:46
int _flags
Definition: Inet4PacketInfo.h:89