* ISO8859-* -> UTF_8
[olsrd.git] / lib / secure / src / olsrd_secure.h
1 /*
2  * Secure OLSR plugin
3  * http://www.olsr.org
4  *
5  * Copyright (c) 2004, Andreas Tønnesen(andreto@olsr.org)
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or 
9  * without modification, are permitted provided that the following 
10  * conditions are met:
11  *
12  * * Redistributions of source code must retain the above copyright 
13  *   notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright 
15  *   notice, this list of conditions and the following disclaimer in 
16  *   the documentation and/or other materials provided with the 
17  *   distribution.
18  * * Neither the name of olsrd, olsr.org nor the names of its 
19  *   contributors may be used to endorse or promote products derived 
20  *   from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
33  *POSSIBILITY OF SUCH DAMAGE.
34  *
35  */
36
37 /*
38  * Dynamic linked library example for UniK OLSRd
39  */
40
41 #ifndef _OLSRD_PLUGIN_TEST
42 #define _OLSRD_PLUGIN_TEST
43
44 #include "secure_messages.h"
45
46 #include "hashing.h"
47
48
49 #define KEYFILE "/etc/olsrd.d/olsrd_secure_key"
50
51 /* Schemes */
52 #define ONE_CHECKSUM          1
53
54 /* Algorithm definitions */
55 #define SHA1_INCLUDING_KEY   1
56 #define MD5_INCLUDING_KEY   2
57
58 #ifdef USE_OPENSSL
59 #define SIGNATURE_SIZE 20
60 #else
61 #define SIGNATURE_SIZE 16
62 #endif
63
64 #define KEYLENGTH      16
65
66 #define UPPER_DIFF 3
67 #define LOWER_DIFF -3
68
69 extern char aes_key[16];
70 /* Seconds of slack allowed */
71 #define SLACK 3
72
73 int secure_plugin_init(void);
74
75 void secure_plugin_exit(void);
76
77 int plugin_ipc_init(void);
78
79 #endif