X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frouteros_api.h;h=8d10ec4f36379f28daba263e79e59ad430b649a2;hb=b23183ce327183d252dd9779d90f09bb32d8d777;hp=4527876e5e2d339fc760d43b082babb02b568064;hpb=2e1cb0bdef4b270af813f921c078ca01150602b6;p=routeros-api.git diff --git a/src/routeros_api.h b/src/routeros_api.h index 4527876..8d10ec4 100644 --- a/src/routeros_api.h +++ b/src/routeros_api.h @@ -2,18 +2,17 @@ * 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 @@ -189,6 +188,41 @@ int ros_registration_table (ros_connection_t *c, 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