-void regenerate_key(void) {
- logger(DEBUG_STATUS, LOG_INFO, "Expiring symmetric keys");
- send_key_changed();
+bool node_write_devclass(meshlink_handle_t *mesh, node_t *n) {
+
+ if((int)n->devclass < 0 || n->devclass > _DEV_CLASS_MAX) {
+ return false;
+ }
+
+ bool result = false;
+
+ splay_tree_t *config_tree;
+ init_configuration(&config_tree);
+
+ // ignore read errors; in case the file does not exist we will create it
+ read_host_config(mesh, config_tree, n->name);
+
+ config_t *cnf = lookup_config(config_tree, "DeviceClass");
+
+ if(!cnf) {
+ cnf = new_config();
+ cnf->variable = xstrdup("DeviceClass");
+ config_add(config_tree, cnf);
+ }
+
+ set_config_int(cnf, n->devclass);
+
+ if(!write_host_config(mesh, config_tree, n->name)) {
+ goto fail;
+ }
+
+ result = true;
+
+fail:
+ exit_configuration(&config_tree);
+ return result;