mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-03 21:43:32 +00:00 
			
		
		
		
	mgcp_client_pool: add mgcp_client_pool_empty()
Check if the private struct mgcp_client_pool has an empty member_list. Clients that support both the legacy config and the pool config can use this to properly exit with error if pool members are configured, but no connection to any of the pool members can be established. Currently clients can't distinguish a config without pool members and a config with pool members that is broken and will fall back to using the defaults of the legacy config in both cases. Related: OS#5993 Change-Id: I009483ac9dfd6627e414f14d43b89f40ea4644db
This commit is contained in:
		@@ -12,6 +12,7 @@ void mgcp_client_pool_vty_init(int parent_node, int mgw_node, const char *indent
 | 
			
		||||
int mgcp_client_pool_config_write(struct vty *vty, const char *indent);
 | 
			
		||||
unsigned int mgcp_client_pool_connect(struct mgcp_client_pool *pool);
 | 
			
		||||
void mgcp_client_pool_register_single(struct mgcp_client_pool *pool, struct mgcp_client *mgcp_client);
 | 
			
		||||
bool mgcp_client_pool_empty(const struct mgcp_client_pool *pool);
 | 
			
		||||
 | 
			
		||||
struct mgcp_client *mgcp_client_pool_get(struct mgcp_client_pool *pool);
 | 
			
		||||
void mgcp_client_pool_put(struct mgcp_client *mgcp_client);
 | 
			
		||||
 
 | 
			
		||||
@@ -75,6 +75,11 @@ void mgcp_client_pool_register_single(struct mgcp_client_pool *pool, struct mgcp
 | 
			
		||||
	pool->mgcp_client_single = mgcp_client;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool mgcp_client_pool_empty(const struct mgcp_client_pool *pool)
 | 
			
		||||
{
 | 
			
		||||
	return llist_empty(&pool->member_list);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*! Lookup the selected MGCP client config by its reference number */
 | 
			
		||||
struct mgcp_client_pool_member *mgcp_client_pool_find_member_by_nr(struct mgcp_client_pool *pool, unsigned int nr)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user