netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / lib / ovs-lldp.h
index c629aa0..71dff44 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2015 Nicira, Inc.
  * Copyright (c) 2014 Wind River Systems, Inc.
  * Copyright (c) 2015 Avaya, Inc.
  *
 #include "hmap.h"
 #include "list.h"
 #include "lldp/lldpd.h"
-#include "ovsdb-data.h"
-#include "ovs-thread.h"
+#include "ovs-atomic.h"
 #include "packets.h"
 #include "timer.h"
 
 /* Transmit every LLDPD_TX_INTERVAL seconds. */
-#define LLDP_DEFAULT_TRANSMIT_INTERVAL_MS LLDPD_TX_INTERVAL * 1000
+#define LLDP_DEFAULT_TRANSMIT_INTERVAL_MS (LLDPD_TX_INTERVAL * 1000)
 
-struct flow_wildcards;
 struct flow;
 struct netdev;
 struct smap;
 
-struct lldp_status {
-    /* TODO should reflect lldp stack detail */
-    char *stackdetail; /* Added because MSVC doesn't like empty structs */
-};
-
 /* Structure per LLDP instance (at the moment per port when enabled).
  */
 struct lldp {
@@ -52,6 +46,7 @@ struct lldp {
     struct hmap         mappings_by_aux;  /* "struct" indexed by aux */
     struct ovs_list     active_mapping_queue;
     struct ovs_refcount ref_cnt;
+    bool                enabled;          /* LLDP enabled on port */
 };
 
 /* Configuration specific to Auto Attach.
@@ -64,8 +59,8 @@ struct aa_settings {
 /* Configuration of Auto Attach mappings.
  */
 struct aa_mapping_settings {
-    int64_t isid;
-    int64_t vlan;
+    uint32_t isid;
+    uint16_t vlan;
 };
 
 enum bridge_aa_vlan_oper {
@@ -80,7 +75,7 @@ enum bridge_aa_vlan_oper {
 struct bridge_aa_vlan {
     struct ovs_list list_node;
     char *port_name;
-    uint32_t vlan;
+    uint16_t vlan;
     enum bridge_aa_vlan_oper oper;
 };
 
@@ -89,11 +84,11 @@ long long int lldp_wait(struct lldp *lldp);
 long long int lldp_wake_time(const struct lldp *lldp);
 void lldp_run(struct lldpd *cfg);
 bool lldp_should_send_packet(struct lldp *cfg);
-bool lldp_should_process_flow(const struct flow *flow);
-bool lldp_configure(struct lldp *lldp);
+bool lldp_should_process_flow(struct lldp *lldp, const struct flow *flow);
+bool lldp_configure(struct lldp *lldp, const struct smap *cfg);
 void lldp_process_packet(struct lldp *cfg, const struct dp_packet *);
 void lldp_put_packet(struct lldp *lldp, struct dp_packet *packet,
-                     uint8_t eth_src[ETH_ADDR_LEN]);
+                     const struct eth_addr eth_src);
 void lldpd_assign_cfg_to_protocols(struct lldpd *cfg);
 struct lldp * lldp_create(const struct netdev *netdev, const uint32_t mtu,
                           const struct smap *cfg);
@@ -108,5 +103,6 @@ int aa_mapping_unregister(void *aux);
 
 /* Used by unit tests */
 struct lldp * lldp_create_dummy(void);
+void lldp_destroy_dummy(struct lldp *);
 
 #endif /* OVS_LLDP_H */