* librouteros - src/routeros_api.h
* Copyright (C) 2009 Florian octo Forster
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; only version 2 of the License is applicable.
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
*
* Authors:
* Florian octo Forster <octo at verplant.org>
ros_registration_table_handler_t handler, void *user_data);
/* }}} /interface/wireless/registration-table */
+/* High-level function for accessing /system/resource {{{ */
+struct ros_system_resource_s;
+typedef struct ros_system_resource_s ros_system_resource_t;
+struct ros_system_resource_s
+{
+ uint64_t uptime;
+
+ const char *version;
+ const char *architecture_name;
+ const char *board_name;
+
+ const char *cpu_model;
+ unsigned int cpu_count;
+ unsigned int cpu_load;
+ uint64_t cpu_frequency;
+
+ uint64_t free_memory;
+ uint64_t total_memory;
+
+ uint64_t free_hdd_space;
+ uint64_t total_hdd_space;
+
+ uint64_t write_sect_since_reboot;
+ uint64_t write_sect_total;
+ uint64_t bad_blocks;
+};
+
+/* Callback function */
+typedef int (*ros_system_resource_handler_t) (ros_connection_t *c,
+ const ros_system_resource_t *r, void *user_data);
+
+int ros_system_resource (ros_connection_t *c,
+ ros_system_resource_handler_t handler, void *user_data);
+/* }}} /system/resource */
+
#ifdef __cplusplus
}
#endif