2 * The olsr.org Optimized Link-State Routing daemon(olsrd)
3 * Copyright (c) 2004, Andreas Tonnesen(andreto@olsr.org)
4 * includes code by Bruno Randolf
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of olsr.org, olsrd nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
34 * Visit http://www.olsr.org for more information.
36 * If you find this software useful feel free to make a donation
37 * to the project. For more information see the website or contact
38 * the copyright holders.
42 #ifndef _OLSRD_INFO_TYPES_H
43 #define _OLSRD_INFO_TYPES_H
47 #include "common/autobuf.h"
49 /* these provide all of the runtime status info */
50 #define SIW_NEIGHBORS 0x0001
51 #define SIW_LINKS 0x0002
52 #define SIW_ROUTES 0x0004
53 #define SIW_HNA 0x0008
54 #define SIW_MID 0x0010
55 #define SIW_TOPOLOGY 0x0020
56 #define SIW_GATEWAYS 0x0040
57 #define SIW_INTERFACES 0x0080
58 #define SIW_2HOP 0x0100
59 #define SIW_SGW 0x0200
60 #define SIW_RUNTIME_ALL (SIW_NEIGHBORS | SIW_LINKS | SIW_ROUTES | SIW_HNA | SIW_MID | SIW_TOPOLOGY | SIW_GATEWAYS | SIW_INTERFACES | SIW_2HOP | SIW_SGW)
62 /* these only change at olsrd startup */
63 #define SIW_VERSION 0x0400
64 #define SIW_CONFIG 0x0800
65 #define SIW_PLUGINS 0x1000
66 #define SIW_STARTUP_ALL (SIW_VERSION | SIW_CONFIG | SIW_PLUGINS)
68 /* this is everything in normal format */
69 #define SIW_ALL (SIW_RUNTIME_ALL | SIW_STARTUP_ALL)
71 /* this data is not normal format but olsrd.conf format */
72 #define SIW_OLSRD_CONF 0x2000
74 typedef void (*init_plugin)(const char *plugin_name);
75 typedef const char * (*mime_type)(unsigned int send_what);
76 typedef void (*printer_neighbors)(struct autobuf *abuf, bool list_2hop);
77 typedef void (*printer_generic)(struct autobuf *abuf);
81 mime_type determine_mime_type;
82 printer_neighbors neighbors;
83 printer_generic links;
84 printer_generic routes;
85 printer_generic topology;
88 printer_generic gateways;
90 printer_generic version;
91 printer_generic olsrd_conf;
92 printer_generic interfaces;
93 printer_generic config;
94 printer_generic plugins;
95 } printer_functions_t;
100 char *buffer[MAX_CLIENTS];
101 size_t size[MAX_CLIENTS];
102 size_t written[MAX_CLIENTS];
103 int socket[MAX_CLIENTS];
107 #endif /* _OLSRD_INFO_TYPES_H */