use unix socket between agent and drivers, and build a lib for that.
Change-Id: Ibaaf203b443ef76e30caf0d67147e87afb3ac362
diff --git a/sysfuzzer/framework/VtsFuzzerMain.cpp b/sysfuzzer/framework/VtsFuzzerMain.cpp
index ca8f352..e537ab8 100644
--- a/sysfuzzer/framework/VtsFuzzerMain.cpp
+++ b/sysfuzzer/framework/VtsFuzzerMain.cpp
@@ -79,20 +79,20 @@
// Parses command args and kicks things off.
int main(int argc, char* const argv[]) {
static const struct option longOptions[] = {
- {"help", no_argument, NULL, 'h'},
- {"class", required_argument, NULL, 'c'},
- {"type", required_argument, NULL, 't'},
- {"version", required_argument, NULL, 'v'},
- {"epoch_count", required_argument, NULL, 'e'},
- {"spec_dir", required_argument, NULL, 's'},
+ {"help", no_argument, NULL, 'h'},
+ {"class", required_argument, NULL, 'c'},
+ {"type", required_argument, NULL, 't'},
+ {"version", required_argument, NULL, 'v'},
+ {"epoch_count", required_argument, NULL, 'e'},
+ {"spec_dir", required_argument, NULL, 's'},
#ifndef VTS_AGENT_DRIVER_COMM_BINDER // socket
- {"socket_port_file", optional_argument, NULL, 'f'},
+ {"socket_port_file", optional_argument, NULL, 'f'},
#else // binder
- {"service_name", required_argument, NULL, 'n'},
+ {"service_name", required_argument, NULL, 'n'},
#endif
- {"server", optional_argument, NULL, 'd'},
- {"agent_port", optional_argument, NULL, 'p'},
- {NULL, 0, NULL, 0}};
+ {"server", optional_argument, NULL, 'd'},
+ {"callback_socket_name", optional_argument, NULL, 'p'},
+ {NULL, 0, NULL, 0}};
int target_class;
int target_type;
float target_version = 1.0;
@@ -104,7 +104,7 @@
#else // binder
string service_name(VTS_FUZZER_BINDER_SERVICE_NAME);
#endif
- int agent_port = -1;
+ string callback_socket_name;
while (true) {
int optionIndex = 0;
@@ -149,7 +149,7 @@
target_version = atof(optarg);
break;
case 'p':
- agent_port = atoi(optarg);
+ callback_socket_name = string(optarg);
break;
case 'e':
epoch_count = atoi(optarg);
@@ -182,7 +182,7 @@
}
android::vts::SpecificationBuilder spec_builder(
- spec_dir_path, epoch_count, agent_port);
+ spec_dir_path, epoch_count, callback_socket_name);
if (!server) {
if (optind != argc - 1) {
fprintf(stderr, "Must specify output file (see --help).\n");
@@ -205,6 +205,5 @@
INTERFACE_SPEC_LIB_FILENAME);
#endif
}
-
return 0;
}