blob: 0311c915d6d7fcec6a8affda0926f699cbe0d8e0 [file] [log] [blame]
Suryakanth Sekar1a4beed2019-06-12 20:44:10 +05301/*
2 * Copyright © 2019 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17#pragma once
18
Jayanth Othayotha8205ff2025-03-07 06:57:54 -060019#include <stddef.h>
20#include <stdint.h>
21
Suryakanth Sekar1a4beed2019-06-12 20:44:10 +053022namespace session
23{
24
25static constexpr auto sessionManagerRootPath =
26 "/xyz/openbmc_project/ipmi/session";
27static constexpr auto sessionIntf = "xyz.openbmc_project.Ipmi.SessionInfo";
28static constexpr uint8_t ipmi20VerSession = 0x01;
29static constexpr size_t maxSessionCountPerChannel = 15;
30static constexpr size_t sessionZero = 0;
31static constexpr size_t maxSessionlessCount = 1;
32static constexpr uint8_t invalidSessionID = 0;
33static constexpr uint8_t invalidSessionHandle = 0;
Rajashekar Gade Reddye7023922019-07-10 16:54:55 +000034static constexpr uint8_t defaultSessionHandle = 0xFF;
Suryakanth Sekar1a4beed2019-06-12 20:44:10 +053035static constexpr uint8_t maxNetworkInstanceSupported = 4;
Rajashekar Gade Reddye7023922019-07-10 16:54:55 +000036static constexpr uint8_t ccInvalidSessionId = 0x87;
37static constexpr uint8_t ccInvalidSessionHandle = 0x88;
Rajashekar Gade Reddy4d226402019-11-13 17:13:05 +053038static constexpr uint8_t searchCurrentSession = 0;
Rajashekar Gade Reddyf71444d2019-07-25 15:12:17 +000039static constexpr uint8_t searchSessionByHandle = 0xFE;
40static constexpr uint8_t searchSessionById = 0xFF;
Suryakanth Sekar1a4beed2019-06-12 20:44:10 +053041// MSB BIT 7 BIT 6 assigned for netipmid instance in session handle.
42static constexpr uint8_t multiIntfaceSessionHandleMask = 0x3F;
43
44// MSB BIT 31-BIT30 assigned for netipmid instance in session ID
45static constexpr uint32_t multiIntfaceSessionIDMask = 0x3FFFFFFF;
46
47enum class State : uint8_t
48{
49 inactive, // Session is not in use
50 setupInProgress, // Session Setup Sequence is progressing
51 active, // Session is active
52 tearDownInProgress, // When Closing Session
53};
54
55} // namespace session