]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp-option: drop unused sd_dhcp_option
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 26 Apr 2026 04:22:07 +0000 (13:22 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 12 May 2026 11:06:28 +0000 (20:06 +0900)
src/libsystemd-network/dhcp-option.c
src/libsystemd-network/dhcp-option.h
src/systemd/meson.build
src/systemd/sd-dhcp-client.h
src/systemd/sd-dhcp-option.h [deleted file]
src/systemd/sd-dhcp-server.h

index 75470cb3d6eae0b438fbbbe4c0791b6995e592e0..da5fd64af67c20606baec41f6c9e7ef2e09c39aa 100644 (file)
@@ -434,43 +434,3 @@ int dhcp_option_parse_hostname(const uint8_t *option, size_t len, char **ret) {
         *ret = TAKE_PTR(hostname);
         return 0;
 }
-
-static sd_dhcp_option* dhcp_option_free(sd_dhcp_option *i) {
-        if (!i)
-                return NULL;
-
-        free(i->data);
-        return mfree(i);
-}
-
-int sd_dhcp_option_new(uint8_t option, const void *data, size_t length, sd_dhcp_option **ret) {
-        assert_return(ret, -EINVAL);
-        assert_return(length == 0 || data, -EINVAL);
-
-        _cleanup_free_ void *q = memdup(data, length);
-        if (!q)
-                return -ENOMEM;
-
-        sd_dhcp_option *p = new(sd_dhcp_option, 1);
-        if (!p)
-                return -ENOMEM;
-
-        *p = (sd_dhcp_option) {
-                .n_ref = 1,
-                .option = option,
-                .length = length,
-                .data = TAKE_PTR(q),
-        };
-
-        *ret = TAKE_PTR(p);
-        return 0;
-}
-
-DEFINE_TRIVIAL_REF_UNREF_FUNC(sd_dhcp_option, sd_dhcp_option, dhcp_option_free);
-DEFINE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
-                dhcp_option_hash_ops,
-                void,
-                trivial_hash_func,
-                trivial_compare_func,
-                sd_dhcp_option,
-                sd_dhcp_option_unref);
index 5ca1cafe388aee26474774ef017a43756d159807..f0afd892e68c0fc34dd8fde8e4a9f3435931f028 100644 (file)
@@ -1,21 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dhcp-option.h" /* IWYU pragma: export */
-
 #include "dhcp-protocol.h"
 #include "sd-forward.h"
-#include "hash-funcs.h"
-
-struct sd_dhcp_option {
-        unsigned n_ref;
-
-        uint8_t option;
-        void *data;
-        size_t length;
-};
-
-extern const struct hash_ops dhcp_option_hash_ops;
 
 typedef struct DHCPServerData {
         struct in_addr *addr;
index d7335cee558de24a0e90f30c84d30d93dfdcd0d4..ad455d73b217b0517787695e8f803352a68269e8 100644 (file)
@@ -28,7 +28,6 @@ _not_installed_headers = [
         'sd-dhcp-client.h',
         'sd-dhcp-duid.h',
         'sd-dhcp-lease.h',
-        'sd-dhcp-option.h',
         'sd-dhcp-protocol.h',
         'sd-dhcp-server-lease.h',
         'sd-dhcp-server.h',
index f7c5602b6655ee90c604bd42f5950cb717bce05c..c83aaac2c9d38cc6e84814ad249a11cedb3a271b 100644 (file)
@@ -30,7 +30,6 @@ struct in_addr;
 typedef struct sd_device sd_device;
 typedef struct sd_dhcp_client_id sd_dhcp_client_id;
 typedef struct sd_dhcp_lease sd_dhcp_lease;
-typedef struct sd_dhcp_option sd_dhcp_option;
 typedef struct sd_event sd_event;
 
 enum {
diff --git a/src/systemd/sd-dhcp-option.h b/src/systemd/sd-dhcp-option.h
deleted file mode 100644 (file)
index edc671b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#ifndef foosddhcpoptionhfoo
-#define foosddhcpoptionhfoo
-
-/***
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <https://www.gnu.org/licenses/>.
-***/
-
-#include "_sd-common.h"
-#include "sd-dhcp-protocol.h"   /* IWYU pragma: export */
-
-_SD_BEGIN_DECLARATIONS;
-
-typedef struct sd_dhcp_option sd_dhcp_option;
-
-int sd_dhcp_option_new(uint8_t option, const void *data, size_t length, sd_dhcp_option **ret);
-_SD_DECLARE_TRIVIAL_REF_UNREF_FUNC(sd_dhcp_option);
-
-_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_dhcp_option, sd_dhcp_option_unref);
-
-_SD_END_DECLARATIONS;
-
-#endif
index c17cd6b7b68eaaf45e0e2b1c91ad4f221fb94f94..4f2fc688352cfa7ccc380261b2e90202a46f7ca1 100644 (file)
@@ -26,7 +26,6 @@
 _SD_BEGIN_DECLARATIONS;
 
 typedef struct sd_event sd_event;
-typedef struct sd_dhcp_option sd_dhcp_option;
 typedef struct sd_dhcp_server sd_dhcp_server;
 
 enum {