bonding: clean up redundant code
[vpp.git] / src / vnet / bonding / node.h
index b950442..41e945a 100644 (file)
@@ -70,13 +70,14 @@ typedef enum
 #undef _
 } bond_load_balance_t;
 
-enum
+typedef enum
 {
   BOND_SEND_GARP_NA = 1,
 } bond_send_garp_na_process_event_t;
 
 typedef struct
 {
+  u32 id;
   u8 hw_addr_set;
   u8 hw_addr[6];
   u8 mode;
@@ -112,6 +113,7 @@ typedef struct
 typedef struct
 {
   u32 sw_if_index;
+  u32 id;
   u8 interface_name[64];
   u8 mode;
   u8 lb;
@@ -158,7 +160,12 @@ typedef struct
   /* the last slave index for the rr lb */
   u32 lb_rr_last_index;
 
+  /* Real device instance in interface vector */
   u32 dev_instance;
+
+  /* Interface ID being shown to user */
+  u32 id;
+
   u32 hw_if_index;
   u32 sw_if_index;
 
@@ -259,7 +266,16 @@ typedef struct
   f64 actor_churn_timer;
 
   /* time last lacpdu was sent */
-  f64 last_lacpdu_time;
+  f64 last_lacpdu_sent_time;
+
+  /* time last lacpdu was received */
+  f64 last_lacpdu_recd_time;
+
+  /* time last marker pdu was sent */
+  f64 last_marker_pdu_sent_time;
+
+  /* time last marker pdu was received */
+  f64 last_marker_pdu_recd_time;
 
   /* timer used to generate periodic transmission */
   f64 periodic_timer;
@@ -287,6 +303,24 @@ typedef struct
 
   /* bond mode */
   u8 mode;
+
+  /* good lacp pdu received */
+  u64 pdu_received;
+
+  /* bad lacp pdu received */
+  u64 bad_pdu_received;
+
+  /* pdu sent */
+  u64 pdu_sent;
+
+  /* good marker pdu received */
+  u64 marker_pdu_received;
+
+  /* bad marker pdu received */
+  u64 marker_bad_pdu_received;
+
+  /* pdu sent */
+  u64 marker_pdu_sent;
 } slave_if_t;
 
 typedef void (*lacp_enable_disable_func) (vlib_main_t * vm, bond_if_t * bif,
@@ -297,6 +331,9 @@ typedef struct
   /* pool of bonding interfaces */
   bond_if_t *interfaces;
 
+  /* record used interface IDs */
+  uword *id_used;
+
   /* pool of slave interfaces */
   slave_if_t *neighbors;