File tree Expand file tree Collapse file tree 6 files changed +21
-20
lines changed Expand file tree Collapse file tree 6 files changed +21
-20
lines changed Original file line number Diff line number Diff line change 77#ifndef AOS_CORE_CM_CONFIG_HPP_
88#define AOS_CORE_CM_CONFIG_HPP_
99
10- /* *
11- * Max number of service instance connections.
12- */
13- #ifndef AOS_CONFIG_NETWORKMANAGER_CONNECTIONS_PER_INSTANCE_MAX_COUNT
14- #define AOS_CONFIG_NETWORKMANAGER_CONNECTIONS_PER_INSTANCE_MAX_COUNT 16
15- #endif
16-
1710#endif
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ struct UpdateItemStatus {
9797 }
9898
9999 /* *
100- * @brief Compares update item status.
100+ * Compares update item status.
101101 *
102102 * @param other update item status to compare with.
103103 * @return bool.
Original file line number Diff line number Diff line change @@ -16,16 +16,6 @@ namespace aos::cm::networkmanager {
1616 * @{
1717 */
1818
19- /* *
20- * Max number of allowed connections.
21- */
22- static constexpr auto cMaxNumConnections = AOS_CONFIG_NETWORKMANAGER_CONNECTIONS_PER_INSTANCE_MAX_COUNT;
23-
24- /* *
25- * Max length of connection name.
26- */
27- static constexpr auto cConnectionNameLen = cServiceIDLen + cExposedPortLen;
28-
2919/* *
3020 * Represents network configuration parameters for service.
3121 */
Original file line number Diff line number Diff line change 540540#define AOS_CONFIG_TYPES_MAX_NUM_EXPOSED_PORTS 8
541541#endif
542542
543+ /* *
544+ * Max number of service instance connections.
545+ */
546+ #ifndef AOS_CONFIG_TYPES_MAX_NUM_ALLOWED_CONNECTIONS
547+ #define AOS_CONFIG_TYPES_MAX_NUM_ALLOWED_CONNECTIONS 16
548+ #endif
549+
543550/* *
544551 * Identifier URN len.
545552 */
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ struct ServiceConfig {
113113 Duration mOfflineTTL ;
114114 ServiceQuotas mQuotas ;
115115 Optional<RequestedResources> mRequestedResources ;
116+ StaticArray<StaticString<cConnectionNameLen>, cMaxNumConnections> mAllowedConnections ;
116117 StaticArray<ServiceDevice, cMaxNumNodeDevices> mDevices ;
117118 StaticArray<StaticString<cResourceNameLen>, cMaxNumNodeResources> mResources ;
118119 StaticArray<FunctionServicePermissions, cFuncServiceMaxCount> mPermissions ;
@@ -130,8 +131,8 @@ struct ServiceConfig {
130131 && mSkipResourceLimits == config.mSkipResourceLimits && mHostname == config.mHostname
131132 && mBalancingPolicy == config.mBalancingPolicy && mRunners == config.mRunners
132133 && mRunParameters == config.mRunParameters && mSysctl == config.mSysctl && mOfflineTTL == config.mOfflineTTL
133- && mQuotas == config.mQuotas && mRequestedResources == config.mRequestedResources
134- && mAlertRules == config.mAlertRules ;
134+ && mQuotas == config.mQuotas && mAllowedConnections == config.mAllowedConnections
135+ && mRequestedResources == config. mRequestedResources && mAlertRules == config.mAlertRules ;
135136 }
136137
137138 /* *
Original file line number Diff line number Diff line change @@ -398,6 +398,16 @@ static constexpr auto cMaxNumExposedPorts = AOS_CONFIG_TYPES_MAX_NUM_EXPOSED_POR
398398 */
399399static constexpr auto cExposedPortLen = cPortLen + cProtocolNameLen;
400400
401+ /* *
402+ * Max length of connection name.
403+ */
404+ static constexpr auto cConnectionNameLen = cServiceIDLen + cExposedPortLen;
405+
406+ /* *
407+ * Max number of allowed connections.
408+ */
409+ static constexpr auto cMaxNumConnections = AOS_CONFIG_TYPES_MAX_NUM_ALLOWED_CONNECTIONS;
410+
401411/* *
402412 * Identifier URN len.
403413 */
You can’t perform that action at this time.
0 commit comments