SsdpConstants.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. namespace Rssdp.Infrastructure
  2. {
  3. /// <summary>
  4. /// Provides constants for common values related to the SSDP protocols.
  5. /// </summary>
  6. public static class SsdpConstants
  7. {
  8. /// <summary>
  9. /// Multicast IP Address used for SSDP multicast messages. Values is 239.255.255.250.
  10. /// </summary>
  11. public const string MulticastLocalAdminAddress = "239.255.255.250";
  12. /// <summary>
  13. /// The UDP port used for SSDP multicast messages. Values is 1900.
  14. /// </summary>
  15. public const int MulticastPort = 1900;
  16. /// <summary>
  17. /// The default multicase TTL for SSDP multicast messages. Value is 4.
  18. /// </summary>
  19. public const int SsdpDefaultMulticastTimeToLive = 4;
  20. internal const string MSearchMethod = "M-SEARCH";
  21. internal const string SsdpDiscoverMessage = "ssdp:discover";
  22. internal const string SsdpDiscoverAllSTHeader = "ssdp:all";
  23. internal const string SsdpDeviceDescriptionXmlNamespace = "urn:schemas-upnp-org:device-1-0";
  24. /// <summary>
  25. /// Default buffer size for receiving SSDP broadcasts. Value is 8192 (bytes).
  26. /// </summary>
  27. public const int DefaultUdpSocketBufferSize = 8192;
  28. /// <summary>
  29. /// The maximum possible buffer size for a UDP message. Value is 65507 (bytes).
  30. /// </summary>
  31. public const int MaxUdpSocketBufferSize = 65507; // Max possible UDP packet size on IPv4 without using 'jumbograms'.
  32. /// <summary>
  33. /// Namespace/prefix for UPnP device types. Values is schemas-upnp-org.
  34. /// </summary>
  35. public const string UpnpDeviceTypeNamespace = "schemas-upnp-org";
  36. /// <summary>
  37. /// UPnP Root Device type. Value is upnp:rootdevice.
  38. /// </summary>
  39. public const string UpnpDeviceTypeRootDevice = "upnp:rootdevice";
  40. /// <summary>
  41. /// The value is used by Windows Explorer for device searches instead of the UPNPDeviceTypeRootDevice constant.
  42. /// Not sure why (different spec, bug, alternate protocol etc). Used to enable Windows Explorer support.
  43. /// </summary>
  44. public const string PnpDeviceTypeRootDevice = "pnp:rootdevice";
  45. /// <summary>
  46. /// UPnP Basic Device type. Value is Basic.
  47. /// </summary>
  48. public const string UpnpDeviceTypeBasicDevice = "Basic";
  49. internal const string SsdpKeepAliveNotification = "ssdp:alive";
  50. internal const string SsdpByeByeNotification = "ssdp:byebye";
  51. internal const int UdpResendCount = 3;
  52. }
  53. }