batman-adv: add bat_neigh_free API
[firefly-linux-kernel-4.4.55.git] / net / batman-adv / types.h
index 9398c3fb417472962ddb58b0344de56006006b85..336f94bba55813ef339b208d461fcd33366dc2a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2014 B.A.T.M.A.N. contributors:
+/* Copyright (C) 2007-2015 B.A.T.M.A.N. contributors:
  *
  * Marek Lindner, Simon Wunderlich
  *
@@ -132,6 +132,7 @@ struct batadv_orig_ifinfo {
  * @timestamp: time (jiffie) of last received fragment
  * @seqno: sequence number of the fragments in the list
  * @size: accumulated size of packets in list
+ * @total_size: expected size of the assembled packet
  */
 struct batadv_frag_table_entry {
        struct hlist_head head;
@@ -139,6 +140,7 @@ struct batadv_frag_table_entry {
        unsigned long timestamp;
        uint16_t seqno;
        uint16_t size;
+       uint16_t total_size;
 };
 
 /**
@@ -181,9 +183,10 @@ struct batadv_orig_node_vlan {
 
 /**
  * struct batadv_orig_bat_iv - B.A.T.M.A.N. IV private orig_node members
- * @bcast_own: bitfield containing the number of our OGMs this orig_node
- *  rebroadcasted "back" to us (relative to last_real_seqno)
- * @bcast_own_sum: counted result of bcast_own
+ * @bcast_own: set of bitfields (one per hard interface) where each one counts
+ * the number of our OGMs this orig_node rebroadcasted "back" to us  (relative
+ * to last_real_seqno). Every bitfield is BATADV_TQ_LOCAL_WINDOW_SIZE bits long.
+ * @bcast_own_sum: sum of bcast_own
  * @ogm_cnt_lock: lock protecting bcast_own, bcast_own_sum,
  *  neigh_node->bat_iv.real_bits & neigh_node->bat_iv.real_packet_count
  */
@@ -1118,6 +1121,8 @@ struct batadv_forw_packet {
  * @bat_neigh_is_equiv_or_better: check if neigh1 is equally good or better
  *  than neigh2 for their respective outgoing interface from the metric
  *  prospective
+ * @bat_neigh_free: free the resources allocated by the routing algorithm for a
+ *  neigh_node object
  * @bat_orig_print: print the originator table (optional)
  * @bat_orig_free: free the resources allocated by the routing algorithm for an
  *  orig_node object
@@ -1135,6 +1140,7 @@ struct batadv_algo_ops {
        void (*bat_primary_iface_set)(struct batadv_hard_iface *hard_iface);
        void (*bat_ogm_schedule)(struct batadv_hard_iface *hard_iface);
        void (*bat_ogm_emit)(struct batadv_forw_packet *forw_packet);
+       /* neigh_node handling API */
        int (*bat_neigh_cmp)(struct batadv_neigh_node *neigh1,
                             struct batadv_hard_iface *if_outgoing1,
                             struct batadv_neigh_node *neigh2,
@@ -1144,6 +1150,7 @@ struct batadv_algo_ops {
                 struct batadv_hard_iface *if_outgoing1,
                 struct batadv_neigh_node *neigh2,
                 struct batadv_hard_iface *if_outgoing2);
+       void (*bat_neigh_free)(struct batadv_neigh_node *neigh);
        /* orig_node handling API */
        void (*bat_orig_print)(struct batadv_priv *priv, struct seq_file *seq,
                               struct batadv_hard_iface *hard_iface);