NatType.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. namespace STUN.Enums;
  2. /// <summary>
  3. /// https://tools.ietf.org/html/rfc3489#section-5
  4. /// https://tools.ietf.org/html/rfc3489#section-10.1
  5. /// </summary>
  6. public enum NatType
  7. {
  8. /// <summary>
  9. /// Unknown
  10. /// </summary>
  11. Unknown,
  12. /// <summary>
  13. /// Server is not unsupported for testing NAT type
  14. /// </summary>
  15. UnsupportedServer,
  16. /// <summary>
  17. /// UDP is always blocked.
  18. /// </summary>
  19. UdpBlocked,
  20. /// <summary>
  21. /// No NAT, public IP, no firewall.
  22. /// </summary>
  23. OpenInternet,
  24. /// <summary>
  25. /// No NAT, public IP, but symmetric UDP firewall.
  26. /// </summary>
  27. SymmetricUdpFirewall,
  28. /// <summary>
  29. /// A full cone NAT is one where all requests from the same internal IP address and port are
  30. /// mapped to the same external IP address and port. Furthermore, any external host can send
  31. /// a packet to the internal host, by sending a packet to the mapped external address.
  32. /// </summary>
  33. FullCone,
  34. /// <summary>
  35. /// A restricted cone NAT is one where all requests from the same internal IP address and
  36. /// port are mapped to the same external IP address and port. Unlike a full cone NAT, an external
  37. /// host (with IP address X) can send a packet to the internal host only if the internal host
  38. /// had previously sent a packet to IP address X.
  39. /// </summary>
  40. RestrictedCone,
  41. /// <summary>
  42. /// A port restricted cone NAT is like a restricted cone NAT, but the restriction
  43. /// includes port numbers. Specifically, an external host can send a packet, with source IP
  44. /// address X and source port P, to the internal host only if the internal host had previously
  45. /// sent a packet to IP address X and port P.
  46. /// </summary>
  47. PortRestrictedCone,
  48. /// <summary>
  49. /// A symmetric NAT is one where all requests from the same internal IP address and port,
  50. /// to a specific destination IP address and port, are mapped to the same external IP address and
  51. /// port. If the same host sends a packet with the same source address and port, but to
  52. /// a different destination, a different mapping is used. Furthermore, only the external host that
  53. /// receives a packet can send a UDP packet back to the internal host.
  54. /// </summary>
  55. Symmetric
  56. }