time_t grat_arp_lock; /* Gratuitous ARP lock expiration time. */
uint8_t mac[ETH_ADDR_LEN]; /* Known MAC address. */
uint16_t vlan; /* VLAN tag. */
- int port; /* Port on which MAC was most recently seen. */
tag_type tag; /* Tag for this learning entry. */
+
+ /* Learned port. */
+ union {
+ void *p;
+ int i;
+ } port;
};
int mac_entry_age(const struct mac_entry *);
* has ever been asserted or if it has expired. */
static inline bool mac_entry_is_grat_arp_locked(const struct mac_entry *mac)
{
- return time_now() >= mac->grat_arp_lock;
+ return time_now() < mac->grat_arp_lock;
}
/* MAC learning table. */
/* Configuration. */
bool mac_learning_set_flood_vlans(struct mac_learning *,
- unsigned long *bitmap);
+ const unsigned long *bitmap);
/* Learning. */
bool mac_learning_may_learn(const struct mac_learning *,
uint16_t vlan, tag_type *);
/* Flushing. */
+void mac_learning_expire(struct mac_learning *, struct mac_entry *);
void mac_learning_flush(struct mac_learning *);
#endif /* mac-learning.h */