X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=doc%2Flibrouteros.pod;h=74f1863c9bee8ffddaadcf8669d7aa0d832da130;hb=e6df5f10632408478c64c6e4b1fdf415a243a935;hp=9e083a7eebd413e1918b74912a9be1c6b42274aa;hpb=20ae1607659c975a777e5de324d5d4e94d02f25c;p=routeros-api.git diff --git a/doc/librouteros.pod b/doc/librouteros.pod index 9e083a7..74f1863 100644 --- a/doc/librouteros.pod +++ b/doc/librouteros.pod @@ -67,7 +67,8 @@ called B: int callback (ros_connection_t *c, const ros_reply_t *r, void *user_data); The reply is broken into parts (or "sentences") and passed to the callback -function as a linked list of type B. The callback uses a couple of +function as a linked list of type B. It is only called once for +query and must traverse the linked list itself. The callback uses a couple of helper functions to iterate over this list and fetch parameters as necessary. The first and second arguments are objects representing the connection and the @@ -80,6 +81,10 @@ The value returned by the callback function will be returned by B to the calling code. To distinguish from error codes returned by B upon errors, use negative values in the callback function. +Because the entire reply is read back from the connection before the callback +function is called, it is legal for the callback function to send out another +query. + General queries / replies are handled using the following functions: =over 4 @@ -183,6 +188,27 @@ the following prototype: The usual semantics apply: You may not alter I and the memory pointed to by I is freed after the callback returned. +=head2 High level interface functions for "system resource" + +This high level interface makes it easy to access several system related +metrics, such as memory and disk space used. The data returned is equivalent to +running C. The parsed data is passed to a callback +function in form of a B structure. + +The query function has the following prototype: + + int ros_system_resource (ros_connection_t *c, + ros_system_resource_handler_t handler, void *user_data); + +I is the usual connection ocject. I is a pointer to a function with +the following prototype: + + int callback (ros_connection_t *c, + const ros_system_resource_t *r, void *user_data); + +The usual semantics apply: You may not alter I and the memory pointed to by +I is freed after the callback returned. + =head1 ERROR HANDLING Some of the functions above return an "error code". This error code can be @@ -205,6 +231,6 @@ applicable. =head1 AUTHOR librouteros is written by Florian octo Forster Eocto at verplant.orgE. -It's homepage can be found at L. +Its homepage can be found at L. (c) 2009 by Florian octo Forster.