1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
| #include <stdbool.h> | #include <stdlib.h> | #include <routeros_api.h> | | //auxiliary function | int | handler(ros_connection_t* p1, ros_reply_t const* p2, void* p3){ | return 1; | } | | int main(int argc, char *argv[]) | { | ros_connection_t* c = ros_connect( | "node", | "service", | "username", | "password"); | char const command [] = { | 'A', | 'B', | 'C', | 'D', | '\0'}; | char const*const args [] = { | "args_1", | "args_2", | "args_3", | "args_4", | 0}; | void* user_data = malloc(256); | ros_query( | c, | command, | 4, | args, | &handler, | user_data); //target call | return 0; | } |
|