Remote Call Framework 3.1
IpServerTransport.hpp
Go to the documentation of this file.
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2019, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 3.1
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18 
20 
21 #ifndef INCLUDE_RCF_IPSERVERTRANSPORT_HPP
22 #define INCLUDE_RCF_IPSERVERTRANSPORT_HPP
23 
24 #include <vector>
25 
26 #include <RCF/Export.hpp>
27 #include <RCF/IpAddress.hpp>
28 #include <RCF/ThreadLibrary.hpp>
29 
30 namespace RCF {
31 
34  typedef std::pair<IpAddress, std::size_t> IpRule;
35 
37  class RCF_EXPORT IpServerTransport
38  {
39  public:
41  virtual ~IpServerTransport();
42 
43  bool isIpAllowed(const IpAddress &ip) const;
44 
46  void setAllowIps(
47  const std::vector<IpRule> &allowIps);
48 
50  void setDenyIps(
51  const std::vector<IpRule> &denyIps);
52 
54  std::vector<IpRule>
55  getAllowIps() const;
56 
58  std::vector<IpRule>
59  getDenyIps() const;
60 
62  virtual int getPort() const = 0;
63 
64  private:
65 
66  mutable ReadWriteMutex mReadWriteMutex;
67  std::vector<IpRule> mAllowedIps;
68  std::vector<IpRule> mDisallowedIps;
69  };
70 
71 } // namespace RCF
72 
73 #endif // ! INCLUDE_RCF_IPSERVERTRANSPORT_HPP
Base class for IP-based server transports. Provides IP-related functionality.
Definition: IpServerTransport.hpp:37
Definition: AmiIoHandler.hpp:24
std::pair< IpAddress, std::size_t > IpRule
Definition: IpServerTransport.hpp:34
Represents an IP address (IPv4 or IPv6).
Definition: IpAddress.hpp:67