peer-cfg: Add method to atomically replace child configs

This commit is contained in:
Tobias Brunner
2016-03-08 10:21:58 +01:00
parent 8db4f19ad9
commit 622c2b2c33
2 changed files with 128 additions and 2 deletions
+15 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2008 Tobias Brunner
* Copyright (C) 2007-2015 Tobias Brunner
* Copyright (C) 2005-2009 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -153,6 +153,20 @@ struct peer_cfg_t {
*/
void (*remove_child_cfg)(peer_cfg_t *this, enumerator_t *enumerator);
/**
* Replace the CHILD configs with those in the given PEER config.
*
* Configs that are equal are not replaced.
*
* The enumerator enumerates the removed and added CHILD configs
* (child_cfg_t*, bool), where the flag is FALSE for removed configs and
* TRUE for added configs.
*
* @param other other config to get CHILD configs from
* @return an enumerator over removed/added CHILD configs
*/
enumerator_t* (*replace_child_cfgs)(peer_cfg_t *this, peer_cfg_t *other);
/**
* Create an enumerator for all attached CHILD configs.
*