Remote Call Framework 3.3
IpServerTransport.hpp
Go to the documentation of this file.
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2022, Delta V Software. All rights reserved.
6 // https://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 under GPL terms.
12 //
13 // Version: 3.3
14 // Contact: support <at> deltavsoft.com
15 //
16 //******************************************************************************
17 
19 
20 #ifndef INCLUDE_RCF_IPSERVERTRANSPORT_HPP
21 #define INCLUDE_RCF_IPSERVERTRANSPORT_HPP
22 
23 #include <vector>
24 
25 #include <RCF/Export.hpp>
26 #include <RCF/IpAddress.hpp>
27 #include <RCF/ThreadLibrary.hpp>
28 
29 namespace RCF {
30 
33  typedef std::pair<IpAddress, std::size_t> IpRule;
34 
36  class RCF_EXPORT IpServerTransport
37  {
38  public:
40  virtual ~IpServerTransport();
41 
42  bool isIpAllowed(const IpAddress &ip) const;
43 
45  void setAllowIps(
46  const std::vector<IpRule> &allowIps);
47 
49  void setDenyIps(
50  const std::vector<IpRule> &denyIps);
51 
53  std::vector<IpRule>
54  getAllowIps() const;
55 
57  std::vector<IpRule>
58  getDenyIps() const;
59 
61  virtual int getPort() const = 0;
62 
63  private:
64 
65  mutable ReadWriteMutex mReadWriteMutex;
66  std::vector<IpRule> mAllowedIps;
67  std::vector<IpRule> mDisallowedIps;
68  };
69 
70 } // namespace RCF
71 
72 #endif // ! INCLUDE_RCF_IPSERVERTRANSPORT_HPP
Base class for IP-based server transports. Provides IP-related functionality.
Definition: IpServerTransport.hpp:36
Definition: AmiIoHandler.hpp:23
std::pair< IpAddress, std::size_t > IpRule
Definition: IpServerTransport.hpp:33
Represents an IP address (IPv4 or IPv6).
Definition: IpAddress.hpp:66