void processPS_PES_packet (u_int pid, long pkt_nr, u_char *buf, int len) { OPTION *opt = getOptionPtr(); char *strx = (opt->packet_mode == PES) ? "PES" : "PS"; indent (0); print_packet_header (opt, strx, opt->pid, pkt_nr, len); if (opt->buffer_hexdump) { printhex_buf (0, buf, len); out_NL(0); } // decode protocol if (opt->printdecode) { decodePS_PES_packet (buf, len ,opt->pid); out_nl (3,"=========================================================="); out_NL (3); } }
void processTS_packet (u_int pid, long pkt_nr, u_char *b, int len) { OPTION *opt = getOptionPtr(); // -- subdecode prev. collected TS data // -- push new data if (opt->printdecode && opt->ts_subdecode) { ts2SecPes_subdecode (b, len, pid); } // -- new packet, output header indent (0); print_packet_header (opt, "TS", opt->pid, pkt_nr, len); // hex output (also on wrong packets) if (opt->buffer_hexdump) { printhex_buf (0, b, len); out_NL(0); } // -- decode protocol (if ts packet) if (opt->printdecode) { decodeTS_packet (b, len); out_nl (3,"=========================================================="); out_NL (3); if (opt->ts_subdecode) { // -- check if stored packet(s) length is sufficient for output ts2SecPes_checkAndDo_PacketSubdecode_Output(); } } }
void processSI_packet (u_int pid, long pkt_nr, u_char *buf, int len) { OPTION *opt = getOptionPtr(); indent (0); print_packet_header (opt, "SECT", opt->pid, pkt_nr, len); if (opt->buffer_hexdump) { printhex_buf (0,buf, len); out_NL(0); } // -- decode protocol if (opt->printdecode) { decodeSI_packet (buf,len ,opt->pid); out_nl (3,"=========================================================="); out_NL (3); } }
void decodeSI_packet (u_char *buf, int len, u_int pid) { OPTION *opt; int softcrc_fail; // nothing to output ? if (getVerboseLevel() < 2) return; if (pid != DUMMY_PID) { char *s; out (2,"PID: %u (0x%04x)",pid,pid); s = dvbstrPID_assignment(pid); if (*s) out (2," [= assigned for: %s]", s); out_NL (2); out_NL (2); } // // -- do a soft crc check // -- if soft crc fails, ignore packet // opt = getOptionPtr(); softcrc_fail = 0; if (opt->soft_crc) { u_long crc = crc32 ((char *)buf,len); if (crc) { softcrc_fail = 1; } } if (! softcrc_fail) { switch (pid) { case 0x01D: /* Measurement */ section_TESTDATA (buf, len); break; default: // multiple PIDs possible guess_table (buf, len, pid); break; } } else { printhex_buf (5,buf,len); out_nl (2, "Packet soft CRC failed, skipping packet..."); } fflush (stdout); }