5 * OLSR Basic Multicast Forwarding (BMF) plugin.
6 * Copyright (c) 2005 - 2007, Thales Communications, Huizen, The Netherlands.
7 * Written by Erik Tromp.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
20 * * Neither the name of Thales, BMF nor the names of its
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
31 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33 * OF THE POSSIBILITY OF SUCH DAMAGE.
36 /* -------------------------------------------------------------------------
38 * Description: Multicast forwarding functions
39 * Created : 29 Jun 2006
41 * ------------------------------------------------------------------------- */
43 #include "olsrd_plugin.h" /* union set_plugin_parameter_addon */
44 #include "interfaces.h" /* enum olsr_ifchg_flag */
47 #define PLUGIN_NAME "OLSRD Basic Multicast Forwarding (BMF) plugin"
48 #define PLUGIN_NAME_SHORT "OLSRD BMF"
49 #define PLUGIN_COPYRIGHT " (C) Thales Communications Huizen, Netherlands"
50 #define PLUGIN_AUTHOR " Erik Tromp (eriktromp@users.sourceforge.net)"
51 #define MOD_DESC PLUGIN_NAME "\n" PLUGIN_COPYRIGHT "\n" PLUGIN_AUTHOR
52 #define PLUGIN_INTERFACE_VERSION 5
54 /* UDP-Port on which multicast packets are encapsulated */
55 #define BMF_ENCAP_PORT 50698
57 /* Forward declaration of OLSR interface type */
58 struct interface_olsr;
60 extern int FanOutLimit;
61 extern int BroadcastRetransmitCount;
63 void BMF_handle_captureFd(int skfd, void *data, unsigned int);
64 void BMF_handle_listeningFd(int skfd, void *data, unsigned int);
65 void BMF_handle_encapsulatingFd(int skfd, void *data, unsigned int);
66 void BMF_handle_tuntapFd(int, void*, unsigned int);
68 void BmfPError(const char* format, ...) __attribute__((format(printf, 1, 2)));
69 union olsr_ip_addr* MainAddressOf(union olsr_ip_addr* ip);
70 void InterfaceChange(int, struct interface_olsr * interf, enum olsr_ifchg_flag action);
71 int SetFanOutLimit(const char* value, void* data, set_plugin_parameter_addon addon);
72 int InitBmf(struct interface_olsr * skipThisIntf);
75 #endif /* _BMF_BMF_H */