|
@@ -1,5 +1,6 @@
|
|
|
#include "pcap_processor.h"
|
|
|
#include <pybind11/pybind11.h>
|
|
|
+#include <pybind11/embed.h>
|
|
|
|
|
|
namespace py = pybind11;
|
|
|
|
|
@@ -11,7 +12,10 @@ int main(){
|
|
|
std::string db_path = "/home/pepper-jk/.cache/id2t/db/73/45/dbdec9ab5040.sqlite3";
|
|
|
|
|
|
std::cout << "start" << std::endl;
|
|
|
- pcap_processor* pp = new pcap_processor(pcap_path, extra_tests, resource_path, db_path);
|
|
|
+
|
|
|
+ py::scoped_interpreter guard{};
|
|
|
+ std::cout << "interpreter" << std::endl;
|
|
|
+ pcap_processor pp(pcap_path, extra_tests, resource_path, db_path);
|
|
|
std::cout << "pp" << std::endl;
|
|
|
|
|
|
// [10.0]
|
|
@@ -21,13 +25,13 @@ int main(){
|
|
|
intervals.append(elem);
|
|
|
std::cout << "py::list" << std::endl;
|
|
|
|
|
|
- pp->collect_statistics(intervals);
|
|
|
+ pp.collect_statistics(intervals);
|
|
|
std::cout << "collect_statistics" << std::endl;
|
|
|
|
|
|
// /home/pepper-jk/.cache/id2t/db/73/45/dbdec9ab5040.sqlite3, [10.0], True
|
|
|
bool del = true;
|
|
|
|
|
|
- pp->write_to_database(db_path, intervals, del);
|
|
|
+ pp.write_to_database(db_path, intervals, del);
|
|
|
std::cout << "write_to_database" << std::endl;
|
|
|
|
|
|
return 0;
|