]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_oil.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / pimd / pim_oil.h
index 68b5ef474efdb72781b11cf093d104b62f318c13..dc66eaace454c1fab9e80ca1b892b7d7f7e60194 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef PIM_OIL_H
@@ -27,18 +14,18 @@ struct pim_interface;
 /*
  * Where did we get this (S,G) from?
  *
- * IGMP - Learned from IGMP
+ * GM - Learned from IGMP/MLD
  * PIM - Learned from PIM
  * SOURCE - Learned from Source multicast packet received
  * STAR - Inherited
  */
-#define PIM_OIF_FLAG_PROTO_IGMP   (1 << 0)
+#define PIM_OIF_FLAG_PROTO_GM     (1 << 0)
 #define PIM_OIF_FLAG_PROTO_PIM    (1 << 1)
 #define PIM_OIF_FLAG_PROTO_STAR   (1 << 2)
 #define PIM_OIF_FLAG_PROTO_VXLAN  (1 << 3)
-#define PIM_OIF_FLAG_PROTO_ANY                                 \
-       (PIM_OIF_FLAG_PROTO_IGMP | PIM_OIF_FLAG_PROTO_PIM      \
-        PIM_OIF_FLAG_PROTO_STAR | PIM_OIF_FLAG_PROTO_VXLAN)
+#define PIM_OIF_FLAG_PROTO_ANY                                                 \
+       (PIM_OIF_FLAG_PROTO_GM | PIM_OIF_FLAG_PROTO_PIM |                      \
+        PIM_OIF_FLAG_PROTO_STAR | PIM_OIF_FLAG_PROTO_VXLAN)
 
 /* OIF is present in the OIL but must not be used for forwarding traffic */
 #define PIM_OIF_FLAG_MUTE         (1 << 4)
@@ -130,9 +117,9 @@ static inline vifi_t *oil_parent(struct channel_oil *c_oil)
        return &c_oil->oil.mfcc_parent;
 }
 
-static inline uint8_t oil_if_has(struct channel_oil *c_oil, vifi_t ifi)
+static inline bool oil_if_has(struct channel_oil *c_oil, vifi_t ifi)
 {
-       return c_oil->oil.mfcc_ttls[ifi];
+       return !!c_oil->oil.mfcc_ttls[ifi];
 }
 
 static inline void oil_if_set(struct channel_oil *c_oil, vifi_t ifi, uint8_t set)
@@ -166,7 +153,8 @@ static inline bool oil_if_has(struct channel_oil *c_oil, mifi_t ifi)
        return !!IF_ISSET(ifi, &c_oil->oil.mf6cc_ifset);
 }
 
-static inline void oil_if_set(struct channel_oil *c_oil, mifi_t ifi, bool set)
+static inline void oil_if_set(struct channel_oil *c_oil, mifi_t ifi,
+                             uint8_t set)
 {
        if (set)
                IF_SET(ifi, &c_oil->oil.mf6cc_ifset);
@@ -186,9 +174,6 @@ extern int pim_channel_oil_compare(const struct channel_oil *c1,
 DECLARE_RBTREE_UNIQ(rb_pim_oil, struct channel_oil, oil_rb,
                     pim_channel_oil_compare);
 
-
-extern struct list *pim_channel_oil_list;
-
 void pim_oil_init(struct pim_instance *pim);
 void pim_oil_terminate(struct pim_instance *pim);
 
@@ -197,9 +182,7 @@ struct channel_oil *pim_find_channel_oil(struct pim_instance *pim,
                                         pim_sgaddr *sg);
 struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
                                        pim_sgaddr *sg, const char *name);
-void pim_channel_oil_change_iif(struct pim_instance *pim,
-                               struct channel_oil *c_oil, int input_vif_index,
-                               const char *name);
+void pim_clear_nocache_state(struct pim_interface *pim_ifp);
 struct channel_oil *pim_channel_oil_del(struct channel_oil *c_oil,
                                        const char *name);