File tree Expand file tree Collapse file tree 5 files changed +20
-19
lines changed Expand file tree Collapse file tree 5 files changed +20
-19
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 @@ -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 547547#define  AOS_CONFIG_TYPES_MAX_NUM_EXPOSED_PORTS  8 
548548#endif 
549549
550+ /* *
551+  * Max number of service instance connections. 
552+  */  
553+ #ifndef  AOS_CONFIG_TYPES_MAX_NUM_ALLOWED_CONNECTIONS
554+ #define  AOS_CONFIG_TYPES_MAX_NUM_ALLOWED_CONNECTIONS  16 
555+ #endif 
556+ 
550557/* *
551558 * Identifier URN  len. 
552559 */  
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 @@ -403,6 +403,16 @@ static constexpr auto cMaxNumExposedPorts = AOS_CONFIG_TYPES_MAX_NUM_EXPOSED_POR
403403 */  
404404static  constexpr  auto  cExposedPortLen = cPortLen + cProtocolNameLen;
405405
406+ /* *
407+  * Max length of connection name. 
408+  */  
409+ static  constexpr  auto  cConnectionNameLen = cServiceIDLen + cExposedPortLen;
410+ 
411+ /* *
412+  * Max number of allowed connections. 
413+  */  
414+ static  constexpr  auto  cMaxNumConnections = AOS_CONFIG_TYPES_MAX_NUM_ALLOWED_CONNECTIONS;
415+ 
406416/* *
407417 * Identifier URN  len. 
408418 */  
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments