11a4beed9SSuryakanth Sekar /* 21a4beed9SSuryakanth Sekar * Copyright © 2019 Intel Corporation 31a4beed9SSuryakanth Sekar * 41a4beed9SSuryakanth Sekar * Licensed under the Apache License, Version 2.0 (the "License"); 51a4beed9SSuryakanth Sekar * you may not use this file except in compliance with the License. 61a4beed9SSuryakanth Sekar * You may obtain a copy of the License at 71a4beed9SSuryakanth Sekar * 81a4beed9SSuryakanth Sekar * http://www.apache.org/licenses/LICENSE-2.0 91a4beed9SSuryakanth Sekar * 101a4beed9SSuryakanth Sekar * Unless required by applicable law or agreed to in writing, software 111a4beed9SSuryakanth Sekar * distributed under the License is distributed on an "AS IS" BASIS, 121a4beed9SSuryakanth Sekar * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 131a4beed9SSuryakanth Sekar * See the License for the specific language governing permissions and 141a4beed9SSuryakanth Sekar * limitations under the License. 151a4beed9SSuryakanth Sekar * 161a4beed9SSuryakanth Sekar */ 171a4beed9SSuryakanth Sekar #pragma once 181a4beed9SSuryakanth Sekar 191a4beed9SSuryakanth Sekar namespace session 201a4beed9SSuryakanth Sekar { 211a4beed9SSuryakanth Sekar 221a4beed9SSuryakanth Sekar static constexpr auto sessionManagerRootPath = 231a4beed9SSuryakanth Sekar "/xyz/openbmc_project/ipmi/session"; 241a4beed9SSuryakanth Sekar static constexpr auto sessionIntf = "xyz.openbmc_project.Ipmi.SessionInfo"; 251a4beed9SSuryakanth Sekar static constexpr uint8_t ipmi20VerSession = 0x01; 261a4beed9SSuryakanth Sekar static constexpr size_t maxSessionCountPerChannel = 15; 271a4beed9SSuryakanth Sekar static constexpr size_t sessionZero = 0; 281a4beed9SSuryakanth Sekar static constexpr size_t maxSessionlessCount = 1; 291a4beed9SSuryakanth Sekar static constexpr uint8_t invalidSessionID = 0; 301a4beed9SSuryakanth Sekar static constexpr uint8_t invalidSessionHandle = 0; 31e7023926SRajashekar Gade Reddy static constexpr uint8_t defaultSessionHandle = 0xFF; 321a4beed9SSuryakanth Sekar static constexpr uint8_t maxNetworkInstanceSupported = 4; 33e7023926SRajashekar Gade Reddy static constexpr uint8_t ccInvalidSessionId = 0x87; 34e7023926SRajashekar Gade Reddy static constexpr uint8_t ccInvalidSessionHandle = 0x88; 35*4d22640aSRajashekar Gade Reddy static constexpr uint8_t searchCurrentSession = 0; 36f71444daSRajashekar Gade Reddy static constexpr uint8_t searchSessionByHandle = 0xFE; 37f71444daSRajashekar Gade Reddy static constexpr uint8_t searchSessionById = 0xFF; 381a4beed9SSuryakanth Sekar // MSB BIT 7 BIT 6 assigned for netipmid instance in session handle. 391a4beed9SSuryakanth Sekar static constexpr uint8_t multiIntfaceSessionHandleMask = 0x3F; 401a4beed9SSuryakanth Sekar 411a4beed9SSuryakanth Sekar // MSB BIT 31-BIT30 assigned for netipmid instance in session ID 421a4beed9SSuryakanth Sekar static constexpr uint32_t multiIntfaceSessionIDMask = 0x3FFFFFFF; 431a4beed9SSuryakanth Sekar 441a4beed9SSuryakanth Sekar enum class State : uint8_t 451a4beed9SSuryakanth Sekar { 461a4beed9SSuryakanth Sekar inactive, // Session is not in use 471a4beed9SSuryakanth Sekar setupInProgress, // Session Setup Sequence is progressing 481a4beed9SSuryakanth Sekar active, // Session is active 491a4beed9SSuryakanth Sekar tearDownInProgress, // When Closing Session 501a4beed9SSuryakanth Sekar }; 511a4beed9SSuryakanth Sekar 521a4beed9SSuryakanth Sekar } // namespace session 53