From: Volker Lendecke Date: Thu, 14 May 2026 08:29:40 +0000 (+0200) Subject: lib/addns: Make some functions static X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b91ca7f18e12910d89aa5ba15a8583f8ddd6b8b;p=thirdparty%2Fsamba.git lib/addns: Make some functions static Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- diff --git a/lib/addns/dns.h b/lib/addns/dns.h index 72fc08eb542..757f7c2f497 100644 --- a/lib/addns/dns.h +++ b/lib/addns/dns.h @@ -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); diff --git a/lib/addns/dnsmarshall.c b/lib/addns/dnsmarshall.c index f68d875cc0a..04c97b0beec 100644 --- a/lib/addns/dnsmarshall.c +++ b/lib/addns/dnsmarshall.c @@ -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; diff --git a/lib/addns/dnsrecord.c b/lib/addns/dnsrecord.c index d8a29453f17..73d62179e18 100644 --- a/lib/addns/dnsrecord.c +++ b/lib/addns/dnsrecord.c @@ -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) diff --git a/lib/addns/dnssock.c b/lib/addns/dnssock.c index 11f2e00a57b..aec32ecd321 100644 --- a/lib/addns/dnssock.c +++ b/lib/addns/dnssock.c @@ -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);