blobmsg_parse(test_pub_policy, __UBUS_test_PUB_MAX, tb, blob_data(msg), blob_len(msg)); if (!tb[UBUS_test_PUB_TOPIC]){ debug(MSG_ERROR, "ubus call spub without topic"); goto out; } cmd=blobmsg_get_string(tb[UBUS
blobmsg_parse(zboard_policy, ZTEST_MAX, tb, blob_data(msg), blob_len(msg)); if (!tb[ZTEST_STATUS] || !tb[ZTEST_PORT]) return UBUS_STATUS_INVALID_ARGUMENT; g_wan_status = blobmsg_get_u32(tb[ZTEST_STATUS]); g_wan_port = blobmsg_get_u32(tb[ZTEST_PORT]); return 0; } stat...
如果是alias 就将 setction 中的 option interface 'lan' 作为当前接口的 parent_ifname 处理alias: 1staticbool__interface_add(structinterface*iface,structblob_attr *config,boolalias)2{3structblob_attr *tb[IFACE_ATTR_MAX];4structblob_attr *cur;56blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb,7b...
如果是alias 就将 setction 中的 option interface 'lan' 作为当前接口的 parent_ifname 处理alias: 1staticbool__interface_add(structinterface*iface,structblob_attr *config,boolalias)2{3structblob_attr *tb[IFACE_ATTR_MAX];4structblob_attr *cur;56blobmsg_parse(iface_attrs, IFACE_ATTR_MAX, tb,7b...
void foo(blob_attr *confg) { struct blob_attr *tb[__POLICY_ATTR_MAX]; blobmsg_parse(policy_attrs, __POLICY_ATTR_MAX, tb, blob_data(config), blob_len(config)); /** * do something with *tb[] */ } openwrt 阅读14.5k发布于2014-11-27 ...
blobmsg_parse(watch_policy, __WATCH_MAX, tb, blob_data(msg), blob_len(msg)); if (!tb[WATCH_ID]) return UBUS_STATUS_INVALID_ARGUMENT; test_event.remove_cb = test_handle_remove; test_event.cb = test_notify; ret = ubus_subscribe(ctx, &test_event, blobmsg_get_u32(tb[WATCH_ID]))...
blobmsg_parse(test_pub_policy,__UBUS_test_PUB_MAX,tb,blob_data(msg),blob_len(msg));if(!tb[UBUS_test_PUB_TOPIC]){debug(MSG_ERROR,"ubus call spub without topic");gotoout;}cmd=blobmsg_get_string(tb[UBUS_test_PUB_TOPIC]);if(tb[UBUS_test_PUB_MSG]!=NULL){message=blobmsg_format_json...
blob_attr *tb[SCAN_POLICY_MAX];43 blobmsg_parse(scan_policy, SCAN_POLICY_MAX, tb, blob_data(msg), blob_len(msg));44 45/* 46本例⼦中,如果请求特定的节⽬号,返回节⽬名称。47如果请求节⽬号是0,则返回所有节⽬列表。48*/ 49if (tb[SCAN_CHNID] != NULL)50 { ...
blobmsg_parse(hotplug_policy, __HOTPLUG_MAX, tb, blobmsg_data(msg), blobmsg_len(msg));if (!tb[HOTPLUG_ENV]) return UBUS_STATUS_INVALID_ARGUMENT;tmpenv = environ;/* first adding existing environment to avl_tree */ while (*tmpenv) {...
blobmsg_parse(hello_policy, ARRAY_SIZE(hello_policy), tb, blob_data(msg), blob_len(msg)); // H2.Get method argumentsby msg ID if (tb[HELLO_MSG]) msgstr = blobmsg_data(tb[HELLO_MSG]); hreq = calloc(1, sizeof(*hreq) + strlen(format) + strlen(obj->name) + strlen(msgstr) +...