{
struct uci_context *ctx;
struct uci_package *p = NULL;
- struct uci_element *e;
int ret = -1;
ctx = uci_alloc_context();
struct switch_dev *dev;
struct switch_attr *a;
struct switch_val val;
- int err;
int i;
int cmd = CMD_NONE;
if(!a)
{
fprintf(stderr, "Unknown attribute \"%s\"\n", ckey);
+ retval = -1;
goto out;
}
}
out:
swlib_free_all(dev);
- return 0;
+ return retval;
}
{
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct switch_val *val = arg;
- struct switch_attr *attr = val->attr;
if (!val)
goto error;
static int
list_switch(struct nl_msg *msg, void *arg)
{
- struct swlib_scan_arg *sa = arg;
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
- struct switch_dev *dev;
- const char *name;
- const char *alias;
if (nla_parse(tb, SWITCH_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL) < 0)
goto done;
swlib_connect(const char *name)
{
struct swlib_scan_arg arg;
- int err;
if (!refcount) {
if (swlib_priv_init() < 0)
struct switch_attr *attr;
struct uci_element *e;
struct uci_option *o;
- int i;
uci_foreach_element(&s->options, e) {
o = uci_to_option(e);
int swlib_apply_from_uci(struct switch_dev *dev, struct uci_package *p)
{
struct switch_attr *attr;
- struct uci_context *ctx = p->ctx;
struct uci_element *e;
struct uci_section *s;
struct uci_option *o;