libamxd  6.4.1
Data Model Manager
Data Model Objects
Collaboration diagram for Data Model Objects:

Modules

 Data Model Objects MIBs
 
 Event Methods
 
 RPC Methods
 
 Hierarchical Tree
 
 Parameters
 

Macros

#define amxd_object_for_each(type, it, object)
 Helper macro for iterating object content. More...
 
#define amxd_object_iterate(type, it, object)
 Helper macro for iterating object content. More...
 

Functions

amxd_status_t amxd_object_new (amxd_object_t **object, const amxd_object_type_t type, const char *name)
 Data model object constructor function. More...
 
void amxd_object_free (amxd_object_t **object)
 Data model object destructor function. More...
 
amxd_status_t amxd_object_new_instance (amxd_object_t **object, amxd_object_t *templ, const char *name, uint32_t index, amxc_var_t *values)
 Data model object constructor function. More...
 
amxd_status_t amxd_object_add_instance (amxd_object_t **object, amxd_object_t *templ, const char *name, uint32_t index, amxc_var_t *values)
 Data model object constructor function. More...
 
void amxd_object_delete (amxd_object_t **object)
 Invokes the destroy handler(s) of the object. More...
 
const char * amxd_object_get_name (const amxd_object_t *const object, const uint32_t flags)
 Get the name of the object (or index as a string for instance objects) More...
 
uint32_t amxd_object_get_index (const amxd_object_t *const object)
 Get the index of an instance object. More...
 
static amxd_object_type_t amxd_object_get_type (const amxd_object_t *const object)
 Returns the object type. More...
 
amxd_status_t amxd_object_set_attr (amxd_object_t *const object, const amxd_oattr_id_t attr, const bool enable)
 Sets or unsets an object attribute. More...
 
amxd_status_t amxd_object_set_attrs (amxd_object_t *const object, const uint32_t bitmask, bool enable)
 Sets or unsets object attributes using a bitmap. More...
 
uint32_t amxd_object_get_attrs (const amxd_object_t *const object)
 Gets the set attributes of an object. More...
 
bool amxd_object_is_attr_set (const amxd_object_t *const object, const amxd_oattr_id_t attr)
 Checks if an attribute is set. More...
 

Detailed Description

Macro Definition Documentation

◆ amxd_object_for_each

#define amxd_object_for_each (   type,
  it,
  object 
)
Value:
for(amxc_llist_it_t* it = amxd_object_first_ ## type(object), \
* _next = amxc_llist_it_get_next(it); \
it; \
it = _next, \
_next = amxc_llist_it_get_next(it))

Helper macro for iterating object content.

This helper macro can iterator over:

  • all parameters of an object, specify parameter as type
  • all functions of an object, specify function as type
  • all instances of an template object, specify instance as type
  • all child objects of an object, specify child as type

The iterator should not be declared.

Using this macro it is allowed to remove (delete) the iterators containing data structure

The iterator can be converted to the correct type using amxc_container_of macro.

For parameters the iterator is a member of the amxd_param_t structure, for functions the iterator is a member of the amxd_function_t structure, for instances and child objects the iterator is a member of the amxd_object_t structure.

Note
This macro can not be nested. Use amxd_object_iterate if you need nested loops to iterate over the content of objects.
Parameters
typecan be one of [parameter, function, child, instance]
ita linked list iterator
objectthe object

Definition at line 113 of file amxd_object.h.

◆ amxd_object_iterate

#define amxd_object_iterate (   type,
  it,
  object 
)
Value:
for(amxc_llist_it_t* it = amxd_object_first_ ## type(object); \
it; \
it = amxc_llist_it_get_next(it))

Helper macro for iterating object content.

This helper macro can iterator over:

  • all parameters of an object, specify parameter as type
  • all functions of an object, specify function as type
  • all instances of an template object, specify instance as type
  • all child objects of an object, specify child as type

The iterator should not be declared.

Warning
Do not delete the iterator or its containing data structure. If you want to be able to delete the current iterator (or its containing data structure), use the macro amxd_object_for_each

The iterator can be converted to the correct type using amxc_container_of macro. For parameters the iterator is a member of the amxd_param_t structure, for functions the iterator is a member of the amxd_function_t structure, for instances and child objects the iterator is a member of the amxd_object_t structure.

Parameters
typecan be one of [parameter, function, child, instance]
ita linked list iterator
objectthe object

Definition at line 149 of file amxd_object.h.

Function Documentation

◆ amxd_object_add_instance()

amxd_status_t amxd_object_add_instance ( amxd_object_t **  object,
amxd_object_t templ,
const char *  name,
uint32_t  index,
amxc_var_t *  values 
)

Data model object constructor function.

Creates a new instance of a template object and sets the values of the parameters if provided.

If the template contains key parameters, the values for these parameters must be provided.

This function calls amxd_object_new_instance to allocate memory for the object and to check if it can be created (unique name, index and key values)

If creation is successful, the values for the key parameters and other parameters are set in one go.

To be able to create a new object a valid name must be given or NULL. The name of each node (object) in the hierarchy MUST start with a letter or underscore, and subsequent characters MUST be letters, digits, underscores or hyphens.

The name and index (if given) must be unique in the context of the template object - no other instance can exist with the same name or index.

The instance inherits all attributes, all parameters (except template only parameters) and all functions (except template only functions) of the template object.

The newly created object will have as parent the template object.

To remove an instance use amxd_object_delete

Note
Adding an instance with this function will not generate events. If events must be sent automatically, the instance should be created with a transaction. Alternatively, it is possible to use functions amxd_object_send_add_inst or amxd_object_emit_add_inst to send the events.
Parameters
objectpointer to an object pointer. The address of the new allocated object is stored in this pointer.
templpointer to template object.
nameA valid object name or NULL. The name of each object in the hierarchy MUST start with a letter or underscore, and subsequent characters MUST be letters, digits, underscores or hyphens.'
indexA uinique index or 0
valuesA variant containing a hash table with at least all the values for key parameters. These values will be used to set the parameter values.
Returns
amxd_status_ok when the object is created, or another status code when failed creating the object

Definition at line 301 of file amxd_action_object_add_inst.c.

305  {
307  amxc_var_t args;
308  amxc_var_t* var_index = NULL;
309  amxc_var_t retval;
310 
311  amxc_var_init(&args);
312  amxc_var_init(&retval);
313  when_null(templ, exit);
314 
315  if(instance != NULL) {
316  *instance = NULL;
317  }
318 
319  amxc_var_set_type(&args, AMXC_VAR_ID_HTABLE);
320  amxc_var_set_key(&args, "parameters", values, AMXC_VAR_FLAG_COPY);
321  amxc_var_add_key(uint32_t, &args, "access", amxd_dm_access_private);
322  amxc_var_add_key(bool, &args, "set_read_only", true);
323  amxc_var_add_key(uint32_t, &args, "index", index);
324  amxc_var_add_key(cstring_t, &args, "name", name);
325 
327  NULL,
329  &args,
330  &retval);
331  when_failed(status, exit);
332 
333  var_index = amxc_var_get_path(&retval, "index", AMXC_VAR_FLAG_DEFAULT);
334  index = amxc_var_dyncast(uint32_t, var_index);
335 
336  if(instance != NULL) {
337  *instance = amxd_object_get_instance(templ, NULL, index);
338  }
339 
340 exit:
341  amxc_var_clean(&args);
342  amxc_var_clean(&retval);
343  return status;
344 }
amxd_status_t amxd_dm_invoke_action(amxd_object_t *object, amxd_param_t *param, amxd_action_t reason, const amxc_var_t *const args, amxc_var_t *const retval)
Definition: amxd_dm.c:591
@ action_object_add_inst
Definition: amxd_types.h:123
enum _amxd_status amxd_status_t
@ amxd_status_unknown_error
Definition: amxd_types.h:79
@ amxd_dm_access_private
Definition: amxd_types.h:141
amxd_object_t * amxd_object_get_instance(const amxd_object_t *object, const char *name, uint32_t index)
Get an instance of the template object.
static amxd_status_t status

◆ amxd_object_delete()

void amxd_object_delete ( amxd_object_t **  object)

Invokes the destroy handler(s) of the object.

This method doesn't remove the object from the data model.

To remove the object, including the subtree, and free all allocated memory use amxd_object_free

Note
Deleting an instance with this function will not generate events. If events must be sent automatically, the instance should be deleted with a transaction. Alternatively, it is possible to use functions amxd_object_send_del_inst or amxd_object_emit_del_inst to send the events.
Parameters
objectpointer to an object pointer.

Definition at line 80 of file amxd_action_object_destroy.c.

80  {
81  when_null(object, exit);
82  when_null(*object, exit);
83 
84  amxd_dm_invoke_action(*object,
85  NULL,
87  NULL,
88  NULL);
89 
90  *object = NULL;
91 
92 exit:
93  return;
94 }
@ action_object_destroy
Definition: amxd_types.h:125

◆ amxd_object_free()

void amxd_object_free ( amxd_object_t **  object)

Data model object destructor function.

Frees all memory allocated for an object.

If the object was in a data model tree, it is removed from that tree.

If the object has childeren (or instances) all these are freed and removed as well.

Parameters
objectpointer to an object pointer.

Definition at line 153 of file amxd_object.c.

153  {
154  amxd_object_type_t object_type;
155  amxd_param_t* counter = NULL;
156 
157  when_null(object, exit);
158  when_null((*object), exit);
159 
160  object_type = amxd_object_get_type(*object);
161  if((object_type == amxd_object_instance) || (object_type == amxd_object_template)) {
163  }
164 
165  amxd_object_clean((*object));
166 
167  if(amxc_llist_is_empty(&(*object)->derived_objects)) {
168  free((*object));
169  }
170 
171  *object = NULL;
172 
173  when_null(counter, exit);
174 
175  if(object_type == amxd_object_instance) {
177  } else if(object_type == amxd_object_template) {
179  }
180 
181 exit:
182  return;
183 }
amxd_param_t * amxd_object_get_param_counter_by_counted_object(const amxd_object_t *const object)
Gets a parameter definition associated with a counted object.
PRIVATE void amxd_object_clean(amxd_object_t *const object)
amxd_status_t amxd_param_counter_update(amxd_param_t *counter)
amxd_status_t amxd_param_delete(amxd_param_t **param)
enum _amxd_object_type amxd_object_type_t
The different object types.
@ amxd_object_template
Definition: amxd_types.h:183
@ amxd_object_instance
Definition: amxd_types.h:186
static amxd_object_type_t amxd_object_get_type(const amxd_object_t *const object)
Returns the object type.
Definition: amxd_object.h:586
static int counter

◆ amxd_object_get_attrs()

uint32_t amxd_object_get_attrs ( const amxd_object_t *const  object)

Gets the set attributes of an object.

This function returns the set attributes of an object as a bitmask. To verify if a certain attribute is set, use the macro IS_BIT_SET.

uint32_t attrs = amxd_object_get_attrs(object);
// do something
}
#define IS_BIT_SET(b, f)
Definition: amxd_common.h:66
@ amxd_oattr_persistent
Definition: amxd_types.h:200
uint32_t amxd_object_get_attrs(const amxd_object_t *const object)
Gets the set attributes of an object.
Definition: amxd_object.c:334

To verify that one single attribute is set the function amxd_object_is_attr_set can be used.

Parameters
objectthe object pointer
Returns
Returns the attributes set on the object as a bitmask.

Definition at line 334 of file amxd_object.c.

334  {
335  uint32_t attributes = 0;
336  when_null(object, exit);
337 
338  attributes |= object->attr.read_only << amxd_oattr_read_only;
339  attributes |= object->attr.persistent << amxd_oattr_persistent;
340  attributes |= object->attr.priv << amxd_oattr_private;
341  attributes |= object->attr.prot << amxd_oattr_protected;
342  attributes |= object->attr.locked << amxd_oattr_locked;
343 
344 exit:
345  return attributes;
346 }
@ amxd_oattr_read_only
Definition: amxd_types.h:199
@ amxd_oattr_locked
Definition: amxd_types.h:206
@ amxd_oattr_protected
Definition: amxd_types.h:210
@ amxd_oattr_private
Definition: amxd_types.h:202

◆ amxd_object_get_index()

uint32_t amxd_object_get_index ( const amxd_object_t *const  object)

Get the index of an instance object.

This function returns the index of an instance object. For singletons or template objects this function will always return 0.

Parameters
objectthe object pointer
Returns
Returns the index of an instance object or 0.

Definition at line 265 of file amxd_object.c.

265  {
266  return object == NULL ? 0 : object->index;
267 }

◆ amxd_object_get_name()

const char* amxd_object_get_name ( const amxd_object_t *const  object,
const uint32_t  flags 
)

Get the name of the object (or index as a string for instance objects)

Depending on the flags given the name or index is returned for instance objects, for all other types of objects the flags are ignored

Parameters
objectthe object pointer
flagscan be one of AMXD_OBJECT_NAMED or AMXD_OBJECT_INDEXED
Returns
Returns the name of the object or NULL.

Definition at line 239 of file amxd_object.c.

240  {
241  const char* name = NULL;
242 
243  when_null(object, exit);
244  if(object->type == amxd_object_instance) {
245  if((flags & AMXD_OBJECT_INDEXED) == AMXD_OBJECT_INDEXED) {
246  name = object->index_name;
247  } else {
248  name = object->name;
249  }
250  } else {
251  name = object->name;
252  if((name == NULL) && (object->derived_from.llist != NULL)) {
253  amxd_object_t* super = amxc_container_of(object->derived_from.llist,
255  derived_objects);
256 
258  }
259  }
260 
261 exit:
262  return name;
263 }
#define AMXD_OBJECT_INDEXED
Name and path format flag - use index for instance objects.
Definition: amxd_object.h:176
#define AMXD_OBJECT_NAMED
Name and path format flag - default behavior, use name for instance objects.
Definition: amxd_object.h:164
const char * amxd_object_get_name(const amxd_object_t *const object, const uint32_t flags)
Get the name of the object (or index as a string for instance objects)
Definition: amxd_object.c:239
amxc_llist_it_t derived_from
Definition: amxd_types.h:249
amxd_object_type_t type
Definition: amxd_types.h:236

◆ amxd_object_get_type()

static amxd_object_type_t amxd_object_get_type ( const amxd_object_t *const  object)
inlinestatic

Returns the object type.

The type of a data model object can be:

Parameters
objectthe object pointer
Returns
Returns the object type.

Definition at line 586 of file amxd_object.h.

586  {
587  return object == NULL ? amxd_object_invalid : object->type;
588 }
@ amxd_object_invalid
Definition: amxd_types.h:190

◆ amxd_object_is_attr_set()

bool amxd_object_is_attr_set ( const amxd_object_t *const  object,
const amxd_oattr_id_t  attr 
)

Checks if an attribute is set.

The following attribute identifiers can be checked

Parameters
objectthe object pointer
attrthe object attribute id
Returns
Returns true if attribute is set and false when unset

Definition at line 348 of file amxd_object.c.

349  {
350  uint32_t flags = 0;
351  bool retval = false;
352  when_null(object, exit);
353  when_true(attr < 0 || attr > amxd_oattr_max, exit);
354 
355  flags = amxd_object_get_attrs(object);
356  retval = (flags & (1 << attr)) != 0 ? true : false;
357 
358 exit:
359  return retval;
360 }
@ amxd_oattr_max
Definition: amxd_types.h:211

◆ amxd_object_new()

amxd_status_t amxd_object_new ( amxd_object_t **  object,
const amxd_object_type_t  type,
const char *  name 
)

Data model object constructor function.

Allocates memory for a new data model object and initializes the object.

The following object types can be created with this function:

  • singelton objects
  • template objects
  • mib objects

Instances of template objects must be created with the function amxd_object_new_instance or amxd_object_add_instance

To be able to create a new object a valid name must be given. The name of each node (object) in the hierarchy MUST start with a letter or underscore, and subsequent characters MUST be letters, digits, underscores or hyphens.

No attributes are set. Object attributes can be changed by using one of the following functions:

The newly created object is not added to the data model tree automatically. You can add the new object in the data model by using the function amxd_object_add_object.

Use amxd_object_delete to remove the object and free all allocated memory.

Parameters
objectpointer to an object pointer. The address of the new allocated object is stored in this pointer.
typethe object type that needs to be created. this can be one of amxd_object_singleton, amxd_object_template, amxd_object_mib
nameA valid object name. The name of each object in the hierarchy MUST start with a letter or underscore, and subsequent characters MUST be letters, digits, underscores or hyphens.
Returns
amxd_status_ok when the object is created, or another status code when failed creating the object

Definition at line 185 of file amxd_object.c.

187  {
189  when_null(object, exit);
190  when_true_status(!amxd_object_type_is_valid(type),
191  exit,
192  retval = amxd_status_invalid_type);
193  when_true_status(!amxd_name_is_valid(name),
194  exit,
195  retval = amxd_status_invalid_name);
196 
197  *object = (amxd_object_t*) calloc(1, sizeof(amxd_object_t));
198  when_null((*object), exit);
199 
200  retval = amxd_object_init(*object, type, name, NULL, NULL);
201  when_failed(retval, exit);
202 
203 exit:
204  return retval;
205 }
bool amxd_name_is_valid(const char *name)
Definition: amxd_common.c:115
static bool amxd_object_type_is_valid(const amxd_object_type_t type)
Definition: amxd_object.c:86
PRIVATE amxd_status_t amxd_object_init(amxd_object_t *const object, const amxd_object_type_t type, const char *name, amxc_var_t *templ_params, amxc_var_t *values)
@ amxd_status_invalid_name
Definition: amxd_types.h:86
@ amxd_status_invalid_type
Definition: amxd_types.h:90

◆ amxd_object_new_instance()

amxd_status_t amxd_object_new_instance ( amxd_object_t **  object,
amxd_object_t templ,
const char *  name,
uint32_t  index,
amxc_var_t *  values 
)

Data model object constructor function.

Creates a new instance of a template object. When passing a NULL pointer for the name, the name is the same as the index (but in string format). When passing 0 for the index. the next index is taken.

This function only allocates memory to store the object but will not assign values to the parameters. The parameter values passed to this function are only used to check if no other instance exists with the same values for the key parameters.

If creation is successful, the values for the key parameters and other parameters must still be set. Use amxd_object_add_instance to create an instance an fill the parameter values in one go.

To be able to create a new object a valid name must be given or NULL. The name of each node (object) in the hierarchy MUST start with a letter or underscore, and subsequent characters MUST be letters, digits, underscores or hyphens.

The name and index (if given) must be unique in the context of the template object - no other instance can exist with the same name or index.

The instance inherts all attributes, all parameters (except template only paramters) and all functions (except template only functions) of the template object .

The newly created object will have as parent the template object.

To remove an instance use amxd_object_delete

Parameters
objectpointer to an object pointer. The address of the new allocated object is stored in this pointer.
templpointer to template object.
nameA valid object name or NULL. The name of each object in the hierarchy MUST start with a letter or underscore, and subsequent characters MUST be letters, digits, underscores or hyphens.'
indexA uinique index or 0
valuesA variant containing a hash table with at least all the values for key parameters. These are used to verify that the innstance is unique.
Returns
amxd_status_ok when the object is created, or another status code when failed creating the object

Definition at line 350 of file amxd_object_instance.c.

354  {
356  amxc_var_t templ_params;
357  amxc_var_t* tmp_values = NULL;
358  amxc_var_t rv;
359 
360  amxc_var_init(&templ_params);
361  amxc_var_init(&rv);
362  when_null(object, exit);
363  when_null(templ, exit);
364  when_true_status(templ->type != amxd_object_template,
365  exit,
366  retval = amxd_status_invalid_type);
367  when_true_status(values != NULL && amxc_var_type_of(values) != AMXC_VAR_ID_HTABLE,
368  exit,
369  retval = amxd_status_invalid_value);
370  if(values == NULL) {
371  amxc_var_new(&tmp_values);
372  amxc_var_set_type(tmp_values, AMXC_VAR_ID_HTABLE);
373  } else {
374  tmp_values = values;
375  }
376  *object = NULL;
377  retval = amxd_object_describe_key_params(templ, &templ_params, amxd_dm_access_private);
378  when_failed(retval, exit);
379  retval = amxd_object_instance_validate_id(templ, &name, index, &templ_params, tmp_values);
380  when_failed(retval, exit);
381  retval = amxd_object_instantiate(object, templ, name, index, &templ_params, tmp_values);
382  when_failed(retval, exit);
383  if(values == NULL) {
384  retval = amxd_action_set_values((*object), amxd_dm_access_protected, true,
385  tmp_values, &rv, true);
386  }
387 
388 exit:
389  if(values == NULL) {
390  amxc_var_delete(&tmp_values);
391  }
392  amxc_var_clean(&rv);
393  amxc_var_clean(&templ_params);
394  return retval;
395 }
static amxd_status_t amxd_object_instantiate(amxd_object_t **object, amxd_object_t *templ, const char *name, uint32_t index, amxc_var_t *templ_params, amxc_var_t *tmp_values)
static amxd_status_t amxd_object_instance_validate_id(amxd_object_t *templ, const char **name, uint32_t index, amxc_var_t *templ_params, amxc_var_t *values)
amxd_status_t amxd_object_describe_key_params(amxd_object_t *const object, amxc_var_t *const value, amxd_dm_access_t access)
amxd_status_t PRIVATE amxd_action_set_values(amxd_object_t *const object, amxd_dm_access_t access, bool ro, const amxc_var_t *values, amxc_var_t *retval, bool required)
@ amxd_status_invalid_value
Definition: amxd_types.h:88
@ amxd_dm_access_protected
Definition: amxd_types.h:139

◆ amxd_object_set_attr()

amxd_status_t amxd_object_set_attr ( amxd_object_t *const  object,
const amxd_oattr_id_t  attr,
const bool  enable 
)

Sets or unsets an object attribute.

The following attributes can be set - unset:

Note
  • Attributes of a locked object can not be changed
  • It is not possible to add functions to a locked object
Parameters
objectthe object pointer
attrthe object attribute id
enablewhen true, sets the attribute, when false unsets the attribute
Returns
Returns amxd_status_ok when attributes is changed, any other when failed

Definition at line 269 of file amxd_object.c.

271  {
273  uint32_t flags = 0;
274  when_null(object, exit);
275 
276  when_true_status(object->type == amxd_object_mib,
277  exit,
278  retval = amxd_status_invalid_type);
279 
280  when_true_status(attr < 0 || attr > amxd_oattr_max,
281  exit,
282  retval = amxd_status_invalid_attr);
283 
284  when_true(amxd_object_is_attr_set(object, amxd_oattr_locked), exit);
285 
286  flags = amxd_object_get_attrs(object);
287 
288  if(enable) {
289  flags |= SET_BIT(attr);
290  } else {
291  flags &= ~SET_BIT(attr);
292  }
293 
294  amxd_object_set_attributes(object, flags);
295  retval = amxd_status_ok;
296 
297 exit:
298  return retval;
299 }
#define SET_BIT(x)
Definition: amxd_common.h:65
static void amxd_object_set_attributes(amxd_object_t *const object, const uint32_t attr)
Definition: amxd_object.c:77
@ amxd_status_invalid_attr
Definition: amxd_types.h:87
@ amxd_status_ok
Definition: amxd_types.h:78
@ amxd_object_mib
Definition: amxd_types.h:188
bool amxd_object_is_attr_set(const amxd_object_t *const object, const amxd_oattr_id_t attr)
Checks if an attribute is set.
Definition: amxd_object.c:348

◆ amxd_object_set_attrs()

amxd_status_t amxd_object_set_attrs ( amxd_object_t *const  object,
const uint32_t  bitmask,
bool  enable 
)

Sets or unsets object attributes using a bitmap.

The following attributes can be set - unset:

Use the macro SET_BIT to transform the attribute id to a bit. The bits can be joined together using the bitwise or operator '|'

true);
amxd_status_t amxd_object_set_attrs(amxd_object_t *const object, const uint32_t bitmask, bool enable)
Sets or unsets object attributes using a bitmap.
Definition: amxd_object.c:301

When setting or unsetting one single attribute the function amxd_object_set_attr can be used.

Note
  • Attributes of a locked object can not be changed
  • It is not possible to add functions to a locked object
Parameters
objectthe object pointer
bitmaskthe object attribute bitmask
enablewhen true, sets the attributes, when false unsets the attributes
Returns
Returns amxd_status_ok when attributes is changed, any other when failed

Definition at line 301 of file amxd_object.c.

303  {
305  uint32_t flags = 0;
306  uint32_t all = 0;
307 
308  when_null(object, exit);
309  when_true_status(object->type == amxd_object_mib,
310  exit,
311  retval = amxd_status_invalid_type);
312 
313  for(int i = 0; i <= amxd_oattr_max; i++) {
314  all |= SET_BIT(i);
315  }
316 
317  when_true_status(bitmask > all, exit, retval = amxd_status_invalid_attr);
318 
319  flags = amxd_object_get_attrs(object);
320 
321  if(enable) {
322  flags |= bitmask;
323  } else {
324  flags &= ~bitmask;
325  }
326 
327  amxd_object_set_attributes(object, flags);
328  retval = amxd_status_ok;
329 
330 exit:
331  return retval;
332 }