blob: 5861970d744ff70f3cb78f3fd61d9c391e041250 [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
Andrew Geisslereebd0812024-05-24 10:05:27 -050015/** @brief Largest input or output buffer allowed */
16constexpr size_t MAX_LEN = 255;
17
Ratan Gupta309ac442016-12-13 20:40:06 +053018/** @brief Defines the constants for slp header.
19 * Size and the offsets.
20 */
21namespace header
22{
23
24constexpr size_t SIZE_VERSION = 1;
25constexpr size_t SIZE_LENGTH = 1;
26constexpr size_t SIZE_FLAGS = 2;
27constexpr size_t SIZE_EXT = 3;
28constexpr size_t SIZE_XID = 2;
29constexpr size_t SIZE_LANG = 2;
30
31constexpr size_t OFFSET_VERSION = 0;
32constexpr size_t OFFSET_FUNCTION = 1;
33constexpr size_t OFFSET_LENGTH = 4;
34constexpr size_t OFFSET_FLAGS = 5;
35constexpr size_t OFFSET_EXT = 7;
36constexpr size_t OFFSET_XID = 10;
37constexpr size_t OFFSET_LANG_LEN = 12;
38constexpr size_t OFFSET_LANG = 14;
39
40constexpr size_t MIN_LEN = 14;
Patrick Venture537ff142018-11-01 16:37:09 -070041} // namespace header
Ratan Gupta309ac442016-12-13 20:40:06 +053042
43/** @brief Defines the constants for slp response.
44 * Size and the offsets.
45 */
46
47namespace response
48{
49
50constexpr size_t SIZE_ERROR = 2;
51constexpr size_t SIZE_SERVICE = 2;
52constexpr size_t SIZE_URL_COUNT = 2;
53constexpr size_t SIZE_URL_ENTRY = 6;
54constexpr size_t SIZE_RESERVED = 1;
55constexpr size_t SIZE_LIFETIME = 2;
56constexpr size_t SIZE_URLLENGTH = 2;
57constexpr size_t SIZE_AUTH = 1;
58
Ratan Gupta309ac442016-12-13 20:40:06 +053059constexpr size_t OFFSET_SERVICE_LEN = 18;
60constexpr size_t OFFSET_SERVICE = 20;
61constexpr size_t OFFSET_URL_ENTRY = 18;
62
Patrick Venture537ff142018-11-01 16:37:09 -070063} // namespace response
Ratan Gupta309ac442016-12-13 20:40:06 +053064
65/** @brief Defines the constants for slp request.
66 * Size and the offsets.
67 */
68namespace request
69{
70
71constexpr size_t MIN_SRVTYPE_LEN = 22;
Andrew Geissler20bab742024-05-24 14:31:16 -050072constexpr size_t MIN_SRV_LEN = 24;
Ratan Gupta309ac442016-12-13 20:40:06 +053073
74constexpr size_t SIZE_PRLIST = 2;
75constexpr size_t SIZE_NAMING = 2;
76constexpr size_t SIZE_SCOPE = 2;
77constexpr size_t SIZE_SERVICE_TYPE = 2;
78constexpr size_t SIZE_PREDICATE = 2;
79constexpr size_t SIZE_SLPI = 2;
80
81constexpr size_t OFFSET_PR_LEN = 16;
82constexpr size_t OFFSET_PR = 18;
83constexpr size_t OFFSET_SERVICE = 20;
84
Patrick Venture537ff142018-11-01 16:37:09 -070085} // namespace request
86} // namespace slp