systemd,lldp: merge branch 'th/systemd-lldp'

This commit is contained in:
Thomas Haller
2016-02-29 14:26:16 +01:00
66 changed files with 88 additions and 162 deletions

View File

@@ -24,12 +24,14 @@
/********************************************************/ /********************************************************/
#define nm_auto(fcn) __attribute ((cleanup(fcn)))
/** /**
* nm_auto_free: * nm_auto_free:
* *
* Call free() on a variable location when it goes out of scope. * Call free() on a variable location when it goes out of scope.
*/ */
#define nm_auto_free __attribute__ ((cleanup(_nm_auto_free_impl))) #define nm_auto_free nm_auto(_nm_auto_free_impl)
GS_DEFINE_CLEANUP_FUNCTION(void*, _nm_auto_free_impl, free) GS_DEFINE_CLEANUP_FUNCTION(void*, _nm_auto_free_impl, free)
/********************************************************/ /********************************************************/

View File

@@ -103,9 +103,9 @@ libsystemd_nm_la_SOURCES = \
systemd/src/basic/random-util.c \ systemd/src/basic/random-util.c \
systemd/src/basic/random-util.h \ systemd/src/basic/random-util.h \
systemd/src/basic/refcnt.h \ systemd/src/basic/refcnt.h \
systemd/src/basic/set.h \
systemd/src/basic/siphash24.c \ systemd/src/basic/siphash24.c \
systemd/src/basic/siphash24.h \ systemd/src/basic/siphash24.h \
systemd/src/basic/set.h \
systemd/src/basic/socket-util.h \ systemd/src/basic/socket-util.h \
systemd/src/basic/sparse-endian.h \ systemd/src/basic/sparse-endian.h \
systemd/src/basic/stdio-util.h \ systemd/src/basic/stdio-util.h \
@@ -138,15 +138,15 @@ libsystemd_nm_la_SOURCES = \
systemd/src/libsystemd-network/dhcp6-network.c \ systemd/src/libsystemd-network/dhcp6-network.c \
systemd/src/libsystemd-network/dhcp6-option.c \ systemd/src/libsystemd-network/dhcp6-option.c \
systemd/src/libsystemd-network/dhcp6-protocol.h \ systemd/src/libsystemd-network/dhcp6-protocol.h \
systemd/src/libsystemd-network/lldp.h \ systemd/src/libsystemd-network/lldp-internal.c \
systemd/src/libsystemd-network/lldp-network.h \ systemd/src/libsystemd-network/lldp-internal.h \
systemd/src/libsystemd-network/lldp-network.c \ systemd/src/libsystemd-network/lldp-network.c \
systemd/src/libsystemd-network/lldp-tlv.c \ systemd/src/libsystemd-network/lldp-network.h \
systemd/src/libsystemd-network/lldp-tlv.h \
systemd/src/libsystemd-network/lldp-port.c \ systemd/src/libsystemd-network/lldp-port.c \
systemd/src/libsystemd-network/lldp-port.h \ systemd/src/libsystemd-network/lldp-port.h \
systemd/src/libsystemd-network/lldp-internal.h \ systemd/src/libsystemd-network/lldp-tlv.c \
systemd/src/libsystemd-network/lldp-internal.c \ systemd/src/libsystemd-network/lldp-tlv.h \
systemd/src/libsystemd-network/lldp.h \
systemd/src/libsystemd-network/network-internal.c \ systemd/src/libsystemd-network/network-internal.c \
systemd/src/libsystemd-network/network-internal.h \ systemd/src/libsystemd-network/network-internal.h \
systemd/src/libsystemd-network/sd-dhcp-client.c \ systemd/src/libsystemd-network/sd-dhcp-client.c \
@@ -164,11 +164,11 @@ libsystemd_nm_la_SOURCES = \
systemd/src/systemd/sd-dhcp-lease.h \ systemd/src/systemd/sd-dhcp-lease.h \
systemd/src/systemd/sd-dhcp6-client.h \ systemd/src/systemd/sd-dhcp6-client.h \
systemd/src/systemd/sd-dhcp6-lease.h \ systemd/src/systemd/sd-dhcp6-lease.h \
systemd/src/systemd/sd-lldp.h \
systemd/src/systemd/sd-event.h \ systemd/src/systemd/sd-event.h \
systemd/src/systemd/sd-id128.h \ systemd/src/systemd/sd-id128.h \
systemd/src/systemd/sd-ipv4acd.h \ systemd/src/systemd/sd-ipv4acd.h \
systemd/src/systemd/sd-ipv4ll.h \ systemd/src/systemd/sd-ipv4ll.h \
systemd/src/systemd/sd-lldp.h \
systemd/src/systemd/sd-ndisc.h systemd/src/systemd/sd-ndisc.h
libsystemd_nm_la_CPPFLAGS = \ libsystemd_nm_la_CPPFLAGS = \

View File

@@ -65,6 +65,32 @@ typedef struct {
static void process_lldp_neighbors (NMLldpListener *self); static void process_lldp_neighbors (NMLldpListener *self);
/*****************************************************************************/
#define _NMLOG_PREFIX_NAME "lldp"
#define _NMLOG_DOMAIN LOGD_DEVICE
#define _NMLOG(level, ...) \
G_STMT_START { \
const NMLogLevel _level = (level); \
\
if (nm_logging_enabled (_level, _NMLOG_DOMAIN)) { \
char _sbuf[64]; \
int _ifindex = (self) ? NM_LLDP_LISTENER_GET_PRIVATE (self)->ifindex : 0; \
\
_nm_log (_level, _NMLOG_DOMAIN, 0, \
"%s%s: " _NM_UTILS_MACRO_FIRST (__VA_ARGS__), \
_NMLOG_PREFIX_NAME, \
((_ifindex > 0) \
? nm_sprintf_buf (_sbuf, "[%p,%d]", (self), _ifindex) \
: ((self) \
? nm_sprintf_buf (_sbuf, "[%p]", (self)) \
: "")) \
_NM_UTILS_MACRO_REST (__VA_ARGS__)); \
} \
} G_STMT_END \
/*****************************************************************************/
static void static void
gvalue_destroy (gpointer data) gvalue_destroy (gpointer data)
{ {
@@ -100,11 +126,13 @@ static guint
lldp_neighbor_id_hash (gconstpointer ptr) lldp_neighbor_id_hash (gconstpointer ptr)
{ {
const LLDPNeighbor *neigh = ptr; const LLDPNeighbor *neigh = ptr;
guint hash;
return g_str_hash (neigh->chassis_id) ^ hash = 23423423u + ((guint) (neigh->chassis_id ? g_str_hash (neigh->chassis_id) : 12321u));
g_str_hash (neigh->port_id) ^ hash = (hash * 33u) + ((guint) (neigh->port_id ? g_str_hash (neigh->port_id) : 34342343u));
neigh->chassis_id_type ^ hash = (hash * 33u) + ((guint) neigh->chassis_id_type);
(neigh->port_id_type * 33); hash = (hash * 33u) + ((guint) neigh->port_id_type);
return hash;
} }
static gboolean static gboolean
@@ -119,18 +147,22 @@ lldp_neighbor_id_equal (gconstpointer a, gconstpointer b)
} }
static void static void
lldp_neighbor_free (gpointer data) lldp_neighbor_free (LLDPNeighbor *neighbor)
{ {
LLDPNeighbor *neighbor = data;
if (neighbor) { if (neighbor) {
g_free (neighbor->chassis_id); g_free (neighbor->chassis_id);
g_free (neighbor->port_id); g_free (neighbor->port_id);
g_hash_table_unref (neighbor->tlvs); g_hash_table_unref (neighbor->tlvs);
g_free (neighbor); g_slice_free (LLDPNeighbor, neighbor);
} }
} }
static void
lldp_neighbor_freep (LLDPNeighbor **ptr)
{
lldp_neighbor_free (*ptr);
}
static gboolean static gboolean
lldp_neighbor_equal (LLDPNeighbor *a, LLDPNeighbor *b) lldp_neighbor_equal (LLDPNeighbor *a, LLDPNeighbor *b)
{ {
@@ -207,8 +239,12 @@ lldp_hash_table_equal (GHashTable *a, GHashTable *b)
static gboolean static gboolean
lldp_timeout (gpointer user_data) lldp_timeout (gpointer user_data)
{ {
NMLldpListener *self = NM_LLDP_LISTENER (user_data); NMLldpListener *self = user_data;
NMLldpListenerPrivate *priv = NM_LLDP_LISTENER_GET_PRIVATE (self); NMLldpListenerPrivate *priv;
g_return_val_if_fail (NM_IS_LLDP_LISTENER (self), G_SOURCE_REMOVE);
priv = NM_LLDP_LISTENER_GET_PRIVATE (self);
priv->timer = 0; priv->timer = 0;
@@ -222,24 +258,26 @@ static void
process_lldp_neighbors (NMLldpListener *self) process_lldp_neighbors (NMLldpListener *self)
{ {
NMLldpListenerPrivate *priv = NM_LLDP_LISTENER_GET_PRIVATE (self); NMLldpListenerPrivate *priv = NM_LLDP_LISTENER_GET_PRIVATE (self);
sd_lldp_packet **packets = NULL; nm_auto_free sd_lldp_packet **packets = NULL;
GHashTable *hash; GHashTable *hash;
int num, i; int num, i;
g_return_if_fail (priv->lldp_handle);
num = sd_lldp_get_packets (priv->lldp_handle, &packets); num = sd_lldp_get_packets (priv->lldp_handle, &packets);
if (num < 0) { if (num < 0) {
nm_log_dbg (LOGD_DEVICE, "LLDP: error %d retrieving neighbor packets for %s", _LOGD ("process: error %d retrieving neighbor packets for %s",
num, priv->iface); num, priv->iface);
return; return;
} }
hash = g_hash_table_new_full (lldp_neighbor_id_hash, lldp_neighbor_id_equal, hash = g_hash_table_new_full (lldp_neighbor_id_hash, lldp_neighbor_id_equal,
lldp_neighbor_free, NULL); (GDestroyNotify) lldp_neighbor_free, NULL);
for (i = 0; packets && i < num; i++) { for (i = 0; packets && i < num; i++) {
nm_auto (lldp_neighbor_freep) LLDPNeighbor *neigh = NULL;
uint8_t chassis_id_type, port_id_type, *chassis_id, *port_id, data8; uint8_t chassis_id_type, port_id_type, *chassis_id, *port_id, data8;
uint16_t chassis_id_len, port_id_len, len, data16; uint16_t chassis_id_len, port_id_len, len, data16;
LLDPNeighbor *neigh;
GValue *value; GValue *value;
char *str; char *str;
int r; int r;
@@ -257,37 +295,32 @@ process_lldp_neighbors (NMLldpListener *self)
if (r < 0) if (r < 0)
goto next_packet; goto next_packet;
neigh = g_malloc0 (sizeof (LLDPNeighbor)); neigh = g_slice_new0 (LLDPNeighbor);
neigh->tlvs = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gvalue_destroy); neigh->tlvs = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, gvalue_destroy);
neigh->chassis_id_type = chassis_id_type; neigh->chassis_id_type = chassis_id_type;
neigh->port_id_type = port_id_type; neigh->port_id_type = port_id_type;
sd_lldp_packet_get_destination_type (packets[i], &neigh->dest); sd_lldp_packet_get_destination_type (packets[i], &neigh->dest);
if (chassis_id_len < 1) { if (chassis_id_len < 1)
lldp_neighbor_free (neigh);
goto next_packet; goto next_packet;
}
switch (chassis_id_type) { switch (chassis_id_type) {
case LLDP_CHASSIS_SUBTYPE_INTERFACE_ALIAS: case LLDP_CHASSIS_SUBTYPE_INTERFACE_ALIAS:
case LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME: case LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME:
case LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED: case LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED:
case LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT: case LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT:
neigh->chassis_id = strndup ((char *) chassis_id, chassis_id_len); neigh->chassis_id = g_strndup ((const char *) chassis_id, chassis_id_len);
break; break;
case LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS: case LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS:
neigh->chassis_id = nm_utils_hwaddr_ntoa (chassis_id, chassis_id_len); neigh->chassis_id = nm_utils_hwaddr_ntoa (chassis_id, chassis_id_len);
break; break;
default: default:
nm_log_dbg (LOGD_DEVICE, "LLDP: unsupported chassis ID type %d", chassis_id_type); _LOGD ("process: unsupported chassis ID type %d", chassis_id_type);
lldp_neighbor_free (neigh);
goto next_packet; goto next_packet;
} }
if (port_id_len < 1) { if (port_id_len < 1)
lldp_neighbor_free (neigh);
goto next_packet; goto next_packet;
}
switch (port_id_type) { switch (port_id_type) {
case LLDP_PORT_SUBTYPE_INTERFACE_ALIAS: case LLDP_PORT_SUBTYPE_INTERFACE_ALIAS:
@@ -300,8 +333,7 @@ process_lldp_neighbors (NMLldpListener *self)
neigh->port_id = nm_utils_hwaddr_ntoa (port_id, port_id_len); neigh->port_id = nm_utils_hwaddr_ntoa (port_id, port_id_len);
break; break;
default: default:
nm_log_dbg (LOGD_DEVICE, "LLDP: unsupported port ID type %d", port_id_type); _LOGD ("process: unsupported port ID type %d", port_id_type);
lldp_neighbor_free (neigh);
goto next_packet; goto next_packet;
} }
@@ -346,16 +378,15 @@ process_lldp_neighbors (NMLldpListener *self)
g_hash_table_insert (neigh->tlvs, NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME, value); g_hash_table_insert (neigh->tlvs, NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME, value);
} }
nm_log_dbg (LOGD_DEVICE, "LLDP: new neigh: CHASSIS='%s' PORT='%s'", _LOGD ("process: new neigh: CHASSIS='%s' PORT='%s'",
neigh->chassis_id, neigh->port_id); neigh->chassis_id, neigh->port_id);
g_hash_table_add (hash, neigh); g_hash_table_add (hash, neigh);
neigh = NULL;
next_packet: next_packet:
sd_lldp_packet_unref (packets[i]); sd_lldp_packet_unref (packets[i]);
} }
g_free (packets);
if (lldp_hash_table_equal (priv->lldp_neighbors, hash)) { if (lldp_hash_table_equal (priv->lldp_neighbors, hash)) {
g_hash_table_destroy (hash); g_hash_table_destroy (hash);
} else { } else {
@@ -380,6 +411,7 @@ lldp_event_handler (sd_lldp *lldp, int event, void *userdata)
NMLldpListenerPrivate *priv; NMLldpListenerPrivate *priv;
g_return_if_fail (NM_IS_LLDP_LISTENER (self)); g_return_if_fail (NM_IS_LLDP_LISTENER (self));
priv = NM_LLDP_LISTENER_GET_PRIVATE (self); priv = NM_LLDP_LISTENER_GET_PRIVATE (self);
if (priv->timer > 0) { if (priv->timer > 0) {
@@ -446,6 +478,7 @@ nm_lldp_listener_start (NMLldpListener *self, int ifindex, const char *iface,
priv->ifindex = ifindex; priv->ifindex = ifindex;
priv->iface = strdup (iface); priv->iface = strdup (iface);
_LOGD ("start");
return TRUE; return TRUE;
err: err:
@@ -466,6 +499,7 @@ nm_lldp_listener_stop (NMLldpListener *self)
priv = NM_LLDP_LISTENER_GET_PRIVATE (self); priv = NM_LLDP_LISTENER_GET_PRIVATE (self);
if (priv->lldp_handle) { if (priv->lldp_handle) {
_LOGD ("stop");
sd_lldp_stop (priv->lldp_handle); sd_lldp_stop (priv->lldp_handle);
sd_lldp_detach_event (priv->lldp_handle); sd_lldp_detach_event (priv->lldp_handle);
sd_lldp_unref (priv->lldp_handle); sd_lldp_unref (priv->lldp_handle);
@@ -481,6 +515,7 @@ nm_lldp_listener_stop (NMLldpListener *self)
} }
nm_clear_g_source (&priv->timer); nm_clear_g_source (&priv->timer);
priv->ifindex = 0;
} }
gboolean gboolean
@@ -595,7 +630,9 @@ nm_lldp_listener_init (NMLldpListener *self)
priv->lldp_neighbors = g_hash_table_new_full (lldp_neighbor_id_hash, priv->lldp_neighbors = g_hash_table_new_full (lldp_neighbor_id_hash,
lldp_neighbor_id_equal, lldp_neighbor_id_equal,
lldp_neighbor_free, NULL); (GDestroyNotify) lldp_neighbor_free, NULL);
_LOGT ("lldp listener created");
} }
NMLldpListener * NMLldpListener *
@@ -623,6 +660,8 @@ finalize (GObject *object)
nm_clear_g_variant (&priv->variant); nm_clear_g_variant (&priv->variant);
_LOGT ("lldp listener destroyed");
G_OBJECT_CLASS (nm_lldp_listener_parent_class)->finalize (object); G_OBJECT_CLASS (nm_lldp_listener_parent_class)->finalize (object);
} }

View File

@@ -136,7 +136,7 @@ get_lldp_neighbor_attribute (GVariant *neighbors,
static void static void
test_receive_frame (test_fixture *fixture, gconstpointer user_data) test_receive_frame (test_fixture *fixture, gconstpointer user_data)
{ {
NMLldpListener *listener; gs_unref_object NMLldpListener *listener = NULL;
GMainLoop *loop; GMainLoop *loop;
TestInfo info = { }; TestInfo info = { };
GVariant *neighbors, *attr; GVariant *neighbors, *attr;

View File

@@ -36,6 +36,9 @@
#include "sd-dhcp-client.h" #include "sd-dhcp-client.h"
#include "sd-dhcp6-client.h" #include "sd-dhcp6-client.h"
/* we use a private systemd header, thus need to include nm-sd-adapt.h. */
#include "nm-sd-adapt.h"
#include "dhcp-lease-internal.h" #include "dhcp-lease-internal.h"
G_DEFINE_TYPE (NMDhcpSystemd, nm_dhcp_systemd, NM_TYPE_DHCP_CLIENT) G_DEFINE_TYPE (NMDhcpSystemd, nm_dhcp_systemd, NM_TYPE_DHCP_CLIENT)

View File

@@ -18,7 +18,8 @@
#include "nm-default.h" #include "nm-default.h"
#include <glib.h> #include "nm-sd-adapt.h"
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <alloca.h> #include <alloca.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
int asynchronous_job(void* (*func)(void *p), void *arg); int asynchronous_job(void* (*func)(void *p), void *arg);
int asynchronous_sync(void); int asynchronous_sync(void);

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <dirent.h> #include <dirent.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <dirent.h> #include <dirent.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <stdbool.h> #include <stdbool.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include "macro.h" #include "macro.h"
#include "siphash24.h" #include "siphash24.h"

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <limits.h> #include <limits.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdbool.h> #include <stdbool.h>
#include "macro.h" #include "macro.h"

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <netinet/in.h> #include <netinet/in.h>
#include <stddef.h> #include <stddef.h>
#include <sys/socket.h> #include <sys/socket.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
/* The head of the linked list. Use this in the structure that shall /* The head of the linked list. Use this in the structure that shall
* contain the head of the linked list */ * contain the head of the linked list */
#define LIST_HEAD(t,name) \ #define LIST_HEAD(t,name) \

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <assert.h> #include <assert.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h> #include <stdbool.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stddef.h> #include <stddef.h>
struct pool; struct pool;

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <limits.h> #include <limits.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <alloca.h> #include <alloca.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdbool.h> #include <stdbool.h>
#include "hashmap.h" #include "hashmap.h"

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
/* A type-safe atomic refcounter. /* A type-safe atomic refcounter.
* *
* DO NOT USE THIS UNLESS YOU ACTUALLY CARE ABOUT THREAD SAFETY! */ * DO NOT USE THIS UNLESS YOU ACTUALLY CARE ABOUT THREAD SAFETY! */

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include "hashmap.h" #include "hashmap.h"
#include "macro.h" #include "macro.h"

View File

@@ -1,7 +1,5 @@
#pragma once #pragma once
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <netinet/ether.h> #include <netinet/ether.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <stdbool.h> #include <stdbool.h>

View File

@@ -21,8 +21,6 @@
#ifndef SPARSE_ENDIAN_H #ifndef SPARSE_ENDIAN_H
#define SPARSE_ENDIAN_H #define SPARSE_ENDIAN_H
#include "nm-sd-adapt.h"
#include <byteswap.h> #include <byteswap.h>
#include <endian.h> #include <endian.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <printf.h> #include <printf.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <errno.h> #include <errno.h>
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <alloca.h> #include <alloca.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <fnmatch.h> #include <fnmatch.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdbool.h> #include <stdbool.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdbool.h> #include <stdbool.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <endian.h> #include <endian.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <alloca.h> #include <alloca.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <netinet/if_ether.h> #include <netinet/if_ether.h>
#include "socket-util.h" #include "socket-util.h"

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include "sd-id128.h" #include "sd-id128.h"
#include "macro.h" #include "macro.h"

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <linux/if_packet.h> #include <linux/if_packet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include <net/if_arp.h> #include <net/if_arp.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdint.h> #include <stdint.h>
#include <linux/if_packet.h> #include <linux/if_packet.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <netinet/ip.h> #include <netinet/ip.h>
#include <netinet/udp.h> #include <netinet/udp.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <net/ethernet.h> #include <net/ethernet.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdint.h> #include <stdint.h>
#include "sd-dhcp6-lease.h" #include "sd-dhcp6-lease.h"

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <netinet/ip6.h> #include <netinet/ip6.h>
#include <netinet/udp.h> #include <netinet/udp.h>

View File

@@ -20,8 +20,6 @@
#pragma once #pragma once
#include "nm-sd-adapt.h"
#include "sd-event.h" #include "sd-event.h"
#include "list.h" #include "list.h"

View File

@@ -20,8 +20,6 @@
#pragma once #pragma once
#include "nm-sd-adapt.h"
#include "sd-event.h" #include "sd-event.h"
int lldp_network_bind_raw_socket(int ifindex); int lldp_network_bind_raw_socket(int ifindex);

View File

@@ -20,8 +20,6 @@
#pragma once #pragma once
#include "nm-sd-adapt.h"
#include <net/ethernet.h> #include <net/ethernet.h>
#include "sd-event.h" #include "sd-event.h"

View File

@@ -20,8 +20,6 @@
#pragma once #pragma once
#include "nm-sd-adapt.h"
#include <net/ethernet.h> #include <net/ethernet.h>
#include "sd-lldp.h" #include "sd-lldp.h"

View File

@@ -20,8 +20,6 @@
#pragma once #pragma once
#include "nm-sd-adapt.h"
#define LLDP_MULTICAST_ADDR { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e } #define LLDP_MULTICAST_ADDR { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e }
#define ETHERTYPE_LLDP 0x88cc #define ETHERTYPE_LLDP 0x88cc

View File

@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <stdbool.h> #include <stdbool.h>
#include "sd-dhcp-lease.h" #include "sd-dhcp-lease.h"

View File

@@ -19,7 +19,6 @@
#pragma once #pragma once
#include "nm-sd-adapt.h"
#include <errno.h> #include <errno.h>
#include <stdbool.h> #include <stdbool.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
/* This is a private header; never even think of including this directly! */ /* This is a private header; never even think of including this directly! */
#if __INCLUDE_LEVEL__ <= 1 #if __INCLUDE_LEVEL__ <= 1

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include <sys/types.h> #include <sys/types.h>

View File

@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <signal.h> #include <signal.h>
#include <sys/epoll.h> #include <sys/epoll.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <string.h> #include <string.h>

View File

@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <net/ethernet.h> #include <net/ethernet.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <net/ethernet.h> #include <net/ethernet.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <net/ethernet.h> #include <net/ethernet.h>

View File

@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>. along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/ ***/
#include "nm-sd-adapt.h"
#include <inttypes.h> #include <inttypes.h>
#include <net/ethernet.h> #include <net/ethernet.h>