lib/mdns/src/mdns.h
author Saverio Proto <zioproto@gmail.com>
Thu Mar 26 01:25:34 2009 +0100 (3 years ago)
changeset 2289 10ad22c88dbb
child 2310a2bf097f3756
permissions -rw-r--r--
Adding first version of the OLSR mdns plugin written by Saverio Proto and
Claudio Pisa (Ninux.org)
     1 /*
     2 OLSR MDNS plugin.
     3 Written by Saverio Proto <zioproto@gmail.com> and Claudio Pisa <clauz@ninux.org>.
     4 
     5     This file is part of OLSR MDNS PLUGIN.
     6 
     7     The OLSR MDNS PLUGIN is free software: you can redistribute it and/or modify
     8     it under the terms of the GNU General Public License as published by
     9     the Free Software Foundation, either version 3 of the License, or
    10     (at your option) any later version.
    11 
    12     The OLSR MDNS PLUGIN is distributed in the hope that it will be useful,
    13     but WITHOUT ANY WARRANTY; without even the implied warranty of
    14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15     GNU General Public License for more details.
    16 
    17     You should have received a copy of the GNU General Public License
    18     along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
    19 
    20 
    21  */
    22 
    23 
    24 #ifndef _MDNS_MDNS_H
    25 #define _MDNS_MDNS_H
    26 
    27 
    28 #include "plugin.h" /* union set_plugin_parameter_addon */
    29 
    30 #include "parser.h"
    31 
    32 #define MESSAGE_TYPE 132
    33 #define PARSER_TYPE		MESSAGE_TYPE
    34 #define EMISSION_INTERVAL       10     /* seconds */
    35 #define EMISSION_JITTER         25      /* percent */
    36 #define MDNS_VALID_TIME          1800    /* seconds */
    37 
    38 /* BMF plugin data */
    39 #define PLUGIN_NAME "OLSRD MDNS plugin"
    40 #define PLUGIN_NAME_SHORT "OLSRD MDNS"
    41 #define PLUGIN_VERSION "1.0.0 (" __DATE__ " " __TIME__ ")"
    42 #define PLUGIN_COPYRIGHT "  (C) Ninux.org"
    43 #define PLUGIN_AUTHOR "  Saverio Proto (zioproto@gmail.com)"
    44 #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION "\n" PLUGIN_COPYRIGHT "\n" PLUGIN_AUTHOR
    45 #define PLUGIN_INTERFACE_VERSION 5
    46 
    47 /* UDP-Port on which multicast packets are encapsulated */
    48 //#define BMF_ENCAP_PORT 50698
    49 
    50 /* Forward declaration of OLSR interface type */
    51 struct interface;
    52 
    53 //extern int FanOutLimit;
    54 //extern int BroadcastRetransmitCount;
    55 
    56 void DoMDNS(int sd, void * x, unsigned int y);
    57 void BmfPError(const char* format, ...) __attribute__((format(printf, 1, 2)));
    58 union olsr_ip_addr* MainAddressOf(union olsr_ip_addr* ip);
    59 //int InterfaceChange(struct interface* interf, int action);
    60 //int SetFanOutLimit(const char* value, void* data, set_plugin_parameter_addon addon);
    61 //int InitBmf(struct interface* skipThisIntf);
    62 //void CloseBmf(void);
    63 int InitMDNS(struct interface* skipThisIntf);
    64 void CloseMDNS(void);
    65 
    66 void olsr_mdns_gen(unsigned char*  packet, int len);
    67 
    68 /* Parser function to register with the scheduler */
    69 bool
    70 olsr_parser(union olsr_message *, struct interface *, union olsr_ip_addr *); 
    71 
    72 #endif /* _MDNS_MDNS_H */
    73 
    74 /*
    75  * Local Variables:
    76  * c-basic-offset: 2
    77  * indent-tabs-mode: nil
    78  * End:
    79  */