Skip to content
This repository
Newer
Older
100644 65 lines (56 sloc) 2.302 kb
69d4044b »
2012-04-22 Added modelines to source files.
1 /* vim: set expandtab ts=4 sw=4: */
9aa22fec »
2012-01-12 Offered permission to copy under gplv3 license.
2 /*
3 * You may redistribute this program and/or modify it under the terms of
4 * the GNU General Public License as published by the Free Software Foundation,
5 * either version 3 of the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
547f4a33 »
2012-02-15 Cleaned up a bunch of files, added a codestyle validator and some inf…
15 #ifndef SwitchCore_H
16 #define SwitchCore_H
83058807 »
2011-11-21 Added beginnings of flood prevention
17
5b0c65f5 »
2011-11-27 Switched wire form around, added Interface struct, reworked CryptoAuth.
18 #include "interface/Interface.h"
b7f23b15 »
2012-01-15 Moved log to util
19 #include "util/Log.h"
83058807 »
2011-11-21 Added beginnings of flood prevention
20 #include "wire/Message.h"
21
63234a21 »
2011-12-24 Added new logging infrastructure.
22 #include <stdint.h>
23
83058807 »
2011-11-21 Added beginnings of flood prevention
24 /** The switch core which is opaque to users. */
1706066d »
2011-11-21 Added switch core
25 struct SwitchCore;
26
83058807 »
2011-11-21 Added beginnings of flood prevention
27 /**
28 * Create a new router core.
29 *
63234a21 »
2011-12-24 Added new logging infrastructure.
30 * @param logger what to log output to.
83058807 »
2011-11-21 Added beginnings of flood prevention
31 * @param allocator the memory allocator to use for allocating the core context and interfaces.
32 */
cc3cded8 »
2012-01-15 Rename MemAllocator Allocator
33 struct SwitchCore* SwitchCore_new(struct Log* logger, struct Allocator* allocator);
83058807 »
2011-11-21 Added beginnings of flood prevention
34
35 /**
36 * Register a new interface.
5b0c65f5 »
2011-11-27 Switched wire form around, added Interface struct, reworked CryptoAuth.
37 * All interfaces are point to point so messages sent down an interface.
83058807 »
2011-11-21 Added beginnings of flood prevention
38 *
5b0c65f5 »
2011-11-27 Switched wire form around, added Interface struct, reworked CryptoAuth.
39 * @param iface the interface to add.
40 * @param trust the amount that you trust the connected node.
0689af8d »
2011-12-15 Halfway through debugging...
41 * @param labelOut_be a buffer which will be filled with the label part for getting
42 * to the newly added node. It will be set to the big endian value.
5b0c65f5 »
2011-11-27 Switched wire form around, added Interface struct, reworked CryptoAuth.
43 * @param core the switchcore.
1f05911d »
2011-12-05 Whole bunch of unfinished work for gluing the switch to the router.
44 * @return 0 on success, -1 if there are no more interface slots.
83058807 »
2011-11-21 Added beginnings of flood prevention
45 */
1f05911d »
2011-12-05 Whole bunch of unfinished work for gluing the switch to the router.
46 int SwitchCore_addInterface(struct Interface* iface,
47 const uint64_t trust,
0689af8d »
2011-12-15 Halfway through debugging...
48 uint64_t* labelOut_be,
1f05911d »
2011-12-05 Whole bunch of unfinished work for gluing the switch to the router.
49 struct SwitchCore* core);
50
51 /**
52 * Set the router interface.
53 * This interface is needed by all switches because a switch cannot function without a router.
54 * Do not send messages before registering this interface and at least one other.
55 *
56 * @param iface the router interface.
57 * @param core the switchcore.
58 * @return 0
59 */
60 int SwitchCore_setRouterInterface(struct Interface* iface, struct SwitchCore* core);
63234a21 »
2011-12-24 Added new logging infrastructure.
61
94f77806 »
2012-04-10 #47 fixed, cleaned up logging in CryptoAuth, added ability to remove …
62 void SwitchCore_swapInterfaces(struct Interface* if1, struct Interface* if2);
63
63234a21 »
2011-12-24 Added new logging infrastructure.
64 #endif
Something went wrong with that request. Please try again.