]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_oil.h
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / pimd / pim_oil.h
index 02c7e740ef707b4af7518f55356e588670d604f4..94d3840e98db72aafa561e706620cac66f0ed399 100644 (file)
 #define PIM_OIF_FLAG_PROTO_PIM    (1 << 1)
 #define PIM_OIF_FLAG_PROTO_SOURCE (1 << 2)
 #define PIM_OIF_FLAG_PROTO_STAR   (1 << 3)
-#define PIM_OIF_FLAG_PROTO_ANY    (PIM_OIF_FLAG_PROTO_IGMP | \
-                                   PIM_OIF_FLAG_PROTO_PIM | \
-                                   PIM_OIF_FLAG_PROTO_SOURCE | \
-                                   PIM_OIF_FLAG_PROTO_STAR)
+#define PIM_OIF_FLAG_PROTO_ANY                                                 \
+       (PIM_OIF_FLAG_PROTO_IGMP | PIM_OIF_FLAG_PROTO_PIM                      \
+        | PIM_OIF_FLAG_PROTO_SOURCE | PIM_OIF_FLAG_PROTO_STAR)
 
 /*
  * We need a pimreg vif id from the kernel.
 #define PIM_OIF_PIM_REGISTER_VIF   0
 #define PIM_MAX_USABLE_VIFS        (MAXVIFS - 1)
 
-
-struct channel_counts
-{
-  unsigned long long lastused;
-  unsigned long pktcnt;
-  unsigned long oldpktcnt;
-  unsigned long bytecnt;
-  unsigned long oldbytecnt;
-  unsigned long wrong_if;
-  unsigned long oldwrong_if;
+struct channel_counts {
+       unsigned long long lastused;
+       unsigned long pktcnt;
+       unsigned long oldpktcnt;
+       unsigned long bytecnt;
+       unsigned long oldbytecnt;
+       unsigned long wrong_if;
+       unsigned long oldwrong_if;
 };
 
 /*
@@ -70,35 +67,38 @@ struct channel_counts
 */
 
 struct channel_oil {
-  struct mfcctl oil;
-  int           installed;
-  int           oil_inherited_rescan;
-  int           oil_size;
-  int           oil_ref_count;
-  time_t        oif_creation[MAXVIFS];
-  uint32_t      oif_flags[MAXVIFS];
-  struct channel_counts cc;
-  struct pim_upstream *up;
+       struct pim_instance *pim;
+
+       struct mfcctl oil;
+       int installed;
+       int oil_inherited_rescan;
+       int oil_size;
+       int oil_ref_count;
+       time_t oif_creation[MAXVIFS];
+       uint32_t oif_flags[MAXVIFS];
+       struct channel_counts cc;
+       struct pim_upstream *up;
 };
 
 extern struct list *pim_channel_oil_list;
 
-void pim_oil_init (void);
-void pim_oil_terminate (void);
+void pim_oil_init(struct pim_instance *pim);
+void pim_oil_terminate(struct pim_instance *pim);
 
 void pim_channel_oil_free(struct channel_oil *c_oil);
-struct channel_oil *pim_channel_oil_add(struct prefix_sg *sg,
+struct channel_oil *pim_find_channel_oil(struct pim_instance *pim,
+                                        struct prefix_sg *sg);
+struct channel_oil *pim_channel_oil_add(struct pim_instance *pim,
+                                       struct prefix_sg *sg,
                                        int input_vif_index);
 void pim_channel_oil_del(struct channel_oil *c_oil);
 
-int pim_channel_add_oif(struct channel_oil *c_oil,
-                       struct interface *oif,
+int pim_channel_add_oif(struct channel_oil *c_oil, struct interface *oif,
+                       uint32_t proto_mask);
+int pim_channel_del_oif(struct channel_oil *c_oil, struct interface *oif,
                        uint32_t proto_mask);
-int pim_channel_del_oif (struct channel_oil *c_oil,
-                        struct interface *oif,
-                        uint32_t proto_mask);
 
-int pim_channel_oil_empty (struct channel_oil *c_oil);
+int pim_channel_oil_empty(struct channel_oil *c_oil);
 
-char *pim_channel_oil_dump (struct channel_oil *c_oil, char *buf, size_t size);
+char *pim_channel_oil_dump(struct channel_oil *c_oil, char *buf, size_t size);
 #endif /* PIM_OIL_H */