mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 13:24:43 -04:00
Expose a function to add a nameserver by sockaddr
This commit is contained in:
parent
fab50488fc
commit
195214360c
12
evdns.c
12
evdns.c
@ -2499,6 +2499,18 @@ evdns_nameserver_ip_add(const char *ip_as_string) {
|
||||
return evdns_base_nameserver_ip_add(current_base, ip_as_string);
|
||||
}
|
||||
|
||||
int
|
||||
evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
|
||||
const struct sockaddr *sa, ev_socklen_t len, unsigned flags)
|
||||
{
|
||||
int res;
|
||||
EVUTIL_ASSERT(base);
|
||||
EVDNS_LOCK(base);
|
||||
res = _evdns_nameserver_add_impl(base, sa, len);
|
||||
EVDNS_UNLOCK(base);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* remove from the queue */
|
||||
static void
|
||||
evdns_request_remove(struct request *req, struct request **head)
|
||||
|
@ -288,7 +288,7 @@ int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
|
||||
int evdns_base_resume(struct evdns_base *base);
|
||||
|
||||
/**
|
||||
Add a nameserver.
|
||||
Add a nameserver by string address.
|
||||
|
||||
This function parses a n IPv4 or IPv6 address from a string and adds it as a
|
||||
nameserver. It supports the following formats:
|
||||
@ -307,6 +307,13 @@ int evdns_base_resume(struct evdns_base *base);
|
||||
int evdns_base_nameserver_ip_add(struct evdns_base *base,
|
||||
const char *ip_as_string);
|
||||
|
||||
/**
|
||||
Add a nameserver by sockaddr.
|
||||
**/
|
||||
int
|
||||
evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
|
||||
const struct sockaddr *sa, ev_socklen_t len, unsigned flags);
|
||||
|
||||
struct evdns_request;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user