]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: make several type systems static
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Jun 2021 07:07:21 +0000 (16:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 29 Aug 2021 08:18:11 +0000 (17:18 +0900)
src/libsystemd/sd-netlink/netlink-types.c
src/libsystemd/sd-netlink/netlink-types.h

index 80492af0dd5c5ec4650b619e3c3edcf6f0581dc1..38ea22bfd9871e2007ab9ab0c3d96954285de541 100644 (file)
@@ -1098,7 +1098,7 @@ static const NLType rtnl_types[] = {
         [RTM_GETMDB]       = { .type = NETLINK_TYPE_NESTED, .type_system = &rtnl_mdb_type_system, .size = sizeof(struct br_port_msg) },
 };
 
-const NLTypeSystem rtnl_type_system_root = {
+static const NLTypeSystem rtnl_type_system_root = {
         .count = ELEMENTSOF(rtnl_types),
         .types = rtnl_types,
 };
@@ -1337,7 +1337,7 @@ static const NLType nfnl_types[] = {
         [NFNL_SUBSYS_NFTABLES] = { .type = NETLINK_TYPE_NESTED, .type_system = &nfnl_nft_msg_type_system, .size = sizeof(struct nfgenmsg) },
 };
 
-const NLTypeSystem nfnl_type_system_root = {
+static const NLTypeSystem nfnl_type_system_root = {
         .count = ELEMENTSOF(nfnl_types),
         .types = nfnl_types,
 };
@@ -1708,7 +1708,7 @@ static const NLType genl_types[] = {
 };
 
 /* Mainly used when message received */
-const NLTypeSystem genl_type_system_root = {
+static const NLTypeSystem genl_type_system_root = {
         .count = ELEMENTSOF(genl_types),
         .types = genl_types,
 };
@@ -1742,7 +1742,7 @@ uint16_t type_system_get_count(const NLTypeSystem *type_system) {
         return type_system->count;
 }
 
-const NLTypeSystem *type_system_get_root(int protocol) {
+static const NLTypeSystem *type_system_get_root(int protocol) {
         switch (protocol) {
                 case NETLINK_GENERIC:
                         return &genl_type_system_root;
index 5c292ab2b39475c2c20e1e292c19c85642453264..b78ed21a4182af7beeb3013e0928c5df7d878277 100644 (file)
@@ -42,7 +42,6 @@ size_t type_get_size(const NLType *type);
 const NLTypeSystem *type_get_type_system(const NLType *type);
 const NLTypeSystemUnion *type_get_type_system_union(const NLType *type);
 
-const NLTypeSystem* type_system_get_root(int protocol);
 uint16_t type_system_get_count(const NLTypeSystem *type_system);
 int type_system_root_get_type(sd_netlink *nl, const NLType **ret, uint16_t type);
 int type_system_get_type(const NLTypeSystem *type_system, const NLType **ret, uint16_t type);