blob: 0cebfdf325722f9bc055b7114c047b4c115dec9f [file] [log] [blame]
Ratan Gupta309ac442016-12-13 20:40:06 +05301#pragma once
2
3namespace slp
4{
Ratan Gupta309ac442016-12-13 20:40:06 +05305/** @brief SLP Version */
6constexpr size_t VERSION_2 = 2;
7constexpr auto SUCCESS = 0;
8/** @brief SLP Port */
9constexpr auto PORT = 427;
10
11constexpr auto TIMEOUT = 30;
12/** @brief SLP service lifetime */
13constexpr auto LIFETIME = 5;
14
15/** @brief Defines the constants for slp header.
16 * Size and the offsets.
17 */
18namespace header
19{
20
21constexpr size_t SIZE_VERSION = 1;
22constexpr size_t SIZE_LENGTH = 1;
23constexpr size_t SIZE_FLAGS = 2;
24constexpr size_t SIZE_EXT = 3;
25constexpr size_t SIZE_XID = 2;
26constexpr size_t SIZE_LANG = 2;
27
28constexpr size_t OFFSET_VERSION = 0;
29constexpr size_t OFFSET_FUNCTION = 1;
30constexpr size_t OFFSET_LENGTH = 4;
31constexpr size_t OFFSET_FLAGS = 5;
32constexpr size_t OFFSET_EXT = 7;
33constexpr size_t OFFSET_XID = 10;
34constexpr size_t OFFSET_LANG_LEN = 12;
35constexpr size_t OFFSET_LANG = 14;
36
37constexpr size_t MIN_LEN = 14;
38}//namespace header
39
40/** @brief Defines the constants for slp response.
41 * Size and the offsets.
42 */
43
44namespace response
45{
46
47constexpr size_t SIZE_ERROR = 2;
48constexpr size_t SIZE_SERVICE = 2;
49constexpr size_t SIZE_URL_COUNT = 2;
50constexpr size_t SIZE_URL_ENTRY = 6;
51constexpr size_t SIZE_RESERVED = 1;
52constexpr size_t SIZE_LIFETIME = 2;
53constexpr size_t SIZE_URLLENGTH = 2;
54constexpr size_t SIZE_AUTH = 1;
55
56constexpr size_t OFFSET_ERROR = 16;
57constexpr size_t OFFSET_SERVICE_LEN = 18;
58constexpr size_t OFFSET_SERVICE = 20;
59constexpr 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 */
66namespace request
67{
68
69constexpr size_t MIN_SRVTYPE_LEN = 22;
70constexpr size_t MIN_SRV_LEN = 26;
71
72constexpr size_t SIZE_PRLIST = 2;
73constexpr size_t SIZE_NAMING = 2;
74constexpr size_t SIZE_SCOPE = 2;
75constexpr size_t SIZE_SERVICE_TYPE = 2;
76constexpr size_t SIZE_PREDICATE = 2;
77constexpr size_t SIZE_SLPI = 2;
78
79constexpr size_t OFFSET_PR_LEN = 16;
80constexpr size_t OFFSET_PR = 18;
81constexpr size_t OFFSET_SERVICE = 20;
82
83}//namespace request
84}//namespace slp