From 7a6735157c0df93375e9daadf0bbd1dca4160533 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 21 Mar 2011 12:49:44 -0700 Subject: bridge: Drop LACP configuration members from struct iface and struct port. There's no reason that I can see to maintain this information in struct port and struct iface. It's redundant, since the lacp implementation maintains the same information. --- lib/lacp.c | 8 ++++++++ lib/lacp.h | 3 +++ 2 files changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/lacp.c b/lib/lacp.c index 005165fdd..c8fae6219 100644 --- a/lib/lacp.c +++ b/lib/lacp.c @@ -142,6 +142,14 @@ lacp_configure(struct lacp *lacp, const char *name, lacp->fast = fast; } +/* Returns true if 'lacp' is configured in active mode, false if 'lacp' is + * configured for passive mode. */ +bool +lacp_is_active(const struct lacp *lacp) +{ + return lacp->active; +} + /* Processes 'pdu', a parsed LACP packet received on 'slave_'. This function * should be called on all packets received on 'slave_' with Ethernet Type * ETH_TYPE_LACP and parsable by parse_lacp_packet(). */ diff --git a/lib/lacp.h b/lib/lacp.h index 8d3bc7862..c5f3c2ffd 100644 --- a/lib/lacp.h +++ b/lib/lacp.h @@ -27,9 +27,12 @@ typedef void lacp_send_pdu(void *slave, const struct lacp_pdu *); void lacp_init(void); struct lacp *lacp_create(void); void lacp_destroy(struct lacp *); + void lacp_configure(struct lacp *, const char *name, const uint8_t sys_id[ETH_ADDR_LEN], uint16_t sys_priority, bool active, bool fast); +bool lacp_is_active(const struct lacp *); + void lacp_process_pdu(struct lacp *, const void *slave, const struct lacp_pdu *); bool lacp_negotiated(const struct lacp *); -- cgit v1.2.1