Suryakanth Sekar | 1a4beed | 2019-06-12 20:44:10 +0530 | [diff] [blame] | 1 | /* |
| 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 | |
| 19 | namespace session |
| 20 | { |
| 21 | |
| 22 | static constexpr auto sessionManagerRootPath = |
| 23 | "/xyz/openbmc_project/ipmi/session"; |
| 24 | static constexpr auto sessionIntf = "xyz.openbmc_project.Ipmi.SessionInfo"; |
| 25 | static constexpr uint8_t ipmi20VerSession = 0x01; |
| 26 | static constexpr size_t maxSessionCountPerChannel = 15; |
| 27 | static constexpr size_t sessionZero = 0; |
| 28 | static constexpr size_t maxSessionlessCount = 1; |
| 29 | static constexpr uint8_t invalidSessionID = 0; |
| 30 | static constexpr uint8_t invalidSessionHandle = 0; |
Rajashekar Gade Reddy | e702392 | 2019-07-10 16:54:55 +0000 | [diff] [blame] | 31 | static constexpr uint8_t defaultSessionHandle = 0xFF; |
Suryakanth Sekar | 1a4beed | 2019-06-12 20:44:10 +0530 | [diff] [blame] | 32 | static constexpr uint8_t maxNetworkInstanceSupported = 4; |
Rajashekar Gade Reddy | e702392 | 2019-07-10 16:54:55 +0000 | [diff] [blame] | 33 | static constexpr uint8_t ccInvalidSessionId = 0x87; |
| 34 | static constexpr uint8_t ccInvalidSessionHandle = 0x88; |
Rajashekar Gade Reddy | 4d22640 | 2019-11-13 17:13:05 +0530 | [diff] [blame] | 35 | static constexpr uint8_t searchCurrentSession = 0; |
Rajashekar Gade Reddy | f71444d | 2019-07-25 15:12:17 +0000 | [diff] [blame] | 36 | static constexpr uint8_t searchSessionByHandle = 0xFE; |
| 37 | static constexpr uint8_t searchSessionById = 0xFF; |
Suryakanth Sekar | 1a4beed | 2019-06-12 20:44:10 +0530 | [diff] [blame] | 38 | // MSB BIT 7 BIT 6 assigned for netipmid instance in session handle. |
| 39 | static constexpr uint8_t multiIntfaceSessionHandleMask = 0x3F; |
| 40 | |
| 41 | // MSB BIT 31-BIT30 assigned for netipmid instance in session ID |
| 42 | static constexpr uint32_t multiIntfaceSessionIDMask = 0x3FFFFFFF; |
| 43 | |
| 44 | enum class State : uint8_t |
| 45 | { |
| 46 | inactive, // Session is not in use |
| 47 | setupInProgress, // Session Setup Sequence is progressing |
| 48 | active, // Session is active |
| 49 | tearDownInProgress, // When Closing Session |
| 50 | }; |
| 51 | |
| 52 | } // namespace session |