[ -n "$3" ] && json_add_boolean "address-external" "$external"
}
+proto_add_dns_server() {
+ local address="$1"
+
+ jshn_append PROTO_DNS "$address"
+}
+
proto_add_ipv4_address() {
local address="$1"
local mask="$2"
_proto_push_array "ip6addr" "$PROTO_IP6ADDR" _proto_push_ip
_proto_push_array "route" "$PROTO_ROUTE" _proto_push_route
_proto_push_array "route6" "$PROTO_ROUTE6" _proto_push_route
+ _proto_push_array "dns" "$PROTO_DNS" _proto_push_ip
_proto_notify
}
echo "pppoe_setup($1, $2), username=$username, password=$password"
proto_init_update ppp0 1
proto_add_ipv4_address "192.168.2.1" 32
+ proto_add_dns_server "192.168.2.2"
proto_send_update "$1"
proto_run_command sleep 10
}
return;
add:
+ D(INTERFACE, "Add IPv%c DNS server: %s\n",
+ s->af == AF_INET6 ? '6' : '4', str);
list_add_tail(&s->list, &iface->proto_dns_servers);
}
NOTIFY_IP6ADDR,
NOTIFY_ROUTES,
NOTIFY_ROUTES6,
+ NOTIFY_DNS,
__NOTIFY_LAST
};
[NOTIFY_IP6ADDR] = { .name = "ip6addr", .type = BLOBMSG_TYPE_ARRAY },
[NOTIFY_ROUTES] = { .name = "routes", .type = BLOBMSG_TYPE_ARRAY },
[NOTIFY_ROUTES6] = { .name = "routes6", .type = BLOBMSG_TYPE_ARRAY },
+ [NOTIFY_DNS] = { .name = "dns", .type = BLOBMSG_TYPE_ARRAY },
};
static int
if ((cur = tb[NOTIFY_ROUTES6]) != NULL)
proto_shell_parse_route_list(state->proto.iface, cur, true);
+ if ((cur = tb[NOTIFY_DNS]) != NULL)
+ interface_add_dns_server_list(state->proto.iface, cur);
+
return 0;
}