4 define('WEB_URL', 'http://localhost/curl-de-sac');
5 define('TOR_CHK_URL', 'http://localhost/curl-de-sac/test/tor_mock.php');
6 define('DBG_LEVEL', 0);
10 require_once($G_base . 'Obj/curl-de-sac.phh');
11 require_once($G_base . 'Obj/curl-de-brisk.phh');
14 function cds_postprocess($user_idx, $user_sess, $conn_ip, $is_tor)
16 printf("user_idx: %d, user_sess: %s, conn_ip: %s, is_tor: %s\n",
17 $user_idx, $user_sess, $conn_ip, ($is_tor ? "YES" : "NO"));
23 $brisk = new Brisk_mock();
26 $cds = new Curl_de_sac($debug);
29 $tor_chk_cls = new tor_chk_cmd_cls();
31 // registrer tor_chk_cls
32 printf("MAIN: Register 'tor_chk_cls'\n");
33 if (($cds->cmd_cls_register($tor_chk_cls)) == FALSE) {
34 fprintf(STDERR, "MAIN: 'tor_chk_cls' registration failed\n");
38 if (($debug & 1) == 1) {
39 printf("MAIN: CDS:\n");
44 // for ($i = -15 ; $i < 30 ; $i++) {
45 for ($i = 0 ; $i < 10 ; $i++) {
46 printf("MAIN: START ITERATION %d\n", $i);
50 printf("MAIN: load 'tor_chk'\n");
51 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.213") == FALSE) {
52 printf("MAIN: push 'tor_chk' command failed\n");
58 // Case Malformed output
59 printf("MAIN: load 'tor_chk'\n");
60 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.214") == FALSE) {
61 printf("MAIN: push 'tor_chk' command failed\n");
67 printf("MAIN: load 'tor_chk'\n");
68 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.215") == FALSE) {
69 printf("MAIN: push 'tor_chk' command failed\n");
75 if (($debug & 1) == 1) {
81 printf("MAIN: Call process\n");
85 printf("MAIN: finished, dump cds:\n");
89 // if input data execute some command
90 // if end => clean exit