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