SsdpConstants.cs 2.4 KB

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