Commit e95a21bd authored by yiwenshao's avatar yiwenshao

debug/test_onion_conf.cc

parent a260b621
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPE RND
oAGG: HOM
[end]
[onions for str]
oDET: DET RND
oOPE: OPE RND
oSWP: SEARCH
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPEFOREIGN OPE RND
oAGG: HOM
[end]
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPE RND
oAGG: HOM
[end]
[onions for num]
oPLAIN: PLAINVAL
[onions for str]
oDET: DETJOIN DET RND
oOPE: OPEFOREIGN OPE RND
[end]
[onions for str]
oDET: DETJOIN DET RND
oOPE: OPE RND
oSWP: SEARCH
[end]
#comments
#typedef enum onion {
# oDET,
# oOPE,
# oAGG,
# oSWP,
# oPLAIN,
# oBESTEFFORT,
# oASHE,
# oINVALID,
#} onion;
#
#extern std::map<std::string,onion> string_to_onion;
#
#//Sec levels ordered such that
#// if a is less secure than b.
#// a appears before b
#// (note, this is not "iff")
#
#enum class SECLEVEL {
# INVALID,
# PLAINVAL,
# OPEFOREIGN,
# OPE,
# DETJOIN,
# DET,
# SEARCH,
# HOM,
# ASHE,//added
# RND,
#};
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPE RND
oAGG: HOM
oASHE: ASHE
[end]
[onions for str]
oDET: DETJOIN DET RND
oOPE: OPE RND
oSWP: SEARCH
[end]
#comments
#typedef enum onion {
# oDET,
# oOPE,
# oAGG,
# oSWP,
# oPLAIN,
# oBESTEFFORT,
# oASHE,
# oINVALID,
#} onion;
#
#extern std::map<std::string,onion> string_to_onion;
#
#//Sec levels ordered such that
#// if a is less secure than b.
#// a appears before b
#// (note, this is not "iff")
#
#enum class SECLEVEL {
# INVALID,
# PLAINVAL,
# OPEFOREIGN,
# OPE,
# DETJOIN,
# DET,
# SEARCH,
# HOM,
# ASHE,//added
# RND,
#};
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPE RND
oAGG: HOM
oASHE: ASHE
[end]
[onions for str]
oDET: DETJOIN DET RND
oOPE: OPE RND
oSWP: SEARCH
[end]
......@@ -3,7 +3,6 @@
#include <iostream>
#include <vector>
#include <map>
#include "util/onions.hh"
#include <assert.h>
using namespace std;
......@@ -50,7 +49,7 @@ void onion_conf::read_onionlayout_num(std::string temp){
std::string onion_name = res[0];
onions_for_str[onion_name] = std::vector<std::string>();
for(;i<res.size();i++){
onions_for_str[onion_name].push_back(res[i]);
onions_for_num[onion_name].push_back(res[i]);
}
}
......
#include "util/onions.hh"
int main(){
char *dir = (char*)"/home/casualet/github/Practical-Cryptdb/onionlayout.conf";
onion_conf of(dir);
auto res = of.get_onionlayout_for_num();
auto res2 = of.get_onion_levels_str();
return 0;
}
#include "util/onions.hh"
int main(){
const char *di = dir;
onion_conf of(di);
auto res = of.get_onionlayout_for_num();
auto res2 = of.get_onion_levels_str();
return 0;
}
#include <stdio.h>
#include <unistd.h>
int
main() {
char *buffer;
if((buffer = getcwd(NULL, 0)) == NULL){
printf("error getcwd\n");
return 0;
}
printf("%s",buffer);
return 0;
}
......@@ -12,6 +12,7 @@
#include <main/metadata_tables.hh>
#include <main/macro_util.hh>
#include "util/onions.hh"
//对于schemaInfo而言, 先获得自己的id, 作为parent, 可以查找底下的databasemeta的serial,key以及id
//然后通过lambda表达式,先把databasemeta加入到schemainfo的map中, 然后返回这写个databasemeta供后续使用.
......
#comments
#typedef enum onion {
# oDET,
# oOPE,
# oAGG,
# oSWP,
# oPLAIN,
# oBESTEFFORT,
# oASHE,
# oINVALID,
#} onion;
#
#extern std::map<std::string,onion> string_to_onion;
#
#//Sec levels ordered such that
#// if a is less secure than b.
#// a appears before b
#// (note, this is not "iff")
#
#enum class SECLEVEL {
# INVALID,
# PLAINVAL,
# OPEFOREIGN,
# OPE,
# DETJOIN,
# DET,
# SEARCH,
# HOM,
# ASHE,//added
# RND,
#};
[onions for num]
oDET: DETJOIN DET RND
oOPE: OPE RND
oHOM: HOM
oAGG: HOM
oASHE: ASHE
[end]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment