X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=pimd%2Fpim_mroute.h;h=2d8e1b01fb89117e391aebf0fa21f0d6c63bb0e0;hb=0dcbec72aa2b508c194ec4391b6d821ea996fb08;hp=ce300f0ab0a5d2fce29c583ba10f6f499b79af2b;hpb=75a26779e8f25e9868f1f33e0fd35677f17c978b;p=mirror_frr.git diff --git a/pimd/pim_mroute.h b/pimd/pim_mroute.h index ce300f0ab..2d8e1b01f 100644 --- a/pimd/pim_mroute.h +++ b/pimd/pim_mroute.h @@ -1,23 +1,21 @@ /* - 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 - -*/ + * 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_MROUTE_H #define PIM_MROUTE_H @@ -69,31 +67,35 @@ #define MRT_PIM (MRT_BASE+8) /* enable PIM code */ #endif +#ifndef MRT_TABLE +#define MRT_TABLE (209) /* Specify mroute table ID */ +#endif + #ifndef HAVE_VIFI_T typedef unsigned short vifi_t; #endif #ifndef HAVE_STRUCT_VIFCTL struct vifctl { - vifi_t vifc_vifi; /* Index of VIF */ - unsigned char vifc_flags; /* VIFF_ flags */ - unsigned char vifc_threshold; /* ttl limit */ - unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ - struct in_addr vifc_lcl_addr; /* Our address */ - struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ + vifi_t vifc_vifi; /* Index of VIF */ + unsigned char vifc_flags; /* VIFF_ flags */ + unsigned char vifc_threshold; /* ttl limit */ + unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ + struct in_addr vifc_lcl_addr; /* Our address */ + struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ }; #endif #ifndef HAVE_STRUCT_MFCCTL struct mfcctl { - struct in_addr mfcc_origin; /* Origin of mcast */ - struct in_addr mfcc_mcastgrp; /* Group in question */ - vifi_t mfcc_parent; /* Where it arrived */ - unsigned char mfcc_ttls[MAXVIFS]; /* Where it is going */ - unsigned int mfcc_pkt_cnt; /* pkt count for src-grp */ - unsigned int mfcc_byte_cnt; - unsigned int mfcc_wrong_if; - int mfcc_expire; + struct in_addr mfcc_origin; /* Origin of mcast */ + struct in_addr mfcc_mcastgrp; /* Group in question */ + vifi_t mfcc_parent; /* Where it arrived */ + unsigned char mfcc_ttls[MAXVIFS]; /* Where it is going */ + unsigned int mfcc_pkt_cnt; /* pkt count for src-grp */ + unsigned int mfcc_byte_cnt; + unsigned int mfcc_wrong_if; + int mfcc_expire; }; #endif @@ -109,11 +111,11 @@ struct mfcctl { */ #ifndef HAVE_STRUCT_SIOC_SG_REQ struct sioc_sg_req { - struct in_addr src; - struct in_addr grp; - unsigned long pktcnt; - unsigned long bytecnt; - unsigned long wrong_if; + struct in_addr src; + struct in_addr grp; + unsigned long pktcnt; + unsigned long bytecnt; + unsigned long wrong_if; }; #endif @@ -128,11 +130,11 @@ struct sioc_sg_req { */ #ifndef HAVE_STRUCT_SIOC_VIF_REQ struct sioc_vif_req { - vifi_t vifi; /* Which iface */ - unsigned long icount; /* In packets */ - unsigned long ocount; /* Out packets */ - unsigned long ibytes; /* In bytes */ - unsigned long obytes; /* Out bytes */ + vifi_t vifi; /* Which iface */ + unsigned long icount; /* In packets */ + unsigned long ocount; /* Out packets */ + unsigned long ibytes; /* In bytes */ + unsigned long obytes; /* Out bytes */ }; #endif @@ -146,14 +148,13 @@ struct sioc_vif_req { #endif #ifndef HAVE_STRUCT_IGMPMSG -struct igmpmsg -{ - uint32_t unused1,unused2; - unsigned char im_msgtype; /* What is this */ - unsigned char im_mbz; /* Must be zero */ - unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */ - unsigned char unused3; - struct in_addr im_src,im_dst; +struct igmpmsg { + uint32_t unused1, unused2; + unsigned char im_msgtype; /* What is this */ + unsigned char im_mbz; /* Must be zero */ + unsigned char im_vif; /* Interface (this ought to be a vifi_t!) */ + unsigned char unused3; + struct in_addr im_src, im_dst; }; #endif #endif @@ -166,16 +167,22 @@ struct igmpmsg Above: from */ -int pim_mroute_socket_enable(void); -int pim_mroute_socket_disable(void); - -int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr, unsigned char flags); -int pim_mroute_del_vif(int vif_index); +int pim_mroute_socket_enable(struct pim_instance *pim); +int pim_mroute_socket_disable(struct pim_instance *pim); -int pim_mroute_add(struct channel_oil *c_oil); -int pim_mroute_del(struct channel_oil *c_oil); +int pim_mroute_add_vif(struct interface *ifp, struct in_addr ifaddr, + unsigned char flags); +int pim_mroute_del_vif(struct interface *ifp); -int pim_mroute_msg(int fd, const char *buf, int buf_size); +int pim_upstream_mroute_add(struct channel_oil *c_oil, const char *name); +int pim_upstream_mroute_iif_update(struct channel_oil *c_oil, const char *name); +int pim_static_mroute_add(struct channel_oil *c_oil, const char *name); +void pim_static_mroute_iif_update(struct channel_oil *c_oil, + int input_vif_index, + const char *name); +int pim_mroute_del(struct channel_oil *c_oil, const char *name); -void pim_mroute_update_counters (struct channel_oil *c_oil); +void pim_mroute_update_counters(struct channel_oil *c_oil); +bool pim_mroute_allow_iif_in_oil(struct channel_oil *c_oil, + int oif_index); #endif /* PIM_MROUTE_H */