src/libsystemd-network/lldp-port.c \
src/libsystemd-network/lldp-internal.h \
src/libsystemd-network/lldp-internal.c \
+ src/libsystemd-network/lldp-util.h \
src/libsystemd-network/sd-lldp.h \
src/libsystemd-network/sd-lldp.c
typedef struct lldp_neighbour_port lldp_neighbour_port;
typedef struct lldp_chassis lldp_chassis;
typedef struct lldp_chassis_id lldp_chassis_id;
+typedef struct lldp_agent_statitics lldp_agent_statitics;
struct lldp_neighbour_port {
uint8_t type;
int lldp_read_system_capability(tlv_packet *tlv, uint16_t *data);
int lldp_read_port_description(tlv_packet *tlv, uint16_t *length, char **data);
+int lldp_handle_packet(tlv_packet *m, uint16_t length);
#define log_lldp(fmt, ...) log_internal(LOG_DEBUG, 0, __FILE__, __LINE__, __func__, "LLDP: " fmt, ##__VA_ARGS__)
#include "socket-util.h"
#include "lldp-tlv.h"
#include "lldp-network.h"
+#include "lldp-internal.h"
#include "sd-lldp.h"
int lldp_network_bind_raw_socket(int ifindex) {
}
int lldp_port_new(int ifindex,
- char *ifname,
+ const char *ifname,
const struct ether_addr *addr,
void *userdata,
lldp_port **ret) {
#include "sd-event.h"
#include "sd-lldp.h"
+#include "util.h"
+
typedef struct lldp_port lldp_port;
struct lldp_port {
};
int lldp_port_new(int ifindex,
- char *ifname,
+ const char *ifname,
const struct ether_addr *addr,
void *userdata,
lldp_port **ret);
--- /dev/null
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+ This file is part of systemd.
+
+ Copyright (C) 2014 Tom Gundersen
+ Copyright (C) 2014 Susant Sahani
+
+ 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 <http://www.gnu.org/licenses/>.
+***/
+
+#pragma once
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(sd_lldp *, sd_lldp_free);
+#define _cleanup_lldp_free_ _cleanup_(sd_lldp_freep)
#include "prioq.h"
#include "strv.h"
#include "lldp-internal.h"
+#include "lldp-util.h"
#include "ether-addr-util.h"
typedef enum LLDPAgentRXState {
}
int sd_lldp_new(int ifindex,
- char *ifname,
- struct ether_addr *mac,
+ const char *ifname,
+ const struct ether_addr *mac,
sd_lldp **ret) {
- _cleanup_sd_lldp_free_ sd_lldp *lldp = NULL;
+ _cleanup_lldp_free_ sd_lldp *lldp = NULL;
int r;
assert_return(ret, -EINVAL);
#pragma once
-#include "lldp-tlv.h"
#include "sd-event.h"
typedef struct sd_lldp sd_lldp;
-typedef struct lldp_agent_statitics lldp_agent_statitics;
typedef void (*sd_lldp_cb_t)(sd_lldp *lldp, int event, void *userdata);
_LLDP_PORT_STATUS_INVALID = -1,
} LLDPPortStatus;
-int sd_lldp_new(int ifindex, char *ifname, struct ether_addr *mac, sd_lldp **ret);
+int sd_lldp_new(int ifindex, const char *ifname, const struct ether_addr *mac, sd_lldp **ret);
void sd_lldp_free(sd_lldp *lldp);
-DEFINE_TRIVIAL_CLEANUP_FUNC(sd_lldp *, sd_lldp_free);
-#define _cleanup_sd_lldp_free_ _cleanup_(sd_lldp_freep)
-
int sd_lldp_start(sd_lldp *lldp);
int sd_lldp_stop(sd_lldp *lldp);
int sd_lldp_set_callback(sd_lldp *lldp, sd_lldp_cb_t cb, void *userdata);
int sd_lldp_save(sd_lldp *lldp, const char *file);
-
-int lldp_handle_packet(tlv_packet *m, uint16_t length);