Commit be4ac6f6 authored by casualet's avatar casualet

able to show onion type and onion name

parent 9c93ef99
...@@ -48,6 +48,8 @@ using std::cout; ...@@ -48,6 +48,8 @@ using std::cout;
using std::cin; using std::cin;
using std::endl; using std::endl;
std::map<SECLEVEL,std::string> gmp; std::map<SECLEVEL,std::string> gmp;
std::map<onion,std::string> gmp2;
static std::string embeddedDir="/t/cryt/shadow"; static std::string embeddedDir="/t/cryt/shadow";
...@@ -456,9 +458,10 @@ struct transField{ ...@@ -456,9 +458,10 @@ struct transField{
int numOfOnions; int numOfOnions;
//onions //onions
std::vector<std::string> fields; std::vector<std::string> fields;
std::vector<onion> onions;
void show(){ void show(){
for(auto item:fields){ for(auto i=0U;i<fields.size();i++){
cout<<item<<"\t"; cout<<fields[i]<<" : "<<gmp2[onions[i]]<<"\t";
} }
cout<<endl; cout<<endl;
if(hasSalt){ if(hasSalt){
...@@ -475,6 +478,7 @@ static std::vector<transField> getTransField(std::vector<FieldMeta *> pfms){ ...@@ -475,6 +478,7 @@ static std::vector<transField> getTransField(std::vector<FieldMeta *> pfms){
for(std::pair<const OnionMetaKey *, OnionMeta *> &ompair:pfm->orderedOnionMetas()){ for(std::pair<const OnionMetaKey *, OnionMeta *> &ompair:pfm->orderedOnionMetas()){
tf.numOfOnions++; tf.numOfOnions++;
tf.fields.push_back((ompair.second)->getAnonOnionName()); tf.fields.push_back((ompair.second)->getAnonOnionName());
tf.onions.push_back(ompair.first->getValue());
} }
if(pfm->getHasSalt()){ if(pfm->getHasSalt()){
tf.hasSalt=true; tf.hasSalt=true;
...@@ -965,6 +969,15 @@ main() { ...@@ -965,6 +969,15 @@ main() {
gmp[SECLEVEL::HOM]="HOM"; gmp[SECLEVEL::HOM]="HOM";
gmp[SECLEVEL::RND]="RND"; gmp[SECLEVEL::RND]="RND";
gmp2[oDET]="oDET";
gmp2[oOPE]="oOPE";
gmp2[oAGG]="oAGG";
gmp2[oSWP]="oSWP";
gmp2[oPLAIN]="oPLAIN";
gmp2[oBESTEFFORT]="oBESTEFFORT";
gmp2[oINVALID]="oINVALID";
std::string client="192.168.1.1:1234"; std::string client="192.168.1.1:1234";
//one Wrapper per user. //one Wrapper per user.
clients[client] = new WrapperState(); clients[client] = new WrapperState();
...@@ -1008,7 +1021,6 @@ main() { ...@@ -1008,7 +1021,6 @@ main() {
for(auto &item:res){ for(auto &item:res){
item.show(); item.show();
} }
}else{ }else{
std::cout<<GREEN_BEGIN<<"curQuery: "<<curQuery<<"\n"<<COLOR_END<<std::endl; std::cout<<GREEN_BEGIN<<"curQuery: "<<curQuery<<"\n"<<COLOR_END<<std::endl;
batchTogether(client,curQuery,_thread_id); batchTogether(client,curQuery,_thread_id);
......
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