]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: obj: Add a new type of object, OBJ_TYPE_SRVRQ.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 4 Aug 2017 16:31:56 +0000 (18:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Aug 2017 14:32:49 +0000 (16:32 +0200)
dns_srvrq will be objects used for dealing with SRV records.

include/proto/obj_type.h
include/types/obj_type.h

index b64244fcc301e8a2dec87aa2156dc3909b85ff37..60265b5e137906f9c095c0972a7a9d72fd241bdb 100644 (file)
@@ -131,6 +131,18 @@ 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)
+{
+       return container_of(t, struct dns_srvrq, obj_type);
+}
+
+static inline struct dns_srvrq *objt_dns_srvrq(enum obj_type *t)
+{
+       if (!t || *t != OBJ_TYPE_SRVRQ)
+               return NULL;
+       return __objt_dns_srvrq(t);
+}
+
 static inline void *obj_base_ptr(enum obj_type *t)
 {
        switch (obj_type(t)) {
index 83a3e78268784aa951d99dcf6089912eef3d55eb..a6310cfc0dc4b45b6a6e37988409b081227e86f1 100644 (file)
@@ -39,6 +39,7 @@ enum obj_type {
        OBJ_TYPE_APPLET,       /* object is a struct applet */
        OBJ_TYPE_APPCTX,       /* object is a struct appctx */
        OBJ_TYPE_CONN,         /* object is a struct connection */
+       OBJ_TYPE_SRVRQ,        /* object is a struct dns_srvrq */
        OBJ_TYPE_ENTRIES       /* last one : number of entries */
 } __attribute__((packed)) ;