#include <stdio.h>
struct ubus_args {
char *key;
char *val;
};
int ubus_call(char *obj, char *method, struct ubus_args u_args[], int size_args) {
printf("%s %s\n", u_args
->key
, u_args
->val
); return 0;
}
int main (void)
{
ubus_call("router", "client", (struct ubus_args[]){{"network", "lan"}, {"dhcp", "true"}}, 2);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3QgdWJ1c19hcmdzIHsKIGNoYXIgKmtleTsKIGNoYXIgKnZhbDsKfTsKCmludCB1YnVzX2NhbGwoY2hhciAqb2JqLCBjaGFyICptZXRob2QsIHN0cnVjdCB1YnVzX2FyZ3MgdV9hcmdzW10sIGludCBzaXplX2FyZ3MpIHsKIHByaW50ZigiJXNcbiIsIG9iaik7CiBwcmludGYoIiVzXG4iLCBtZXRob2QpOwogcHJpbnRmKCIlcyAgJXNcbiIsIHVfYXJncy0+a2V5LCB1X2FyZ3MtPnZhbCk7CiByZXR1cm4gMDsKfQoKaW50IG1haW4gKHZvaWQpCnsKICB1YnVzX2NhbGwoInJvdXRlciIsICJjbGllbnQiLCAoc3RydWN0IHVidXNfYXJnc1tdKXt7Im5ldHdvcmsiLCAibGFuIn0sIHsiZGhjcCIsICJ0cnVlIn19LCAyKTsKICByZXR1cm4gMDsKfQo=