Browse Source

Add --ecm-no-log option to disable ECM and code words logging.

Georgi Chorbadzhiyski 12 years ago
parent
commit
2a6af1e637
6 changed files with 32 additions and 14 deletions
  1. 7
    5
      camd.c
  2. 1
    0
      data.c
  3. 1
    0
      data.h
  4. 10
    8
      tables.c
  5. 4
    0
      tsdecrypt.1
  6. 9
    1
      tsdecrypt.c

+ 7
- 5
camd.c View File

@@ -124,7 +124,7 @@ static int camd35_recv_cw(struct ts *ts) {
124 124
 READ:
125 125
 	ret = camd35_recv(c, data, &data_len);
126 126
 	if (ret < 0) {
127
-		ts_LOGf("CW   | No CW has been received (ret = %d)\n", ret);
127
+		ts_LOGf("CW  | No CW has been received (ret = %d)\n", ret);
128 128
 		camd35_reconnect(ts);
129 129
 		return ret;
130 130
 	}
@@ -176,10 +176,12 @@ READ:
176 176
 		dvbcsa_bs_key_set(c->key->cw + 8, c->key->bs_csakey[1]);
177 177
 	}
178 178
 
179
-	ts_LOGf("CW  | CAID: 0x%04x [ %5llu ms ] ( %6llu ms ) ------- IDX: 0x%04x Data: %s\n",
180
-		ca_id, timeval_diff_msec(&tv1, &tv2),
181
-		timeval_diff_msec(&last_ts_keyset, &tv2),
182
-		idx, cw_dump );
179
+	if (ts->ecm_cw_log) {
180
+		ts_LOGf("CW  | CAID: 0x%04x [ %5llu ms ] ( %6llu ms ) ------- IDX: 0x%04x Data: %s\n",
181
+			ca_id, timeval_diff_msec(&tv1, &tv2),
182
+			timeval_diff_msec(&last_ts_keyset, &tv2),
183
+			idx, cw_dump );
184
+	}
183 185
 
184 186
 	return ret;
185 187
 }

+ 1
- 0
data.c View File

@@ -69,6 +69,7 @@ void data_init(struct ts *ts) {
69 69
 	ts->syslog_port = 514;
70 70
 
71 71
 	ts->ts_discont  = 1;
72
+	ts->ecm_cw_log  = 1;
72 73
 
73 74
 	ts->debug_level = 0;
74 75
 	ts->req_CA_sys  = CA_CONAX;

+ 1
- 0
data.h View File

@@ -129,6 +129,7 @@ struct ts {
129 129
 	int					pid_filter;
130 130
 
131 131
 	uint8_t				irdeto_ecm;
132
+	int					ecm_cw_log;
132 133
 
133 134
 	int					rtp_input;
134 135
 

+ 10
- 8
tables.c View File

@@ -168,14 +168,16 @@ static void __process_ecm(struct ts *ts, uint16_t pid, uint8_t *ts_packet) {
168 168
 	struct ts_section_header *sec = ts->ecm->section_header;
169 169
 	int duplicate = ts_privsec_is_same(ts->ecm, ts->last_ecm);
170 170
 	if (!duplicate || ts->is_cw_error) {
171
-		ts_hex_dump_buf(dump, dump_buf_sz, sec->section_data, min(dump_sz, sec->section_data_len), 0);
172
-		ts_LOGf("ECM | CAID: 0x%04x PID 0x%04x Table: 0x%02x Length: %3d IDX: 0x%04x Data: %s..\n",
173
-			ts->ecm_caid,
174
-			th->pid,
175
-			sec->table_id,
176
-			sec->section_data_len,
177
-			ts->ecm_counter,
178
-			dump);
171
+		if (ts->ecm_cw_log) {
172
+			ts_hex_dump_buf(dump, dump_buf_sz, sec->section_data, min(dump_sz, sec->section_data_len), 0);
173
+			ts_LOGf("ECM | CAID: 0x%04x PID 0x%04x Table: 0x%02x Length: %3d IDX: 0x%04x Data: %s..\n",
174
+				ts->ecm_caid,
175
+				th->pid,
176
+				sec->table_id,
177
+				sec->section_data_len,
178
+				ts->ecm_counter,
179
+				dump);
180
+		}
179 181
 		if (ts->is_cw_error)
180 182
 			ts->ecm_counter--;
181 183
 		ts->is_cw_error = 0;

+ 4
- 0
tsdecrypt.1 View File

@@ -133,6 +133,10 @@ Set ECM IRDETO type. IRDETO CA send ECMs with different id mixed
133 133
 into one stream. Only one of the IDs are valid in given time. This
134 134
 option lets you choose which stream to process. The default stream
135 135
 type is \fB0\fR.
136
+.TP
137
+\fB\-K\fR, \fB\-\-ecm\-no\-log\fR
138
+Disable logging of ECMs and code words. Code word errors and stats
139
+reports are not affected by this option.
136 140
 .SH SEE ALSO
137 141
 See the README file for more information. If you have questions, remarks,
138 142
 problems or you just want to contact the developer, write to:

+ 9
- 1
tsdecrypt.c View File

@@ -74,6 +74,7 @@ static const struct option long_options[] = {
74 74
 
75 75
 	{ "ecm-pid",			required_argument, NULL, 'X' },
76 76
 	{ "ecm-irdeto-type",	required_argument, NULL, 'G' },
77
+	{ "ecm-no-log",			no_argument      , NULL, 'K' },
77 78
 
78 79
 	{ "debug",				required_argument, NULL, 'D' },
79 80
 	{ "help",				no_argument,       NULL, 'h' },
@@ -133,6 +134,7 @@ static void show_help(struct ts *ts) {
133 134
 	printf("ECM options:\n");
134 135
 	printf(" -X --ecm-pid <pid>         | Force ECM pid. Default: none\n");
135 136
 	printf(" -G --ecm-irdeto-type <int> | Process IRDETO ECMs with type X /0..3/. Default: %d\n", ts->irdeto_ecm);
137
+	printf(" -K --ecm-no-log            | Disable ECM and code words logging.\n");
136 138
 	printf("\n");
137 139
 	printf("Misc options:\n");
138 140
 	printf(" -D --debug <level>         | Message debug level.\n");
@@ -170,7 +172,7 @@ static int parse_io_param(struct io *io, char *opt, int open_flags, mode_t open_
170 172
 
171 173
 static void parse_options(struct ts *ts, int argc, char **argv) {
172 174
 	int j, i, ca_err = 0, server_err = 1, input_addr_err = 0, output_addr_err = 0, output_intf_err = 0, ident_err = 0;
173
-	while ( (j = getopt_long(argc, argv, "i:d:l:L:I:RzO:o:t:pc:s:U:P:y:eZ:Ef:X:G:D:h", long_options, NULL)) != -1 ) {
175
+	while ( (j = getopt_long(argc, argv, "i:d:l:L:I:RzO:o:t:pc:s:U:P:y:eZ:Ef:X:G:KD:h", long_options, NULL)) != -1 ) {
174 176
 		char *p = NULL;
175 177
 		switch (j) {
176 178
 			case 'i':
@@ -287,6 +289,9 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
287 289
 			case 'G':
288 290
 				ts->irdeto_ecm = atoi(optarg);
289 291
 				break;
292
+			case 'K':
293
+				ts->ecm_cw_log = 0;
294
+				break;
290 295
 
291 296
 			case 'D':
292 297
 				ts->debug_level = atoi(optarg);
@@ -373,6 +378,9 @@ static void parse_options(struct ts *ts, int argc, char **argv) {
373 378
 		ts_LOGf("Decoding   : %s\n", ts->threaded ? "threaded" : "single thread");
374 379
 	}
375 380
 
381
+	if (!ts->ecm_cw_log)
382
+		ts_LOGf("ECM/CW log : disabled\n");
383
+
376 384
 	for (i=0; i<(int)sizeof(ts->ident); i++) {
377 385
 		if (!ts->ident[i])
378 386
 			break;

Loading…
Cancel
Save