4 define('WEB_URL', 'http://localhost/curl-de-sac');
5 define('DBG_LEVEL', 0);
14 require_once($G_base . 'Obj/curl-de-sac.phh');
15 require_once($G_base . 'Obj/curl-de-brisk.phh');
18 function cds_postprocess($user_idx, $user_sess, $conn_ip, $is_tor)
20 printf("user_idx: %d, user_sess: %s, conn_ip: %s, is_tor: %s\n",
21 $user_idx, $user_sess, $conn_ip, ($is_tor ? "YES" : "NO"));
27 $brisk = new Brisk_mock();
30 $cds = new Curl_de_sac($debug);
33 $tor_chk_cls = new tor_chk_cmd_cls();
35 // registrer tor_chk_cls
36 printf("MAIN: Register 'tor_chk_cls'\n");
37 if (($cds->cmd_cls_register($tor_chk_cls)) == FALSE) {
38 fprintf(STDERR, "MAIN: 'tor_chk_cls' registration failed\n");
42 if (($debug & 1) == 1) {
43 printf("MAIN: CDS:\n");
48 // for ($i = -15 ; $i < 30 ; $i++) {
49 for ($i = 0 ; $i < 10 ; $i++) {
50 printf("MAIN: START ITERATION %d\n", $i);
54 printf("MAIN: load 'tor_chk'\n");
55 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.213", TRUE) == FALSE) {
56 printf("MAIN: push 'tor_chk' command failed\n");
62 // Case Malformed output
63 printf("MAIN: load 'tor_chk'\n");
64 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.214", FALSE) == FALSE) {
65 printf("MAIN: push 'tor_chk' command failed\n");
71 printf("MAIN: load 'tor_chk'\n");
72 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.215", TRUE) == FALSE) {
73 printf("MAIN: push 'tor_chk' command failed\n");
79 if (($debug & 1) == 1) {
85 printf("MAIN: Call process\n");
89 printf("MAIN: finished, dump cds:\n");
93 // if input data execute some command
94 // if end => clean exit