]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/addns: Make some functions static
authorVolker Lendecke <vl@samba.org>
Thu, 14 May 2026 08:29:40 +0000 (10:29 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 3 Jul 2026 08:08:36 +0000 (08:08 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/addns/dns.h
lib/addns/dnsmarshall.c
lib/addns/dnsrecord.c
lib/addns/dnssock.c

index 72fc08eb542cc9dd17ad090745425801b47e0ec2..757f7c2f4970f7f3310ce5ef4a1ff428d3c2bddc 100644 (file)
@@ -188,10 +188,6 @@ DNS_ERROR dns_create_query( TALLOC_CTX *mem_ctx, const char *name,
                            struct dns_request **preq );
 DNS_ERROR dns_create_update( TALLOC_CTX *mem_ctx, const char *name,
                             struct dns_update_request **preq );
-DNS_ERROR dns_create_rrec(TALLOC_CTX *mem_ctx, const char *name,
-                         uint16_t type, uint16_t r_class, uint32_t ttl,
-                         uint16_t data_length, uint8_t *data,
-                         struct dns_rrec **prec);
 DNS_ERROR dns_add_rrec(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
                       uint16_t *num_records, struct dns_rrec ***records);
 DNS_ERROR dns_create_a_record(TALLOC_CTX *mem_ctx, const char *host,
@@ -206,9 +202,6 @@ DNS_ERROR dns_create_aaaa_record(TALLOC_CTX *mem_ctx, const char *host,
 DNS_ERROR dns_open_connection( const char *nameserver, int32_t dwType,
                    TALLOC_CTX *mem_ctx,
                    struct dns_connection **conn );
-DNS_ERROR dns_send(struct dns_connection *conn, const struct dns_buffer *buf);
-DNS_ERROR dns_receive(TALLOC_CTX *mem_ctx, struct dns_connection *conn,
-                     struct dns_buffer **presult);
 DNS_ERROR dns_transaction(TALLOC_CTX *mem_ctx, struct dns_connection *conn,
                          const struct dns_request *req,
                          struct dns_request **resp);
@@ -219,32 +212,12 @@ DNS_ERROR dns_update_transaction(TALLOC_CTX *mem_ctx,
 
 /* from dnsmarshall.c */
 
-struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx);
-void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
-                        size_t len);
-void dns_marshall_uint16(struct dns_buffer *buf, uint16_t val);
-void dns_marshall_uint32(struct dns_buffer *buf, uint32_t val);
-void dns_unmarshall_buffer(struct dns_buffer *buf, uint8_t *data,
-                          size_t len);
-void dns_unmarshall_uint16(struct dns_buffer *buf, uint16_t *val);
-void dns_unmarshall_uint32(struct dns_buffer *buf, uint32_t *val);
-void dns_unmarshall_domain_name(TALLOC_CTX *mem_ctx,
-                               struct dns_buffer *buf,
-                               struct dns_domain_name **pname);
-void dns_marshall_domain_name(struct dns_buffer *buf,
-                             const struct dns_domain_name *name);
-void dns_unmarshall_domain_name(TALLOC_CTX *mem_ctx,
-                               struct dns_buffer *buf,
-                               struct dns_domain_name **pname);
 DNS_ERROR dns_marshall_request(TALLOC_CTX *mem_ctx,
                               const struct dns_request *req,
                               struct dns_buffer **pbuf);
 DNS_ERROR dns_unmarshall_request(TALLOC_CTX *mem_ctx,
                                 struct dns_buffer *buf,
                                 struct dns_request **preq);
-DNS_ERROR dns_marshall_update_request(TALLOC_CTX *mem_ctx,
-                                     struct dns_update_request *update,
-                                     struct dns_buffer **pbuf);
 struct dns_request *dns_update2request(struct dns_update_request *update);
 struct dns_update_request *dns_request2update(struct dns_request *request);
 uint16_t dns_response_code(uint16_t flags);
index f68d875cc0a959b2f288cf77a63f1622e8035e3d..04c97b0beec3a32be6d2253a5cd9a9aa448ac96e 100644 (file)
@@ -23,7 +23,7 @@
 #include "dns.h"
 #include "assert.h"
 
-struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx)
+static struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx)
 {
        struct dns_buffer *result;
 
@@ -47,8 +47,9 @@ struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx)
        return result;
 }
 
-void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
-                        size_t len)
+static void dns_marshall_buffer(struct dns_buffer *buf,
+                               const uint8_t *data,
+                               size_t len)
 {
        if (!ERR_DNS_IS_OK(buf->error)) return;
 
@@ -95,20 +96,21 @@ void dns_marshall_buffer(struct dns_buffer *buf, const uint8_t *data,
        return;
 }
 
-void dns_marshall_uint16(struct dns_buffer *buf, uint16_t val)
+static void dns_marshall_uint16(struct dns_buffer *buf, uint16_t val)
 {
        uint16_t n_val = htons(val);
        dns_marshall_buffer(buf, (uint8_t *)&n_val, sizeof(n_val));
 }
 
-void dns_marshall_uint32(struct dns_buffer *buf, uint32_t val)
+static void dns_marshall_uint32(struct dns_buffer *buf, uint32_t val)
 {
        uint32_t n_val = htonl(val);
        dns_marshall_buffer(buf, (uint8_t *)&n_val, sizeof(n_val));
 }
 
-void dns_unmarshall_buffer(struct dns_buffer *buf, uint8_t *data,
-                          size_t len)
+static void dns_unmarshall_buffer(struct dns_buffer *buf,
+                                 uint8_t *data,
+                                 size_t len)
 {
        if (!(ERR_DNS_IS_OK(buf->error))) return;
 
@@ -123,7 +125,7 @@ void dns_unmarshall_buffer(struct dns_buffer *buf, uint8_t *data,
        return;
 }
 
-void dns_unmarshall_uint16(struct dns_buffer *buf, uint16_t *val)
+static void dns_unmarshall_uint16(struct dns_buffer *buf, uint16_t *val)
 {
        uint16_t n_val;
 
@@ -133,7 +135,7 @@ void dns_unmarshall_uint16(struct dns_buffer *buf, uint16_t *val)
        *val = ntohs(n_val);
 }
 
-void dns_unmarshall_uint32(struct dns_buffer *buf, uint32_t *val)
+static void dns_unmarshall_uint32(struct dns_buffer *buf, uint32_t *val)
 {
        uint32_t n_val;
 
@@ -143,8 +145,8 @@ void dns_unmarshall_uint32(struct dns_buffer *buf, uint32_t *val)
        *val = ntohl(n_val);
 }
 
-void dns_marshall_domain_name(struct dns_buffer *buf,
-                             const struct dns_domain_name *name)
+static void dns_marshall_domain_name(struct dns_buffer *buf,
+                                    const struct dns_domain_name *name)
 {
        struct dns_domain_label *label;
        char end_char = '\0';
@@ -244,9 +246,9 @@ static void dns_unmarshall_label(TALLOC_CTX *mem_ctx,
        return;
 }
 
-void dns_unmarshall_domain_name(TALLOC_CTX *mem_ctx,
-                               struct dns_buffer *buf,
-                               struct dns_domain_name **pname)
+static void dns_unmarshall_domain_name(TALLOC_CTX *mem_ctx,
+                                      struct dns_buffer *buf,
+                                      struct dns_domain_name **pname)
 {
        struct dns_domain_name *name;
 
@@ -508,13 +510,6 @@ struct dns_update_request *dns_request2update(struct dns_request *request)
        return (struct dns_update_request *)(void *)request;
 }
 
-DNS_ERROR dns_marshall_update_request(TALLOC_CTX *mem_ctx,
-                                     struct dns_update_request *update,
-                                     struct dns_buffer **pbuf)
-{
-       return dns_marshall_request(mem_ctx, dns_update2request(update), pbuf);
-}
-
 uint16_t dns_response_code(uint16_t flags)
 {
        return flags & 0xF;
index d8a29453f177682bdf2247b328cd2f092a8979f7..73d62179e184cca5464fd61dd29038ddd73d32b6 100644 (file)
@@ -91,7 +91,7 @@ DNS_ERROR dns_create_update( TALLOC_CTX *mem_ctx, const char *name,
        return ERROR_DNS_SUCCESS;
 }
 
-DNS_ERROR dns_create_rrec(TALLOC_CTX *mem_ctx, const char *name,
+static DNS_ERROR dns_create_rrec(TALLOC_CTX *mem_ctx, const char *name,
                          uint16_t type, uint16_t r_class, uint32_t ttl,
                          uint16_t data_length, uint8_t *data,
                          struct dns_rrec **prec)
index 11f2e00a57b5f772a9ffe2ecbdf8415100ce58f3..aec32ecd32188f68c91bebf0634d24f79de6a0fe 100644 (file)
@@ -231,7 +231,8 @@ static DNS_ERROR dns_send_udp(struct dns_connection *conn,
        return ERROR_DNS_SUCCESS;
 }
 
-DNS_ERROR dns_send(struct dns_connection *conn, const struct dns_buffer *buf)
+static DNS_ERROR dns_send(struct dns_connection *conn,
+                         const struct dns_buffer *buf)
 {
        if (conn->hType == DNS_TCP) {
                return dns_send_tcp(conn, buf);
@@ -364,8 +365,9 @@ static DNS_ERROR dns_receive_udp(TALLOC_CTX *mem_ctx,
        return ERROR_DNS_SUCCESS;
 }
 
-DNS_ERROR dns_receive(TALLOC_CTX *mem_ctx, struct dns_connection *conn,
-                     struct dns_buffer **presult)
+static DNS_ERROR dns_receive(TALLOC_CTX *mem_ctx,
+                            struct dns_connection *conn,
+                            struct dns_buffer **presult)
 {
        if (conn->hType == DNS_TCP) {
                return dns_receive_tcp(mem_ctx, conn, presult);