-struct mac_learning *mac_learning_create(void);
-void mac_learning_destroy(struct mac_learning *);
-bool mac_learning_set_flood_vlans(struct mac_learning *,
- unsigned long *bitmap);
-tag_type mac_learning_learn(struct mac_learning *,
- const uint8_t src[ETH_ADDR_LEN], uint16_t vlan,
- uint16_t src_port);
-int mac_learning_lookup(const struct mac_learning *,
- const uint8_t dst[ETH_ADDR_LEN], uint16_t vlan);
-int mac_learning_lookup_tag(const struct mac_learning *,
- const uint8_t dst[ETH_ADDR_LEN],
- uint16_t vlan, tag_type *tag);
-void mac_learning_flush(struct mac_learning *);
-void mac_learning_run(struct mac_learning *, struct tag_set *);
-void mac_learning_wait(struct mac_learning *);
+int mac_entry_age(const struct mac_learning *ml, const struct mac_entry *e)
+ OVS_REQ_RDLOCK(ml->rwlock);
+
+/* Basics. */
+struct mac_learning *mac_learning_create(unsigned int idle_time);
+struct mac_learning *mac_learning_ref(const struct mac_learning *);
+void mac_learning_unref(struct mac_learning *);
+
+bool mac_learning_run(struct mac_learning *ml) OVS_REQ_WRLOCK(ml->rwlock);
+void mac_learning_wait(struct mac_learning *ml)
+ OVS_REQ_RDLOCK(ml->rwlock);
+
+/* Configuration. */
+bool mac_learning_set_flood_vlans(struct mac_learning *ml,
+ const unsigned long *bitmap)
+ OVS_REQ_WRLOCK(ml->rwlock);
+void mac_learning_set_idle_time(struct mac_learning *ml,
+ unsigned int idle_time)
+ OVS_REQ_WRLOCK(ml->rwlock);
+void mac_learning_set_max_entries(struct mac_learning *ml, size_t max_entries)
+ OVS_REQ_WRLOCK(ml->rwlock);
+
+/* Learning. */
+bool mac_learning_may_learn(const struct mac_learning *ml,
+ const uint8_t src_mac[ETH_ADDR_LEN],
+ uint16_t vlan)
+ OVS_REQ_RDLOCK(ml->rwlock);
+struct mac_entry *mac_learning_insert(struct mac_learning *ml,
+ const uint8_t src[ETH_ADDR_LEN],
+ uint16_t vlan)
+ OVS_REQ_WRLOCK(ml->rwlock);
+void mac_learning_changed(struct mac_learning *ml) OVS_REQ_WRLOCK(ml->rwlock);
+
+/* Lookup. */
+struct mac_entry *mac_learning_lookup(const struct mac_learning *ml,
+ const uint8_t dst[ETH_ADDR_LEN],
+ uint16_t vlan)
+ OVS_REQ_RDLOCK(ml->rwlock);
+
+/* Flushing. */
+void mac_learning_expire(struct mac_learning *ml, struct mac_entry *e)
+ OVS_REQ_WRLOCK(ml->rwlock);
+void mac_learning_flush(struct mac_learning *ml) OVS_REQ_WRLOCK(ml->rwlock);