mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 15:09:14 +02:00
MINOR: resolvers: renames some resolvers specific types to not use dns prefix
This patch applies those changes on names:
-struct dns_resolution {
+struct resolv_resolution {
-struct dns_requester {
+struct resolv_requester {
-struct dns_srvrq {
+struct resolv_srvrq {
@@ -185,12 +185,12 @@ struct stream {
struct {
- struct dns_requester *dns_requester;
+ struct resolv_requester *requester;
...
- } dns_ctx;
+ } resolv_ctx;
This commit is contained in:
committed by
Willy Tarreau
parent
750fe79cd0
commit
08622d3c0a
@@ -27,8 +27,8 @@
|
||||
#include <haproxy/list.h>
|
||||
#include <haproxy/sample.h>
|
||||
|
||||
int act_resolution_cb(struct dns_requester *requester, struct dns_counters *counters);
|
||||
int act_resolution_error_cb(struct dns_requester *requester, int error_code);
|
||||
int act_resolution_cb(struct resolv_requester *requester, struct dns_counters *counters);
|
||||
int act_resolution_error_cb(struct resolv_requester *requester, int error_code);
|
||||
|
||||
static inline struct action_kw *action_lookup(struct list *keywords, const char *kw)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <haproxy/task-t.h>
|
||||
#include <haproxy/thread.h>
|
||||
|
||||
extern struct pool_head *dns_requester_pool;
|
||||
extern struct pool_head *resolv_requester_pool;
|
||||
|
||||
/*DNS maximum values */
|
||||
/*
|
||||
@@ -260,7 +260,7 @@ struct dns_options {
|
||||
* The only link between the resolution and a nameserver is through the
|
||||
* query_id.
|
||||
*/
|
||||
struct dns_resolution {
|
||||
struct resolv_resolution {
|
||||
struct resolvers *resolvers; /* pointer to the resolvers structure owning the resolution */
|
||||
struct list requesters; /* list of requesters using this resolution */
|
||||
int uuid; /* unique id (used for debugging purpose) */
|
||||
@@ -286,12 +286,12 @@ struct dns_resolution {
|
||||
};
|
||||
|
||||
/* Structure used to describe the owner of a DNS resolution. */
|
||||
struct dns_requester {
|
||||
struct resolv_requester {
|
||||
enum obj_type *owner; /* pointer to the owner (server or dns_srvrq) */
|
||||
struct dns_resolution *resolution; /* pointer to the owned DNS resolution */
|
||||
struct resolv_resolution *resolution; /* pointer to the owned DNS resolution */
|
||||
|
||||
int (*requester_cb)(struct dns_requester *, struct dns_counters *); /* requester callback for valid response */
|
||||
int (*requester_error_cb)(struct dns_requester *, int); /* requester callback, for error management */
|
||||
int (*requester_cb)(struct resolv_requester *, struct dns_counters *); /* requester callback for valid response */
|
||||
int (*requester_error_cb)(struct resolv_requester *, int); /* requester callback, for error management */
|
||||
|
||||
struct list list; /* requester list */
|
||||
};
|
||||
@@ -348,14 +348,14 @@ enum {
|
||||
};
|
||||
|
||||
struct proxy;
|
||||
struct dns_srvrq {
|
||||
struct resolv_srvrq {
|
||||
enum obj_type obj_type; /* object type == OBJ_TYPE_SRVRQ */
|
||||
struct resolvers *resolvers; /* pointer to the resolvers structure used for this server template */
|
||||
struct proxy *proxy; /* associated proxy */
|
||||
char *name;
|
||||
char *hostname_dn; /* server hostname in Domain Name format */
|
||||
int hostname_dn_len; /* string length of the server hostname in Domain Name format */
|
||||
struct dns_requester *dns_requester; /* used to link to its DNS resolution */
|
||||
struct resolv_requester *requester; /* used to link to its DNS resolution */
|
||||
struct list list; /* Next SRV RQ for the same proxy */
|
||||
};
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ extern struct list sec_resolvers;
|
||||
extern unsigned int dns_failed_resolutions;
|
||||
|
||||
struct resolvers *find_resolvers_by_id(const char *id);
|
||||
struct dns_srvrq *find_srvrq_by_name(const char *name, struct proxy *px);
|
||||
struct dns_srvrq *new_dns_srvrq(struct server *srv, char *fqdn);
|
||||
struct resolv_srvrq *find_srvrq_by_name(const char *name, struct proxy *px);
|
||||
struct resolv_srvrq *new_resolv_srvrq(struct server *srv, char *fqdn);
|
||||
|
||||
int dns_str_to_dn_label(const char *str, int str_len, char *dn, int dn_len);
|
||||
int dns_dn_label_to_str(const char *dn, int dn_len, char *str, int str_len);
|
||||
@@ -43,8 +43,8 @@ int dns_get_ip_from_response(struct resolv_response *r_res,
|
||||
void *owner);
|
||||
|
||||
int dns_link_resolution(void *requester, int requester_type, int requester_locked);
|
||||
void dns_unlink_resolution(struct dns_requester *requester);
|
||||
void dns_trigger_resolution(struct dns_requester *requester);
|
||||
void dns_unlink_resolution(struct resolv_requester *requester);
|
||||
void dns_trigger_resolution(struct resolv_requester *requester);
|
||||
enum act_parse_ret dns_parse_do_resolve(const char **args, int *orig_arg, struct proxy *px, struct act_rule *rule, char **err);
|
||||
int check_action_do_resolve(struct act_rule *rule, struct proxy *px, char **err);
|
||||
|
||||
|
||||
@@ -150,16 +150,16 @@ static inline struct connection *objt_conn(enum obj_type *t)
|
||||
return __objt_conn(t);
|
||||
}
|
||||
|
||||
static inline struct dns_srvrq *__objt_dns_srvrq(enum obj_type *t)
|
||||
static inline struct resolv_srvrq *__objt_resolv_srvrq(enum obj_type *t)
|
||||
{
|
||||
return container_of(t, struct dns_srvrq, obj_type);
|
||||
return container_of(t, struct resolv_srvrq, obj_type);
|
||||
}
|
||||
|
||||
static inline struct dns_srvrq *objt_dns_srvrq(enum obj_type *t)
|
||||
static inline struct resolv_srvrq *objt_resolv_srvrq(enum obj_type *t)
|
||||
{
|
||||
if (!t || *t != OBJ_TYPE_SRVRQ)
|
||||
return NULL;
|
||||
return __objt_dns_srvrq(t);
|
||||
return __objt_resolv_srvrq(t);
|
||||
}
|
||||
|
||||
static inline struct stream *__objt_stream(enum obj_type *t)
|
||||
@@ -196,7 +196,7 @@ static inline void *obj_base_ptr(enum obj_type *t)
|
||||
case OBJ_TYPE_APPLET: return __objt_applet(t);
|
||||
case OBJ_TYPE_APPCTX: return __objt_appctx(t);
|
||||
case OBJ_TYPE_CONN: return __objt_conn(t);
|
||||
case OBJ_TYPE_SRVRQ: return __objt_dns_srvrq(t);
|
||||
case OBJ_TYPE_SRVRQ: return __objt_resolv_srvrq(t);
|
||||
case OBJ_TYPE_CS: return __objt_cs(t);
|
||||
case OBJ_TYPE_STREAM: return __objt_stream(t);
|
||||
case OBJ_TYPE_CHECK: return __objt_check(t);
|
||||
|
||||
@@ -292,7 +292,7 @@ struct server {
|
||||
struct check check; /* health-check specific configuration */
|
||||
struct check agent; /* agent specific configuration */
|
||||
|
||||
struct dns_requester *dns_requester; /* used to link a server to its DNS resolution */
|
||||
struct resolv_requester *resolv_requester; /* used to link a server to its DNS resolution */
|
||||
char *resolvers_id; /* resolvers section used by this server */
|
||||
struct resolvers *resolvers; /* pointer to the resolvers structure used by this server */
|
||||
char *lastaddr; /* the address string provided by the server-state file */
|
||||
@@ -342,7 +342,7 @@ struct server {
|
||||
struct eb_root cids; /* QUIC connections IDs. */
|
||||
#endif
|
||||
#endif
|
||||
struct dns_srvrq *srvrq; /* Pointer representing the DNS SRV requeest, if any */
|
||||
struct resolv_srvrq *srvrq; /* Pointer representing the DNS SRV requeest, if any */
|
||||
struct {
|
||||
const char *file; /* file where the section appears */
|
||||
struct eb32_node id; /* place in the tree of used IDs */
|
||||
|
||||
@@ -60,8 +60,8 @@ struct server *new_server(struct proxy *proxy);
|
||||
/* functions related to server name resolution */
|
||||
int snr_update_srv_status(struct server *s, int has_no_ip);
|
||||
const char *update_server_fqdn(struct server *server, const char *fqdn, const char *updater, int dns_locked);
|
||||
int snr_resolution_cb(struct dns_requester *requester, struct dns_counters *counters);
|
||||
int snr_resolution_error_cb(struct dns_requester *requester, int error_code);
|
||||
int snr_resolution_cb(struct resolv_requester *requester, struct dns_counters *counters);
|
||||
int snr_resolution_error_cb(struct resolv_requester *requester, int error_code);
|
||||
struct server *snr_check_ip_callback(struct server *srv, void *ip, unsigned char *ip_family);
|
||||
struct task *srv_cleanup_idle_connections(struct task *task, void *ctx, unsigned short state);
|
||||
struct task *srv_cleanup_toremove_connections(struct task *task, void *context, unsigned short state);
|
||||
|
||||
@@ -185,12 +185,12 @@ struct stream {
|
||||
|
||||
/* Context */
|
||||
struct {
|
||||
struct dns_requester *dns_requester; /* owner of the resolution */
|
||||
struct resolv_requester *requester; /* owner of the resolution */
|
||||
char *hostname_dn; /* hostname being resolve, in domain name format */
|
||||
int hostname_dn_len; /* size of hostname_dn */
|
||||
/* 4 unused bytes here */
|
||||
struct act_rule *parent; /* rule which requested this resolution */
|
||||
} dns_ctx; /* context information for DNS resolution */
|
||||
} resolv_ctx; /* context information for DNS resolution */
|
||||
|
||||
int tunnel_timeout;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user