#include "lacp.h"
#include "learn.h"
#include "list.h"
+#include "ovs-lldp.h"
#include "mac-learning.h"
#include "mcast-snooping.h"
#include "meta-flow.h"
struct cfm *cfm; /* CFM handle or null. */
struct bfd *bfd; /* BFD handle or null. */
+ struct lldp *lldp; /* LLDP handle or null. */
};
struct xlate_ctx {
bool floodable);
static void xlate_xport_set(struct xport *xport, odp_port_t odp_port,
const struct netdev *netdev, const struct cfm *cfm,
- const struct bfd *bfd, int stp_port_no,
- const struct rstp_port *rstp_port,
+ const struct bfd *bfd, const struct lldp *lldp,
+ int stp_port_no, const struct rstp_port *rstp_port,
enum ofputil_port_config config,
enum ofputil_port_state state, bool is_tunnel,
bool may_enable);
static void
xlate_xport_set(struct xport *xport, odp_port_t odp_port,
const struct netdev *netdev, const struct cfm *cfm,
- const struct bfd *bfd, int stp_port_no,
+ const struct bfd *bfd, const struct lldp *lldp, int stp_port_no,
const struct rstp_port* rstp_port,
enum ofputil_port_config config, enum ofputil_port_state state,
bool is_tunnel, bool may_enable)
xport->bfd = bfd_ref(bfd);
}
+ if (xport->lldp != lldp) {
+ lldp_unref(xport->lldp);
+ xport->lldp = lldp_ref(lldp);
+ }
+
if (xport->netdev != netdev) {
netdev_close(xport->netdev);
xport->netdev = netdev_ref(netdev);
xlate_xport_init(new_xcfg, new_xport);
xlate_xport_set(new_xport, xport->odp_port, xport->netdev, xport->cfm,
- xport->bfd, xport->stp_port_no, xport->rstp_port,
- xport->config, xport->state, xport->is_tunnel,
- xport->may_enable);
+ xport->bfd, xport->lldp, xport->stp_port_no,
+ xport->rstp_port, xport->config, xport->state,
+ xport->is_tunnel, xport->may_enable);
if (xport->peer) {
struct xport *peer = xport_lookup(new_xcfg, xport->peer->ofport);
struct ofport_dpif *ofport, ofp_port_t ofp_port,
odp_port_t odp_port, const struct netdev *netdev,
const struct cfm *cfm, const struct bfd *bfd,
- struct ofport_dpif *peer, int stp_port_no,
- const struct rstp_port *rstp_port,
+ const struct lldp *lldp, struct ofport_dpif *peer,
+ int stp_port_no, const struct rstp_port *rstp_port,
const struct ofproto_port_queue *qdscp_list, size_t n_qdscp,
enum ofputil_port_config config,
enum ofputil_port_state state, bool is_tunnel,
ovs_assert(xport->ofp_port == ofp_port);
- xlate_xport_set(xport, odp_port, netdev, cfm, bfd, stp_port_no,
- rstp_port, config, state, is_tunnel, may_enable);
+ xlate_xport_set(xport, odp_port, netdev, cfm, bfd, lldp,
+ stp_port_no, rstp_port, config, state, is_tunnel,
+ may_enable);
if (xport->peer) {
xport->peer->peer = NULL;
rstp_port_unref(xport->rstp_port);
cfm_unref(xport->cfm);
bfd_unref(xport->bfd);
+ lldp_unref(xport->lldp);
free(xport);
}
: rstp_process_packet(xport, packet);
}
return SLOW_STP;
+ } else if (xport->lldp && lldp_should_process_flow(flow)) {
+ if (packet) {
+ lldp_process_packet(xport->lldp, packet);
+ }
+ return SLOW_LLDP;
} else {
return 0;
}