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 | |
| 15 | /** @brief Defines the constants for slp header. |
| 16 | * Size and the offsets. |
| 17 | */ |
| 18 | namespace header |
| 19 | { |
| 20 | |
| 21 | constexpr size_t SIZE_VERSION = 1; |
| 22 | constexpr size_t SIZE_LENGTH = 1; |
| 23 | constexpr size_t SIZE_FLAGS = 2; |
| 24 | constexpr size_t SIZE_EXT = 3; |
| 25 | constexpr size_t SIZE_XID = 2; |
| 26 | constexpr size_t SIZE_LANG = 2; |
| 27 | |
| 28 | constexpr size_t OFFSET_VERSION = 0; |
| 29 | constexpr size_t OFFSET_FUNCTION = 1; |
| 30 | constexpr size_t OFFSET_LENGTH = 4; |
| 31 | constexpr size_t OFFSET_FLAGS = 5; |
| 32 | constexpr size_t OFFSET_EXT = 7; |
| 33 | constexpr size_t OFFSET_XID = 10; |
| 34 | constexpr size_t OFFSET_LANG_LEN = 12; |
| 35 | constexpr size_t OFFSET_LANG = 14; |
| 36 | |
| 37 | constexpr size_t MIN_LEN = 14; |
| 38 | }//namespace header |
| 39 | |
| 40 | /** @brief Defines the constants for slp response. |
| 41 | * Size and the offsets. |
| 42 | */ |
| 43 | |
| 44 | namespace response |
| 45 | { |
| 46 | |
| 47 | constexpr size_t SIZE_ERROR = 2; |
| 48 | constexpr size_t SIZE_SERVICE = 2; |
| 49 | constexpr size_t SIZE_URL_COUNT = 2; |
| 50 | constexpr size_t SIZE_URL_ENTRY = 6; |
| 51 | constexpr size_t SIZE_RESERVED = 1; |
| 52 | constexpr size_t SIZE_LIFETIME = 2; |
| 53 | constexpr size_t SIZE_URLLENGTH = 2; |
| 54 | constexpr size_t SIZE_AUTH = 1; |
| 55 | |
| 56 | constexpr size_t OFFSET_ERROR = 16; |
| 57 | constexpr size_t OFFSET_SERVICE_LEN = 18; |
| 58 | constexpr size_t OFFSET_SERVICE = 20; |
| 59 | constexpr size_t OFFSET_URL_ENTRY = 18; |
| 60 | |
| 61 | }//namespace response |
| 62 | |
| 63 | /** @brief Defines the constants for slp request. |
| 64 | * Size and the offsets. |
| 65 | */ |
| 66 | namespace request |
| 67 | { |
| 68 | |
| 69 | constexpr size_t MIN_SRVTYPE_LEN = 22; |
| 70 | constexpr size_t MIN_SRV_LEN = 26; |
| 71 | |
| 72 | constexpr size_t SIZE_PRLIST = 2; |
| 73 | constexpr size_t SIZE_NAMING = 2; |
| 74 | constexpr size_t SIZE_SCOPE = 2; |
| 75 | constexpr size_t SIZE_SERVICE_TYPE = 2; |
| 76 | constexpr size_t SIZE_PREDICATE = 2; |
| 77 | constexpr size_t SIZE_SLPI = 2; |
| 78 | |
| 79 | constexpr size_t OFFSET_PR_LEN = 16; |
| 80 | constexpr size_t OFFSET_PR = 18; |
| 81 | constexpr size_t OFFSET_SERVICE = 20; |
| 82 | |
| 83 | }//namespace request |
| 84 | }//namespace slp |