first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / octopi / library / cromp / cromp_security.cpp
1 /*****************************************************************************\
2 *                                                                             *
3 *  Name   : cromp_security                                                    *
4 *  Author : Chris Koeritz                                                     *
5 *                                                                             *
6 *******************************************************************************
7 * Copyright (c) 2002-$now By Author.  This program is free software; you can  *
8 * redistribute it and/or modify it under the terms of the GNU General Public  *
9 * License as published by the Free Software Foundation; either version 2 of   *
10 * the License or (at your option) any later version.  This is online at:      *
11 *     http://www.fsf.org/copyleft/gpl.html                                    *
12 * Please send any updates to: fred@gruntose.com                               *
13 \*****************************************************************************/
14
15 #include "cromp_security.h"
16 #include "cromp_server.h"
17
18 #include <basis/functions.h>
19 #include <octopus/entity_defs.h>
20 #include <sockets/internet_address.h>
21 #include <sockets/machine_uid.h>
22 #include <sockets/tcpip_stack.h>
23
24 using namespace basis;
25 using namespace octopi;
26 using namespace sockets;
27 //using namespace basis;
28
29 namespace cromp {
30
31 //#define DEBUG_CROMP_SECURITY
32   // uncomment if you want the noisier version.
33
34 #undef LOG
35 #define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
36
37 cromp_security::cromp_security()
38 : _stack(new tcpip_stack)
39 {
40 }
41
42 cromp_security::~cromp_security()
43 {
44   WHACK(_stack);
45 }
46
47 bool cromp_security::add_entity(const octopus_entity &client,
48           const byte_array &verification)
49 {
50 #ifdef DEBUG_CROMP_SECURITY
51   FUNCDEF("add_entity");
52   LOG(astring("adding ") + client.mangled_form());
53 #endif
54   return simple_entity_registry::add_entity(client, verification);
55 }
56
57 } //namespace.
58