eRPC
rpc_constants.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include <stdint.h>
7 #include <stdlib.h>
8 
9 namespace erpc {
10 
15 static constexpr size_t kMaxNumERpcProcesses = 32;
16 
21 static constexpr size_t kMaxRpcId = UINT8_MAX - 1;
22 
28 static constexpr uint16_t kBaseSmUdpPort = 31850;
29 
30 static_assert(kBaseSmUdpPort + kMaxNumERpcProcesses +
31  (kMaxNumERpcProcesses * kMaxRpcId) <
32  UINT16_MAX,
33  "");
34 
39 static constexpr size_t kMaxNumaNodes = 8;
40 
45 static constexpr size_t kMaxBgThreads = 8;
46 
51 static constexpr size_t kMaxPhyPorts = 16;
52 
60 static constexpr size_t kMachineFailureTimeoutMs = 500;
61 
68 static uint16_t get_dpath_udp_port(uint16_t mgmt_udp_port, uint8_t rpc_id) {
69  return kBaseSmUdpPort + kMaxNumERpcProcesses +
70  (static_cast<uint16_t>(mgmt_udp_port - kBaseSmUdpPort) * kMaxRpcId) +
71  rpc_id;
72 }
73 
74 } // namespace erpc