2 * The olsr.org Optimized Link-State Routing daemon(olsrd)
3 * Copyright (c) 2004-2009, the olsr.org team - see HISTORY file
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
16 * * Neither the name of olsr.org, olsrd nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
33 * Visit http://www.olsr.org for more information.
35 * If you find this software useful feel free to make a donation
36 * to the project. For more information see the website or contact
37 * the copyright holders.
46 #include "olsrd_plugin.h" /* union set_plugin_parameter_addon */
47 #include "duplicate_set.h"
50 #define MESSAGE_TYPE 132
51 #define PARSER_TYPE MESSAGE_TYPE
52 #define EMISSION_INTERVAL 10 /* seconds */
53 #define EMISSION_JITTER 25 /* percent */
54 #define MDNS_VALID_TIME 1800 /* seconds */
57 #define PLUGIN_NAME "OLSRD MDNS plugin"
58 #define PLUGIN_NAME_SHORT "OLSRD MDNS"
59 #define PLUGIN_VERSION "1.0.0 (" __DATE__ " " __TIME__ ")"
60 #define PLUGIN_COPYRIGHT " (C) Ninux.org"
61 #define PLUGIN_AUTHOR " Saverio Proto (zioproto@gmail.com)"
62 #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION "\n" PLUGIN_COPYRIGHT "\n" PLUGIN_AUTHOR
63 #define PLUGIN_INTERFACE_VERSION 5
65 /* UDP-Port on which multicast packets are encapsulated */
66 //#define BMF_ENCAP_PORT 50698
68 /* Forward declaration of OLSR interface type */
71 extern struct list_entity ListOfFilteredHosts;
73 //extern int FanOutLimit;
74 //extern int BroadcastRetransmitCount;
76 void DoMDNS(int sd, void *x, unsigned int y);
77 void BmfPError(const char *format, ...) __attribute__ ((format(printf, 1, 2)));
78 union olsr_ip_addr *MainAddressOf(union olsr_ip_addr *ip);
79 //int InterfaceChange(struct interface* interf, int action);
80 //int SetFanOutLimit(const char* value, void* data, set_plugin_parameter_addon addon);
81 //int InitBmf(struct interface* skipThisIntf);
82 //void CloseBmf(void);
83 int InitMDNS(struct interface *skipThisIntf);
86 void olsr_mdns_gen(unsigned char *packet, int len);
88 /* Parser function to register with the scheduler */
89 bool olsr_parser(union olsr_message *, struct interface *, union olsr_ip_addr *);
91 #endif /* _MDNS_MDNS_H */
96 * indent-tabs-mode: nil