nattypes.h
来自「本人收集整理的一份c/c++跨平台网络库」· C头文件 代码 · 共 36 行
H
36 行
#ifndef UTILS_BASE_NATTYPE_H_#define UTILS_BASE_NATTYPE_H_namespace utils_base {/* Identifies each type of NAT that can be simulated. */enum NATType { NAT_OPEN_CONE, NAT_ADDR_RESTRICTED, NAT_PORT_RESTRICTED, NAT_SYMMETRIC};// Implements the rules for each specific type of NAT.class NAT {public: // Determines whether this NAT uses both source and destination address when // checking whether a mapping already exists. virtual bool IsSymmetric() = 0; // Determines whether this NAT drops packets received from a different IP // the one last sent to. virtual bool FiltersIP() = 0; // Determines whether this NAT drops packets received from a different port // the one last sent to. virtual bool FiltersPort() = 0; // Returns an implementation of the given type of NAT. static NAT* Create(NATType type);};} // namespace utils_base#endif // UTILS_BASE_NATTYPE_H_
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?