const char *dev_name;
if (!uci_wireless) {
- DPRINTF("No wireless configuration found\n");
+ D(WIRELESS, "No wireless configuration found\n");
return;
}
wdev = vlist_find(&wireless_devices, dev_name, wdev, node);
if (!wdev) {
- DPRINTF("device %s not found!\n", dev_name);
+ D(WIRELESS, "device %s not found!\n", dev_name);
continue;
}
if (system_resolve_rpfilter(blobmsg_data(cur), &s->rpfilter))
s->flags |= DEV_OPT_RPFILTER;
else
- DPRINTF("Failed to resolve rpfilter: %s\n", (char *) blobmsg_data(cur));
+ D(DEVICE, "Failed to resolve rpfilter: %s\n", (char *) blobmsg_data(cur));
}
if ((cur = tb[DEV_ATTR_ACCEPTLOCAL])) {
if (s->igmpversion >= 1 && s->igmpversion <= 3)
s->flags |= DEV_OPT_IGMPVERSION;
else
- DPRINTF("Failed to resolve igmpversion: %d\n", blobmsg_get_u32(cur));
+ D(DEVICE, "Failed to resolve igmpversion: %d\n", blobmsg_get_u32(cur));
}
if ((cur = tb[DEV_ATTR_MLDVERSION])) {
if (s->mldversion >= 1 && s->mldversion <= 2)
s->flags |= DEV_OPT_MLDVERSION;
else
- DPRINTF("Failed to resolve mldversion: %d\n", blobmsg_get_u32(cur));
+ D(DEVICE, "Failed to resolve mldversion: %d\n", blobmsg_get_u32(cur));
}
if ((cur = tb[DEV_ATTR_NEIGHREACHABLETIME])) {
if (s->multicast_router <= 2)
s->flags |= DEV_OPT_MULTICAST_ROUTER;
else
- DPRINTF("Invalid value: %d - (Use 0: never, 1: learn, 2: always)\n", blobmsg_get_u32(cur));
+ D(DEVICE, "Invalid value: %d - (Use 0: never, 1: learn, 2: always)\n", blobmsg_get_u32(cur));
}
if ((cur = tb[DEV_ATTR_MULTICAST_FAST_LEAVE])) {
if ((cur = tb[ROUTE_TARGET]) != NULL) {
if (!parse_ip_and_netmask(af, blobmsg_data(cur), &route->addr, &route->mask)) {
- DPRINTF("Failed to parse route target: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse route target: %s\n", (char *) blobmsg_data(cur));
goto error;
}
if ((cur = tb[ROUTE_GATEWAY]) != NULL) {
if (!inet_pton(af, blobmsg_data(cur), &route->nexthop)) {
- DPRINTF("Failed to parse route gateway: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse route gateway: %s\n", (char *) blobmsg_data(cur));
goto error;
}
}
const char *mask = strtok_r(NULL, "/", &saveptr);
if (!addr || inet_pton(af, addr, &route->source) < 1) {
- DPRINTF("Failed to parse route source: %s\n", addr ? addr : "NULL");
+ D(INTERFACE, "Failed to parse route source: %s\n", addr ? addr : "NULL");
goto error;
}
if ((cur = tb[ROUTE_TABLE]) != NULL) {
if (!system_resolve_rt_table(blobmsg_data(cur), &route->table)) {
- DPRINTF("Failed to resolve routing table: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to resolve routing table: %s\n", (char *) blobmsg_data(cur));
goto error;
}
if ((cur = tb[ROUTE_TYPE]) != NULL) {
if (!system_resolve_rt_type(blobmsg_data(cur), &route->type)) {
- DPRINTF("Failed to resolve routing type: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to resolve routing type: %s\n", (char *) blobmsg_data(cur));
goto error;
}
route->flags |= DEVROUTE_TYPE;
if ((cur = tb[ROUTE_PROTO]) != NULL) {
if (!system_resolve_rt_proto(blobmsg_data(cur), &route->proto)) {
- DPRINTF("Failed to resolve proto type: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to resolve proto type: %s\n", (char *) blobmsg_data(cur));
goto error;
}
route->flags |= DEVROUTE_PROTO;
if ((cur = tb[IFACE_ATTR_IP4TABLE])) {
if (!system_resolve_rt_table(blobmsg_data(cur), &iface->ip4table))
- DPRINTF("Failed to resolve routing table: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to resolve routing table: %s\n", (char *) blobmsg_data(cur));
}
if ((cur = tb[IFACE_ATTR_IP6TABLE])) {
if (!system_resolve_rt_table(blobmsg_data(cur), &iface->ip6table))
- DPRINTF("Failed to resolve routing table: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to resolve routing table: %s\n", (char *) blobmsg_data(cur));
}
iface->proto_ip.no_delegation = !blobmsg_get_bool_default(tb[IFACE_ATTR_DELEGATE], true);
if ((cur = tb[RULE_SRC]) != NULL) {
if (!parse_ip_and_netmask(af, blobmsg_data(cur), &rule->src_addr, &rule->src_mask)) {
- DPRINTF("Failed to parse rule source: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse rule source: %s\n", (char *) blobmsg_data(cur));
goto error;
}
rule->flags |= IPRULE_SRC;
if ((cur = tb[RULE_DEST]) != NULL) {
if (!parse_ip_and_netmask(af, blobmsg_data(cur), &rule->dest_addr, &rule->dest_mask)) {
- DPRINTF("Failed to parse rule destination: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse rule destination: %s\n", (char *) blobmsg_data(cur));
goto error;
}
rule->flags |= IPRULE_DEST;
if ((cur = tb[RULE_TOS]) != NULL) {
if ((rule->tos = blobmsg_get_u32(cur)) > 255) {
- DPRINTF("Invalid TOS value: %u\n", blobmsg_get_u32(cur));
+ D(INTERFACE, "Invalid TOS value: %u\n", blobmsg_get_u32(cur));
goto error;
}
rule->flags |= IPRULE_TOS;
if ((cur = tb[RULE_FWMARK]) != NULL) {
if (!iprule_parse_mark(blobmsg_data(cur), rule)) {
- DPRINTF("Failed to parse rule fwmark: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse rule fwmark: %s\n", (char *) blobmsg_data(cur));
goto error;
}
/* flags set by iprule_parse_mark() */
if ((cur = tb[RULE_LOOKUP]) != NULL) {
if (!system_resolve_rt_table(blobmsg_data(cur), &rule->lookup)) {
- DPRINTF("Failed to parse rule lookup table: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse rule lookup table: %s\n", (char *) blobmsg_data(cur));
goto error;
}
rule->flags |= IPRULE_LOOKUP;
if (ret == 1)
rule->uidrange_end = rule->uidrange_start;
else if (ret != 2) {
- DPRINTF("Failed to parse UID range: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse UID range: %s\n", (char *) blobmsg_data(cur));
goto error;
}
rule->flags |= IPRULE_UIDRANGE;
if ((cur = tb[RULE_ACTION]) != NULL) {
if (!system_resolve_iprule_action(blobmsg_data(cur), &rule->action)) {
- DPRINTF("Failed to parse rule action: %s\n", (char *) blobmsg_data(cur));
+ D(INTERFACE, "Failed to parse rule action: %s\n", (char *) blobmsg_data(cur));
goto error;
}
rule->flags |= IPRULE_ACTION;
blobmsg_for_each_attr(cur, attr, rem) {
if (blobmsg_type(cur) != BLOBMSG_TYPE_TABLE) {
- DPRINTF("Ignore wrong route type: %d\n", blobmsg_type(cur));
+ D(INTERFACE, "Ignore wrong route type: %d\n", blobmsg_type(cur));
continue;
}
blobmsg_for_each_attr(cur, attr, rem) {
if (blobmsg_type(cur) != BLOBMSG_TYPE_TABLE) {
- DPRINTF("Ignore wrong neighbor type: %d\n", blobmsg_type(cur));
+ D(INTERFACE, "Ignore wrong neighbor type: %d\n", blobmsg_type(cur));
continue;
}
if (config)
handler->config_buf = netifd_handler_parse_config(&handler->config, config);
- DPRINTF("Add handler for script %s: %s\n", script, proto->name);
+ D(INTERFACE, "Add handler for script %s: %s\n", script, proto->name);
add_proto_handler(proto);
}
int t = 2;
if (ubus_reconnect(ubus_ctx, ubus_path) != 0) {
- DPRINTF("failed to reconnect, trying again in %d seconds\n", t);
+ D(SYSTEM, "failed to reconnect, trying again in %d seconds\n", t);
uloop_timeout_set(&retry, t * 1000);
return;
}
- DPRINTF("reconnected to ubus, new id: %08x\n", ubus_ctx->local_id);
+ D(SYSTEM, "reconnected to ubus, new id: %08x\n", ubus_ctx->local_id);
netifd_ubus_add_fd();
}
if (!ubus_ctx)
return -EIO;
- DPRINTF("connected as %08x\n", ubus_ctx->local_id);
+ D(SYSTEM, "connected as %08x\n", ubus_ctx->local_id);
ubus_ctx->connection_lost = netifd_ubus_connection_lost;
netifd_ubus_add_fd();
obj->methods = iface_object_methods;
obj->n_methods = ARRAY_SIZE(iface_object_methods);
if (ubus_add_object(ubus_ctx, &iface->ubus)) {
- DPRINTF("failed to publish ubus object for interface '%s'\n", iface->name);
+ D(SYSTEM, "failed to publish ubus object for interface '%s'\n", iface->name);
free(name);
obj->name = NULL;
}