Skip to content

Commit

Permalink
route: move "include/netlink-private/socket.h" to lib/nl-core.h
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed Aug 1, 2023
1 parent 96e1cc5 commit 1acdc02
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ noinst_HEADERS = \
include/netlink-private/netlink.h \
include/netlink-private/object-api.h \
include/netlink-private/route/link/sriov.h \
include/netlink-private/socket.h \
include/netlink-private/types.h \
include/nl-aux-core/nl-core.h \
include/nl-aux-route/nl-route.h \
Expand Down Expand Up @@ -359,6 +358,7 @@ lib_libnl_3_la_SOURCES = \
lib/mpls.c \
lib/mpls.h \
lib/msg.c \
lib/nl-core.h \
lib/nl.c \
lib/object.c \
lib/socket.c \
Expand Down
14 changes: 3 additions & 11 deletions include/netlink-private/socket.h → lib/nl-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@
* Copyright (c) 2014 Thomas Graf <[email protected]>
*/

#ifndef NETLINK_SOCKET_PRIV_H_
#define NETLINK_SOCKET_PRIV_H_
#ifndef __LIB_NL_CORE_H__
#define __LIB_NL_CORE_H__

#include <netlink-private/netlink.h>

#ifdef __cplusplus
extern "C" {
#endif

int _nl_socket_is_local_port_unspecified (struct nl_sock *sk);
uint32_t _nl_socket_set_local_port_no_release(struct nl_sock *sk, int generate_other);

void _nl_socket_used_ports_release_all(const uint32_t *used_ports);
void _nl_socket_used_ports_set(uint32_t *used_ports, uint32_t port);

#ifdef __cplusplus
}
#endif

#endif
#endif /* __LIB_NL_CORE_H__ */
3 changes: 2 additions & 1 deletion lib/nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/

#include <netlink-private/netlink.h>
#include <netlink-private/socket.h>
#include "base/nl-base-utils.h"
#include <netlink/netlink.h>
#include <netlink/utils.h>
Expand All @@ -29,6 +28,8 @@
#include <netlink/attr.h>
#include <linux/socket.h>

#include "nl-core.h"

/**
* @defgroup core_types Data Types
*
Expand Down
3 changes: 2 additions & 1 deletion lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
#include "sys/socket.h"

#include <netlink-private/netlink.h>
#include <netlink-private/socket.h>
#include "base/nl-base-utils.h"
#include <netlink/netlink.h>
#include <netlink/utils.h>
#include <netlink/handlers.h>
#include <netlink/msg.h>
#include <netlink/attr.h>

#include "nl-core.h"

static int default_cb = NL_CB_DEFAULT;

static void _nl_init init_default_cb(void)
Expand Down
2 changes: 1 addition & 1 deletion tools/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ EXCLUDE_PATHS_TOPLEVEL+=(
"include/netlink-private/netlink.h"
"include/netlink-private/object-api.h"
"include/netlink-private/route/link/sriov.h"
"include/netlink-private/socket.h"
"include/netlink-private/types.h"
"include/netlink/addr.h"
"include/netlink/attr.h"
Expand Down Expand Up @@ -188,6 +187,7 @@ EXCLUDE_PATHS_TOPLEVEL+=(
"lib/netfilter/queue_msg.c"
"lib/netfilter/queue_msg_obj.c"
"lib/netfilter/queue_obj.c"
"lib/nl-core.h"
"lib/nl.c"
"lib/object.c"
"lib/route/act.c"
Expand Down

0 comments on commit 1acdc02

Please sign in to comment.