Browse Source

Finally got it to link properly with the rest

master
David Lanzendörfer 9 months ago
parent
commit
734d41fa32
10 changed files with 87 additions and 43 deletions
  1. +15
    -0
      CMakeLists.txt
  2. +0
    -5
      Makefile
  3. +2
    -32
      pep-server.cpp
  4. +31
    -0
      server.cpp
  5. +15
    -0
      types/CMakeLists.txt
  6. +4
    -1
      types/pEpDBusEncryptionFlags.cpp
  7. +5
    -2
      types/pEpDBusMessage.cpp
  8. +5
    -1
      types/pEpDBusRating.cpp
  9. +5
    -1
      types/pEpDBusStatus.cpp
  10. +5
    -1
      types/pEpDBusStringList.cpp

+ 15
- 0
CMakeLists.txt View File

@ -0,0 +1,15 @@
project(pEpDBusAdapter)
add_subdirectory(types)
add_library(pEpDBusAdapterServer SHARED pep-server.cpp)
target_link_libraries(pEpDBusAdapterServer
pEpDBusAdapterTypes
)
set_target_properties(pEpDBusAdapterServer PROPERTIES
CXX_VISIBILITY_PRESET default
VISIBILITY_INLINES_HIDDEN 0)
add_executable(server server.cpp)
target_link_libraries(server pEpDBusAdapterServer dbus-c++-1)

+ 0
- 5
Makefile View File

@ -1,5 +0,0 @@
all:
#rm -f pepadaptop.h main
/usr/bin/dbusxx-xml2cpp pep-introspect.xml --adaptor=pep-server-glue.h --proxy=pep-client.h
g++ -DNDEBUG -I/usr/include -I/usr/include/dbus-c++-1 -I. -Itypes -ldbus-c++-1 types/*.cpp pep-server.cpp -o main

+ 2
- 32
pep-server.cpp View File

@ -4,14 +4,11 @@
#include "pep-server.h"
#include "dbus-c++/error.h"
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <stdio.h>
#include <limits.h>
static const char *ASYNC_SERVER_NAME = "security.pep";
static const char *ASYNC_SERVER_PATH = "/security/pep";
pEp::Server::Server(DBus::Connection &connection)
@ -21,37 +18,10 @@ pEp::Server::Server(DBus::Connection &connection)
pEp::Server::~Server() {};
DBus::BusDispatcher dispatcher;
void niam(int sig)
{
dispatcher.leave();
}
/*void pEpServer::decryptMessage(const message& src, const PEP_rating& rating, const PEP_encrypt_flags_t& flags, PEP_STATUS& status, message& dst, stringlist_t& keylist)
{
std::cout << "Trying to decrypt the data" << std::endl;
status = decrypt_message( mSession, (message*)&src, (message**)&dst, (stringlist_t**)&keylist, (PEP_rating*)rating, (PEP_encrypt_flags_t*)&flags );
//dbus_g_method_return( status );
}*/
void pEp::Server::decryptMessage(const pEpDBusMessage& src, const pEpDBusStringList& keylist, const pEpDBusRating& rating,
const pEpDBusEncryptionFlags& flags, pEpDBusStatus& status, pEpDBusMessage& dst)
{
std::cout << "Trying to decrypt the data" << std::endl;
//status = decrypt_message( mSession, (message*)&src, (message**)&dst, (stringlist_t**)&keylist, (PEP_rating*)rating, (PEP_encrypt_flags_t*)&flags );
}
int main()
{
signal(SIGTERM, niam);
signal(SIGINT, niam);
DBus::default_dispatcher = &dispatcher;
DBus::Connection conn = DBus::Connection::SessionBus();
conn.request_name(ASYNC_SERVER_NAME);
pEp::Server server(conn);
dispatcher.enter();
return 0;
}

+ 31
- 0
server.cpp View File

@ -0,0 +1,31 @@
#include "pep-server.h"
#include "dbus-c++/error.h"
#include <signal.h>
static const char *ASYNC_SERVER_NAME = "security.pep";
DBus::BusDispatcher dispatcher;
void niam(int sig)
{
dispatcher.leave();
}
int main()
{
signal(SIGTERM, niam);
signal(SIGINT, niam);
DBus::default_dispatcher = &dispatcher;
DBus::Connection conn = DBus::Connection::SessionBus();
conn.request_name(ASYNC_SERVER_NAME);
pEp::Server server(conn);
dispatcher.enter();
return 0;
}

+ 15
- 0
types/CMakeLists.txt View File

@ -0,0 +1,15 @@
add_library(pEpDBusAdapterTypes SHARED
pEpDBusEncryptionFlags.cpp
pEpDBusMessage.cpp
pEpDBusRating.cpp
pEpDBusStatus.cpp
pEpDBusStringList.cpp
)
target_link_libraries(pEpDBusAdapterTypes dbus-c++-1)
set_target_properties(pEpDBusAdapterTypes PROPERTIES
CXX_VISIBILITY_PRESET default
VISIBILITY_INLINES_HIDDEN 0)

+ 4
- 1
types/pEpDBusEncryptionFlags.cpp View File

@ -2,4 +2,7 @@
pEpDBusEncryptionFlags::pEpDBusEncryptionFlags() {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusEncryptionFlags&) {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusEncryptionFlags&) {
DBus::Variant ret;
return ret;
}

+ 5
- 2
types/pEpDBusMessage.cpp View File

@ -2,5 +2,8 @@
pEpDBusMessage::pEpDBusMessage() {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusMessage&) {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusMessage&)
{
DBus::Variant ret;
return ret;
}

+ 5
- 1
types/pEpDBusRating.cpp View File

@ -2,5 +2,9 @@
pEpDBusRating::pEpDBusRating() {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusRating&) {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusRating&)
{
DBus::Variant ret;
return ret;
}

+ 5
- 1
types/pEpDBusStatus.cpp View File

@ -2,4 +2,8 @@
pEpDBusStatus::pEpDBusStatus() {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusStatus&) {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusStatus&)
{
DBus::Variant ret;
return ret;
}

+ 5
- 1
types/pEpDBusStringList.cpp View File

@ -2,4 +2,8 @@
pEpDBusStringList::pEpDBusStringList() {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusStringList&) {}
DBus::Variant& operator<<(DBus::Variant&, const pEpDBusStringList&)
{
DBus::Variant ret;
return ret;
}

Loading…
Cancel
Save