Lines Matching refs:servers

135 	struct sockaddr *addr = &ctx->servers[idx].dns_server;  in dns_postprocess_server()
138 ctx->servers[idx].is_mdns = server_is_mdns(AF_INET, addr); in dns_postprocess_server()
139 if (!ctx->servers[idx].is_mdns) { in dns_postprocess_server()
140 ctx->servers[idx].is_llmnr = in dns_postprocess_server()
146 ctx->servers[idx].is_mdns) { in dns_postprocess_server()
154 ctx->servers[idx].is_llmnr) { in dns_postprocess_server()
166 ctx->servers[idx].is_mdns = server_is_mdns(AF_INET6, addr); in dns_postprocess_server()
167 if (!ctx->servers[idx].is_mdns) { in dns_postprocess_server()
168 ctx->servers[idx].is_llmnr = in dns_postprocess_server()
174 ctx->servers[idx].is_mdns) { in dns_postprocess_server()
177 ctx->servers[idx].is_llmnr) { in dns_postprocess_server()
188 const char *servers[], in dns_resolve_init_locked() argument
218 if (servers) { in dns_resolve_init_locked()
219 for (i = 0; idx < SERVER_COUNT && servers[i]; i++) { in dns_resolve_init_locked()
220 struct sockaddr *addr = &ctx->servers[idx].dns_server; in dns_resolve_init_locked()
224 ret = net_ipaddr_parse(servers[i], strlen(servers[i]), in dns_resolve_init_locked()
232 NET_DBG("[%d] %s%s%s", i, servers[i], in dns_resolve_init_locked()
234 (ctx->servers[i].is_mdns ? " mDNS" : "") : "", in dns_resolve_init_locked()
236 (ctx->servers[i].is_llmnr ? in dns_resolve_init_locked()
244 memcpy(&ctx->servers[idx].dns_server, servers_sa[i], in dns_resolve_init_locked()
245 sizeof(ctx->servers[idx].dns_server)); in dns_resolve_init_locked()
252 i < SERVER_COUNT && ctx->servers[i].dns_server.sa_family; i++) { in dns_resolve_init_locked()
254 if (ctx->servers[i].dns_server.sa_family == AF_INET6) { in dns_resolve_init_locked()
260 ctx->servers[i].is_mdns) { in dns_resolve_init_locked()
268 if (ctx->servers[i].dns_server.sa_family == AF_INET) { in dns_resolve_init_locked()
274 ctx->servers[i].is_mdns) { in dns_resolve_init_locked()
288 ret = net_context_get(ctx->servers[i].dns_server.sa_family, in dns_resolve_init_locked()
290 &ctx->servers[i].net_ctx); in dns_resolve_init_locked()
296 ret = net_context_bind(ctx->servers[i].net_ctx, in dns_resolve_init_locked()
303 iface = net_context_get_iface(ctx->servers[i].net_ctx); in dns_resolve_init_locked()
308 iface, (void *)&ctx->servers[i].dns_server, in dns_resolve_init_locked()
340 int dns_resolve_init(struct dns_resolve_context *ctx, const char *servers[], in dns_resolve_init() argument
355 return dns_resolve_init_locked(ctx, servers, servers_sa); in dns_resolve_init()
828 if (!ctx->servers[j].net_ctx) { in cb_recv()
889 net_ctx = ctx->servers[server_idx].net_ctx; in dns_write()
890 server = &ctx->servers[server_idx].dns_server; in dns_write()
1255 if (!ctx->servers[j].net_ctx) { in dns_resolve_name()
1263 !ctx->servers[j].is_mdns) { in dns_resolve_name()
1271 if (!ctx->servers[j].is_llmnr) { in dns_resolve_name()
1350 if (ctx->servers[i].net_ctx) { in dns_resolve_close_locked()
1353 iface = net_context_get_iface(ctx->servers[i].net_ctx); in dns_resolve_close_locked()
1359 (void *)&ctx->servers[i].dns_server, in dns_resolve_close_locked()
1366 net_context_put(ctx->servers[i].net_ctx); in dns_resolve_close_locked()
1367 ctx->servers[i].net_ctx = NULL; in dns_resolve_close_locked()
1394 (ctx->servers[i].dns_server.sa_family == AF_INET)) { in dns_server_exists()
1396 &net_sin(&ctx->servers[i].dns_server)->sin_addr)) { in dns_server_exists()
1402 (ctx->servers[i].dns_server.sa_family == AF_INET6)) { in dns_server_exists()
1404 &net_sin6(&ctx->servers[i].dns_server)->sin6_addr)) { in dns_server_exists()
1414 const char *servers[], in dns_servers_exists() argument
1417 if (servers) { in dns_servers_exists()
1418 for (int i = 0; i < SERVER_COUNT && servers[i]; i++) { in dns_servers_exists()
1421 if (!net_ipaddr_parse(servers[i], strlen(servers[i]), &addr)) { in dns_servers_exists()
1443 const char *servers[], in dns_resolve_reconfigure() argument
1454 if (dns_servers_exists(ctx, servers, servers_sa)) { in dns_resolve_reconfigure()
1474 err = dns_resolve_init_locked(ctx, servers, servers_sa); in dns_resolve_reconfigure()