Ratan Gupta | 309ac44 | 2016-12-13 20:40:06 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | namespace slp |
| 4 | { |
Ratan Gupta | 309ac44 | 2016-12-13 20:40:06 +0530 | [diff] [blame] | 5 | /** @brief SLP Version */ |
| 6 | constexpr size_t VERSION_2 = 2; |
| 7 | constexpr auto SUCCESS = 0; |
| 8 | /** @brief SLP Port */ |
| 9 | constexpr auto PORT = 427; |
| 10 | |
| 11 | constexpr auto TIMEOUT = 30; |
| 12 | /** @brief SLP service lifetime */ |
| 13 | constexpr auto LIFETIME = 5; |
| 14 | |
Andrew Geissler | eebd081 | 2024-05-24 10:05:27 -0500 | [diff] [blame] | 15 | /** @brief Largest input or output buffer allowed */ |
| 16 | constexpr size_t MAX_LEN = 255; |
| 17 | |
Ratan Gupta | 309ac44 | 2016-12-13 20:40:06 +0530 | [diff] [blame] | 18 | /** @brief Defines the constants for slp header. |
| 19 | * Size and the offsets. |
| 20 | */ |
| 21 | namespace header |
| 22 | { |
| 23 | |
| 24 | constexpr size_t SIZE_VERSION = 1; |
| 25 | constexpr size_t SIZE_LENGTH = 1; |
| 26 | constexpr size_t SIZE_FLAGS = 2; |
| 27 | constexpr size_t SIZE_EXT = 3; |
| 28 | constexpr size_t SIZE_XID = 2; |
| 29 | constexpr size_t SIZE_LANG = 2; |
| 30 | |
| 31 | constexpr size_t OFFSET_VERSION = 0; |
| 32 | constexpr size_t OFFSET_FUNCTION = 1; |
| 33 | constexpr size_t OFFSET_LENGTH = 4; |
| 34 | constexpr size_t OFFSET_FLAGS = 5; |
| 35 | constexpr size_t OFFSET_EXT = 7; |
| 36 | constexpr size_t OFFSET_XID = 10; |
| 37 | constexpr size_t OFFSET_LANG_LEN = 12; |
| 38 | constexpr size_t OFFSET_LANG = 14; |
| 39 | |
| 40 | constexpr size_t MIN_LEN = 14; |
Patrick Venture | 537ff14 | 2018-11-01 16:37:09 -0700 | [diff] [blame] | 41 | } // namespace header |
Ratan Gupta | 309ac44 | 2016-12-13 20:40:06 +0530 | [diff] [blame] | 42 | |
| 43 | /** @brief Defines the constants for slp response. |
| 44 | * Size and the offsets. |
| 45 | */ |
| 46 | |
| 47 | namespace response |
| 48 | { |
| 49 | |
| 50 | constexpr size_t SIZE_ERROR = 2; |
| 51 | constexpr size_t SIZE_SERVICE = 2; |
| 52 | constexpr size_t SIZE_URL_COUNT = 2; |
| 53 | constexpr size_t SIZE_URL_ENTRY = 6; |
| 54 | constexpr size_t SIZE_RESERVED = 1; |
| 55 | constexpr size_t SIZE_LIFETIME = 2; |
| 56 | constexpr size_t SIZE_URLLENGTH = 2; |
| 57 | constexpr size_t SIZE_AUTH = 1; |
| 58 | |
Ratan Gupta | 309ac44 | 2016-12-13 20:40:06 +0530 | [diff] [blame] | 59 | constexpr size_t OFFSET_SERVICE_LEN = 18; |
| 60 | constexpr size_t OFFSET_SERVICE = 20; |
| 61 | constexpr size_t OFFSET_URL_ENTRY = 18; |
| 62 | |
Patrick Venture | 537ff14 | 2018-11-01 16:37:09 -0700 | [diff] [blame] | 63 | } // namespace response |
Ratan Gupta | 309ac44 | 2016-12-13 20:40:06 +0530 | [diff] [blame] | 64 | |
| 65 | /** @brief Defines the constants for slp request. |
| 66 | * Size and the offsets. |
| 67 | */ |
| 68 | namespace request |
| 69 | { |
| 70 | |
| 71 | constexpr size_t MIN_SRVTYPE_LEN = 22; |
Andrew Geissler | 20bab74 | 2024-05-24 14:31:16 -0500 | [diff] [blame] | 72 | constexpr size_t MIN_SRV_LEN = 24; |
Ratan Gupta | 309ac44 | 2016-12-13 20:40:06 +0530 | [diff] [blame] | 73 | |
| 74 | constexpr size_t SIZE_PRLIST = 2; |
| 75 | constexpr size_t SIZE_NAMING = 2; |
| 76 | constexpr size_t SIZE_SCOPE = 2; |
| 77 | constexpr size_t SIZE_SERVICE_TYPE = 2; |
| 78 | constexpr size_t SIZE_PREDICATE = 2; |
| 79 | constexpr size_t SIZE_SLPI = 2; |
| 80 | |
| 81 | constexpr size_t OFFSET_PR_LEN = 16; |
| 82 | constexpr size_t OFFSET_PR = 18; |
| 83 | constexpr size_t OFFSET_SERVICE = 20; |
| 84 | |
Patrick Venture | 537ff14 | 2018-11-01 16:37:09 -0700 | [diff] [blame] | 85 | } // namespace request |
| 86 | } // namespace slp |