Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Practical-Cryptdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhaozhen
Practical-Cryptdb
Commits
e14bf0d7
Commit
e14bf0d7
authored
Jan 21, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify big_proxy and micro_db_init_int to be able to specify ip and db
parent
5f9a77e1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
10 deletions
+13
-10
hello.cc
debug/hello.cc
+0
-4
micro_init_int.cc
debug/micro_init_int.cc
+7
-1
test_proxy.cc
debug/test_proxy.cc
+1
-1
Makefrag
main/Makefrag
+1
-1
big_proxy.cc
main/big_proxy.cc
+2
-2
big_proxy.hh
main/big_proxy.hh
+2
-1
No files found.
debug/hello.cc
deleted
100644 → 0
View file @
5f9a77e1
int
main
(){
return
0
;
}
debug/micro_init_int.cc
View file @
e14bf0d7
...
@@ -9,7 +9,13 @@ main(int argc,char ** argv) {
...
@@ -9,7 +9,13 @@ main(int argc,char ** argv) {
"use micro_db;"
,
"use micro_db;"
,
"create table int_table(id integer);"
,
"create table int_table(id integer);"
,
};
};
big_proxy
b
;
if
(
argc
!=
3
){
std
::
cout
<<
"1:db, 2:ip"
<<
std
::
endl
;
return
0
;
}
std
::
string
db
=
std
::
string
(
argv
[
1
]);
std
::
string
ip
=
std
::
string
(
argv
[
2
]);
big_proxy
b
(
"tdb"
,
"127.0.0.1"
,
"root"
,
"letmein"
,
3306
);
for
(
auto
item
:
create
){
for
(
auto
item
:
create
){
b
.
go
(
item
);
b
.
go
(
item
);
}
}
...
...
main
/test_proxy.cc
→
debug
/test_proxy.cc
View file @
e14bf0d7
#include "big_proxy.hh"
#include "
main/
big_proxy.hh"
using
std
::
string
;
using
std
::
string
;
int
int
main
(
int
argc
,
char
**
argv
)
{
main
(
int
argc
,
char
**
argv
)
{
...
...
main/Makefrag
View file @
e14bf0d7
...
@@ -7,7 +7,7 @@ CRYPTDB_SRCS := schema.cc Translator.cc Connect.cc \
...
@@ -7,7 +7,7 @@ CRYPTDB_SRCS := schema.cc Translator.cc Connect.cc \
rewrite_func.cc rewrite_sum.cc metadata_tables.cc \
rewrite_func.cc rewrite_sum.cc metadata_tables.cc \
error.cc stored_procedures.cc rewrite_ds.cc rewrite_main.cc big_proxy.cc
error.cc stored_procedures.cc rewrite_ds.cc rewrite_main.cc big_proxy.cc
CRYPTDB_PROGS:= cdb_test load_and_store test_layer test_schema
test_proxy
change_test insert_conf_onion
CRYPTDB_PROGS:= cdb_test load_and_store test_layer test_schema change_test insert_conf_onion
CRYPTDBPROGOBJS := $(patsubst %,$(OBJDIR)/main/%,$(CRYPTDB_PROGS))
CRYPTDBPROGOBJS := $(patsubst %,$(OBJDIR)/main/%,$(CRYPTDB_PROGS))
...
...
main/big_proxy.cc
View file @
e14bf0d7
...
@@ -148,12 +148,12 @@ void parseResType(const ResType &rd) {
...
@@ -148,12 +148,12 @@ void parseResType(const ResType &rd) {
}
}
}
}
big_proxy
::
big_proxy
(
std
::
string
db
){
big_proxy
::
big_proxy
(
std
::
string
db
,
std
::
string
ip
,
std
::
string
user
,
std
::
string
passwd
,
int
port
){
client
=
"192.168.1.1:1234"
;
client
=
"192.168.1.1:1234"
;
//one Wrapper per user.
//one Wrapper per user.
clients
[
client
]
=
new
WrapperState
();
clients
[
client
]
=
new
WrapperState
();
//Connect phase
//Connect phase
ConnectionInfo
ci
(
"localhost"
,
"root"
,
"letmein"
,
3306
);
ConnectionInfo
ci
(
ip
,
user
,
passwd
,
port
);
//const std::string master_key = "113341234";
//const std::string master_key = "113341234";
const
std
::
string
master_key
=
"113341234"
;
const
std
::
string
master_key
=
"113341234"
;
char
*
buffer
;
char
*
buffer
;
...
...
main/big_proxy.hh
View file @
e14bf0d7
...
@@ -88,7 +88,8 @@ struct big_proxy{
...
@@ -88,7 +88,8 @@ struct big_proxy{
std
::
string
client
;
std
::
string
client
;
std
::
string
embeddedDir
=
"/t/cryt/shadow"
;
std
::
string
embeddedDir
=
"/t/cryt/shadow"
;
big_proxy
(
std
::
string
db
=
"tdb"
);
big_proxy
(
std
::
string
db
=
"tdb"
,
std
::
string
ip
=
"127.0.0.1"
,
std
::
string
user
=
"root"
,
std
::
string
passwd
=
"letmein"
,
int
port
=
3306
);
void
myNext
(
std
::
string
client
,
bool
isFirst
,
ResType
inRes
);
void
myNext
(
std
::
string
client
,
bool
isFirst
,
ResType
inRes
);
void
batchTogether
(
std
::
string
client
,
std
::
string
curQuery
,
unsigned
long
long
_thread_id
);
void
batchTogether
(
std
::
string
client
,
std
::
string
curQuery
,
unsigned
long
long
_thread_id
);
bool
myRewrite
(
std
::
string
curQuery
,
unsigned
long
long
_thread_id
,
std
::
string
client
);
bool
myRewrite
(
std
::
string
curQuery
,
unsigned
long
long
_thread_id
,
std
::
string
client
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment