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);
8 require_once('Obj/curl-de-sac.phh');
9 require_once('Obj/curl-de-brisk.phh');
12 function cds_postprocess($user_idx, $user_sess, $conn_ip, $is_tor)
14 printf("user_idx: %d, user_sess: %s, conn_ip: %s, is_tor: %s\n",
15 $user_idx, $user_sess, $conn_ip, ($is_tor ? "YES" : "NO"));
21 $brisk = new Brisk_mock();
24 $cds = new Curl_de_sac($debug);
27 $tor_chk_cls = new tor_chk_cmd_cls();
29 // registrer tor_chk_cls
30 printf("MAIN: Register 'tor_chk_cls'\n");
31 if (($cds->cmd_cls_register($tor_chk_cls)) == FALSE) {
32 fprintf(STDERR, "MAIN: 'tor_chk_cls' registration failed\n");
36 if (($debug & 1) == 1) {
37 printf("MAIN: CDS:\n");
42 // for ($i = -15 ; $i < 30 ; $i++) {
43 for ($i = 0 ; $i < 10 ; $i++) {
44 printf("MAIN: START ITERATION %d\n", $i);
48 printf("MAIN: load 'tor_chk'\n");
49 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.213") == FALSE) {
50 printf("MAIN: push 'tor_chk' command failed\n");
56 // Case Malformed output
57 printf("MAIN: load 'tor_chk'\n");
58 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.214") == FALSE) {
59 printf("MAIN: push 'tor_chk' command failed\n");
65 printf("MAIN: load 'tor_chk'\n");
66 if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.215") == FALSE) {
67 printf("MAIN: push 'tor_chk' command failed\n");
73 if (($debug & 1) == 1) {
79 printf("MAIN: Call process\n");
83 printf("MAIN: finished, dump cds:\n");
87 // if input data execute some command
88 // if end => clean exit