6 * Copyright (c) 2004, Andreas Tonnesen(andreto@olsr.org)
9 * Redistribution and use in source and binary forms, with or
10 * without modification, are permitted provided that the following
13 * * Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
19 * * Neither the name of olsrd, olsr.org nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
39 * olsr.org olsr daemon security plugin
42 #ifndef _OLSRD_SECURE_MSG
43 #define _OLSRD_SECURE_MSG
45 #include <sys/types.h>
46 #include <sys/socket.h>
47 #include <netinet/in.h>
48 #include <arpa/inet.h>
54 #include "olsr_types.h"
55 #include "interfaces.h"
57 /* The type of message you will use */
58 #define MESSAGE_TYPE 10
60 /* The type of messages we will receive - can be set to promiscuous */
61 #define PARSER_TYPE MESSAGE_TYPE
63 #define TYPE_CHALLENGE 11
64 #define TYPE_CRESPONSE 12
65 #define TYPE_RRESPONSE 13
67 extern char keyfile[FILENAME_MAX + 1];
71 #else /* USE_OPENSSL */
73 #endif /* USE_OPENSSL */
75 /****************************************************************************
77 ****************************************************************************/
85 uint8_t signature[SIGSIZE];
89 * OLSR message (several can exist in one OLSR packet)
95 uint16_t olsr_msgsize;
101 /* YOUR PACKET GOES HERE */
107 * Challenge response messages
110 struct challengemsg {
111 uint8_t olsr_msgtype;
113 uint16_t olsr_msgsize;
119 uint32_t destination;
122 uint8_t signature[SIGSIZE];
127 uint8_t olsr_msgtype;
129 uint16_t olsr_msgsize;
135 uint32_t destination;
139 uint8_t res_sig[SIGSIZE];
141 uint8_t signature[SIGSIZE];
145 uint8_t olsr_msgtype;
147 uint16_t olsr_msgsize;
153 uint32_t destination;
156 uint8_t res_sig[SIGSIZE];
158 uint8_t signature[SIGSIZE];
166 uint8_t olsr_msgtype;
168 uint16_t olsr_msgsize;
169 struct in6_addr originator;
174 /* YOUR PACKET GOES HERE */
179 * Generic OLSR packet - DO NOT ALTER
183 uint16_t olsr_packlen; /* packet length */
185 struct s_olsrmsg olsr_msg[1]; /* variable messages */
189 uint16_t olsr_packlen; /* packet length */
191 struct s_olsrmsg6 olsr_msg[1]; /* variable messages */
194 #endif /* _OLSRD_SECURE_MSG */
199 * indent-tabs-mode: nil