Beispiel #1
0
/*
 * 0x83: Logical Channel Descriptor
 * e-book_ed_2.02 corr-acro.doc
 */
void descriptor_PRIVATE_EictaORG_LogicalChannelDescriptor (u_char *b)
{
	unsigned int len = b[1];
	unsigned int i;

	out_nl(4, "--> eicta.org Logical Channel Descriptor");

	b += 2;

	indent(+1);

	for (i = 0; i < len; i += 4) {
		unsigned int service_id = (b[i] << 8) | b[i + 1];
		unsigned int visible_service_flag = (b[i + 2] >> 7) & 1;
		unsigned int reserved = (b[i + 2] >> 2) & 0x1f;
		unsigned int logical_channel_number = ((b[i + 2] << 8) | b[i + 3]) & 0x3ff;

		out_NL(5);
		out_SW_NL(5, "service_id: ", service_id);
		out_SB_NL(5, "visible_service_flag: ", visible_service_flag);
		out_SB_NL(5, "reserved: ", reserved);
		out_SW_NL(5, "logical_channel_number: ", logical_channel_number);
	}

	indent(-1);
	out_NL(4);
}
Beispiel #2
0
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);
       }


}
/*
   0xA0  Logic Channel Descriptor
   NorDig-Unified ver 2.0, 01.07.2008
*/
void descriptor_PRIVATE_NordigORG_ContentProtectionDescriptor (u_char *b)
{
	unsigned int tag = b[0];
	unsigned int len = b[1];
	unsigned int protectionLevel = b[2];

	out_nl(4, "--> NorDig Content Protection Descriptor ");

	b += 2;

	indent(+1);
	out_NL(4);
	out_SB_NL(2, "value: ", protectionLevel);

	switch(protectionLevel)
	{
		default:
		case 0x00:
			out_nl(4, "Outputs shall not be protected.");
			break;
		case 0x01:
			out_nl(4, "Content protection not required.");
			break;
		case 0x02:
			out_nl(4, "Content protection mandatory for video resolution > 576 lines.");
			break;
		case 0x03:
			out_nl(4, "Content protection mandatory regardless of video format and resolution.");
			break;
	}
	indent(-1);
	out_NL(4);
}
void descriptor_PRIVATE_PremiereDE_ContentTransmission (u_char *b)
{
  int  len, str_tim_len;
  u_int time_MJD, time_UTC;

 
  // tag	 = b[0];
  len       	 = b[1];


  out_nl (4,"--> Premiere Content Transmission descriptor ");


  outBit_Sx_NL  (4,"transport_stream_ID: ",	b,  16, 16);
  outBit_S2x_NL (4,"original_network_id: ",	b,  32, 16,
			(char *(*)(u_long)) dvbstrOriginalNetwork_ID);
  outBit_S2Tx_NL(4,"service_ID: ",		b,  48, 16,
			" --> refers to PMT program_number"); 
 
 
  b += 8;
  len -= 6;

  out_NL(4);
  while (len>0) {

	out (4,"Start_date: ");
  	time_MJD = getBits (b, 0, 0, 16);
	print_time_mjd (4, time_MJD);
	out_NL (4);

  	str_tim_len = outBit_Sx_NL (5,"start_time_loop_length: ", b,  16, 8);

	b += 3;
 	len -= 3;

	indent (+1);
 	for(; str_tim_len>0; str_tim_len-=3) {
  		out (4,"Start_time: ");
  		time_UTC = getBits (b, 0, 0, 24);
  		print_time_utc (4, time_UTC);
  		out_NL (4);

		b   += 3;
		len -= 3;
 	}
	out_NL (4);
	indent (-1);
  }

}
Beispiel #5
0
void section_TDT (u_char *b, int len)
{

   u_int      table_id;
   u_long     UTC_time_MJD;
   u_long     UTC_time_UTC;



   out_nl (3,"TDT-decoding....");
   table_id = outBit_S2x_NL (3,"Table_ID: ",  b,  0, 8,
		  (char *(*)(u_long)) dvbstrTableID );     
   if (table_id != 0x70) {
	out_nl (3,"wrong Table ID");
	return;
   }



  outBit_Sx_NL (3,"section_syntax_indicator: ",		b,  8,  1);
  outBit_Sx_NL (6,"reserved_1: ",			b,  9,  1);
  outBit_Sx_NL (6,"reserved_2: ",			b, 10,  2);
  outBit_Sx_NL (3,"Section_length: ",			b, 12, 12);


  out (3,"UTC_time: ");
  UTC_time_MJD		 = getBits (b, 0, 24, 16);
  UTC_time_UTC		 = getBits (b, 0, 40, 24);
  print_time40 (3, UTC_time_MJD,UTC_time_UTC);
  out_NL (3);

}
void descriptorMHP_AIT_DII_location (u_char *b)
{
  int  len;


  // descriptor_tag	= b[0];
  len		        = b[1];

  outBit_Sx_NL (4,"transport_protcol_label: ",	b+2, 0, 8);
  b += 3;
  len --;

  indent(+1);
  while (len > 0) {
	out_NL (4);
  	outBit_Sx_NL   (4,"reserved: ",		b,  0,  1);
  	outBit_S2Tx_NL (4,"DII_identification: ",	b,  1, 15,
	   	        "refers to identification in transaction_id");
  	outBit_Sx_NL   (4,"association_tag: ",	b, 16, 16);
	b += 4;
	len -= 4;
  }
  indent(-1);

}
void descriptorMHP_AIT_pre_fetch (u_char *b)
{
  int  len;
  int  len2;


  // descriptor_tag	= b[0];
  len		        = b[1];

  outBit_Sx_NL (4,"transport_protcol_label: ",	b+2, 0, 8);
  b += 3;
  len --;

  indent(+1);
  while (len > 0) {
	out_NL (4);
  	len2 = outBit_Sx_NL (4,"label_length: ",	b, 0, 8);
  	print_text_UTF8 (4, "label: ", b+1, len2);
	out_nl (4, "  ==> [= matches DII modul label]");
	b += 1 + len2;
	len -= 1 + len2;

  	outBit_Sx_NL (4,"prefetch_priority: ",	b, 0, 8);
	b++;
	len--;
  }
  indent(-1);

}
void descriptorMHP_AIT_external_application_authorisation (u_char *b)
{
  int  len;


  // descriptor_tag	= b[0];
  len		        = b[1];
  b += 2;

  indent(+1);
  while (len > 0) {
	  int x;

	  x = mhp_application_identifier (4, b);
	  b += x;
	  len -= x;

  	  outBit_Sx_NL (4,"application_priority: ",	b, 0, 8);
	  b++;
	  len--;

	  out_NL (4);
  }
  indent(-1);

}
void descriptorMHP_AIT_application_name (u_char *b)
{
  int        len;
  u_char     ISO639_language_code[4];


  // descriptor_tag	= b[0];
  len		        = b[1];
  b += 2;

  indent (+1);
  while (len > 0) {
	int len2;

	getISO639_3 (ISO639_language_code, b);
	out_nl (4,"ISO639_language_code:  %3.3s", ISO639_language_code);

 	len2 = outBit_Sx_NL (4,"application_name_length: ",	b, 24, 8);
 	print_text_468A (4, "application_name: ", b+4, len2);

	b += 4 + len2;
	len -= 4 + len2;

	out_NL (4);
  }
  indent (-1);

}
Beispiel #10
0
int  print_PCR_field (int v, const char *str, u_char *b, int bit_offset) 
{
  long long   pcr_H, pcr_L, pcr_Ext;
  long long   ull;
  int         bo = bit_offset;
  int         v1 = v+1;


  out_nl (v,"%s:",str);
  indent (+1);

    pcr_H    = outBit_Sx_NL (v1,"baseH: ",	b, bo+ 0,  1);
    pcr_L    = outBit_Sx_NL (v1,"baseL: ",	b, bo+ 1, 32);
               outBit_Sx_NL (v1,"reserved: ",	b, bo+33,  6);
    pcr_Ext  = outBit_Sx_NL (v1,"extension: ",	b, bo+39,  9);

    ull = (pcr_H << 32) + pcr_L;

    out (v," ==> %s: ", str);
    // print_timebase90kHz (v, ull);
    print_pcr_time (v, ull,pcr_Ext);
    out_NL (v);

  indent (-1);

  return 6;
}
Beispiel #11
0
void  print_xTS_field (int v, const char *str, u_char *b, int bit_offset) 
{
  long long   xTS_32_30;
  long long   xTS_29_15;
  long long   xTS_14_0;
  long long   ull;
  int         bo = bit_offset;
  int         v1 = v+1;


  out_nl (v,"%s:",str);
  indent (+1);

    xTS_32_30 = outBit_Sx_NL (v1,"bit[32..30]: ",	b, bo+0,  3);
                outBit_Sx_NL (v1,"marker_bit: ",	b, bo+3,  1);
    xTS_29_15 = outBit_Sx_NL (v1,"bit[29..15]: ",	b, bo+4, 15);
                outBit_Sx_NL (v1,"marker_bit: ",	b, bo+19, 1);
    xTS_14_0  = outBit_Sx_NL (v1,"bit[14..0]: ",	b, bo+20,15);
                outBit_Sx_NL (v1,"marker_bit: ",	b, bo+35, 1);

    ull = (xTS_32_30<<30) + (xTS_29_15<<15) + xTS_14_0;
    out (v," ==> %s: ", str);
    print_timebase90kHz (v, ull);
    out_NL (v);

  indent (-1);
}
Beispiel #12
0
void mpeg_system_header (int v, u_char *b, int len)
{

	/* z.B. H.222 ISO 13818-1 Table 2-34 */
	/* 	ISO 11172-1 system header */


   if (len == 0) return;

   out_nl (v,"System_header: ");
   indent (+1);

   if (len > 0) {
	// -- within PES packet, not PS!
	outBit_Sx_NL (v,"system_header_start_code: ",	b,  0, 32);
   }



   // -- get real length from system_header data
   len = outBit_Sx_NL (v,"header_length: ",	b,  32, 16);

   outBit_Sx_NL (v,"marker_bit: ",		b,  48,  1);
   outBit_Sx_NL (v,"rate_bound: ",		b,  49,  22);
   outBit_Sx_NL (v,"marker_bit: ",		b,  71,  1);
   outBit_Sx_NL (v,"audio_bound: ",		b,  72,  6);
   outBit_Sx_NL (v,"fixed_flag: ",		b,  78,  1);
   outBit_Sx_NL (v,"CSPS_flag: ",		b,  79,  1);
   outBit_Sx_NL (v,"system_audio_lock_flag: ",	b,  80,  1);
   outBit_Sx_NL (v,"system_video_lock_flag: ",	b,  81,  1);
   outBit_Sx_NL (v,"marker_bit: ",		b,  82,  1);
   outBit_Sx_NL (v,"video_bound: ",		b,  83,  5);
   outBit_Sx_NL (v,"packet_rate_restriction_flag: ",	b,  88,  1);
   outBit_Sx_NL (v,"reserved_byte: ",		b,  89,  7);

   b += 12;
   len -= 12;


   // while (nextbits () == '1') {	
   // while  ((bit = getBits (b, 0,0,1)) == 0x01) {
   while  ( (*b & 0x80) ) {
	if (len <= 0)  break;

	out_NL (v);
	outBit_S2x_NL(v,"Stream_id: ",			b,  0,  8,
		 	(char *(*)(u_long))dvbstrPESstream_ID );
   	outBit_Sx_NL (v,"fixed (0x02): ",		b,  8,  2);
   	outBit_Sx_NL (v,"P-STD_buffer_bound_scale: ",	b, 10,  1);
   	outBit_Sx_NL (v,"P-STD_buffer_size_bound: ",	b, 11, 13);

	b   += 3;
	len -= 3;
	if (len < 0)  out_nl (1, "$$$ something wrong here (length<0)");
   }


   indent (-1);
}
Beispiel #13
0
void PES_decodeDATA_EBU_etc (u_char *b, int len)
{
	
   // -- PES_DATA_bytes EBU
   // -- Data Buffer starts at PES_DATA_BYTES...
   // --> see parent

   int  data_identifier;

   out_nl (4,"EBU data:");
   indent (+1);

   data_identifier = outBit_S2x_NL (4,"data_identifier: ",	b, 0, 8,
			(char *(*)(u_long)) dvbstrPESDataIdentifier);
   b++;
   len--;

   while (len > 0) {
	int len2;
	int dui;
	int n=0;


	out_NL (4);
   	dui  = outBit_S2x_NL (4,"data_unit_id: ",	b, 0, 8,
			(char *(*)(u_long)) dvbstrPES_EBUDataUnitID);

   	len2 = outBit_Sx_NL (4,"data_unit_length: ",	b, 8, 8);
	b += 2;
	len -= 2;

	if (dui==0x02 || dui==0x03 || dui==0xC0 || dui==0xC1) {
		n = teletext_data_field (4, b, len2);
	} else if (dui==0xC3) {
		n = vps_data_field(4, b,len2);
	} else if (dui==0xC4) {
		n = wss_data_field (4, b,len2);
	} else if (dui==0xC5) {
		n = closed_caption_data_field (4, b,len2);
	} else if (dui==0xC6) {
		n = monochrome_data_field (4, b,len2);
	} else if (dui==0xFF) {
		/* No data field */
		n = 0;
	}

	if ( (len2-n) > 0 ) {
		print_databytes (4,"stuffing bytes:", b+n, len2-n);
	}

	b += len2;
	len -= len2;
   }


   indent (-1);
}
Beispiel #14
0
unsigned long long outBit64_Sx_NL (int verbosity, const char *text, u_char *buf, int startbit, int bitlen)
{
  unsigned long long value;

  value = outBit64_Sx (verbosity,text,buf,startbit,bitlen);
  out_NL (verbosity);
  return value;

}
Beispiel #15
0
int BIOP_ModuleInfo (int v, u_char *b, u_int len_org)
{
   int   	len = len_org;
   int 		n1, i;


   	// -- due to some misbehavior of some service providers
   	// -- we do a simple plausi check for tap_counts_min_bytes > len
	i = getBits (b, 0, 96, 8);	// tap_counts
	i = i * 7;

	if (i > len_org) {	// this is no ModuleInfo
		print_databytes (v,"Data Bytes (non-standard):", b, len_org);
		return len_org;
	}




	out_nl (v, "BIOP::ModuleInfo:");

	indent (+1);
	outBit_S2Tx_NL (v,"ModuleTimeOut: ",	b,  0, 32, "(ms)");
	outBit_S2Tx_NL (v,"BlockTimeOut: ",	b, 32, 32, "(ms)");
	outBit_S2Tx_NL (v,"MinBlockTime: ",	b, 64, 32, "(ms)");
	n1 = outBit_Sx_NL (v,"taps_count: ",	b, 96,  8);

	b += 13,
	len -= 13;


	indent (+1);
	while (n1-- > 0) {
		int n2;

		// BIOP_OBJECT_USE
		n2 = BIOP_TAP (v, "DSM", b);
		b += n2;
		len -= n2;

	}
	indent (-1);
	out_NL (v);


	n1 = outBit_Sx_NL (v,"userInfoLength: ",	b,   0,  8);
	// print_databytes (v,"UserInfoData:", b, n1); 

	dsmcc_CarouselDescriptor_Loop ("userInfo", b+1, n1);
	b   += 1+n1;
	len -= 1+n1;


	indent (-1);

	return len_org;
}
int  descriptorMHP_AIT (u_char *b)

{
 int len;
 int tag;



  out_NL (4);
  tag = outBit_S2x_NL (4,"MHP_AIT-DescriptorTag: ",		b,   0,  8,
		(char *(*)(u_long))dsmccStrMHP_AIT_DescriptorTAG); 
  len = outBit_Sx_NL  (4,"descriptor_length: ",	 	b,   8,  8);


  // empty ??
  if (len == 0) return len;

  // print hex buf of descriptor
  printhex_buf (9, b,len+2);



  switch (tag) {

     case 0x00:  descriptorMHP_AIT_application (b); break;
     case 0x01:  descriptorMHP_AIT_application_name (b); break;
     case 0x02:  descriptorMHP_AIT_transport_protocol (b); break;
     case 0x03:  descriptorMHP_AIT_dvb_j_application (b); break;
     case 0x04:  descriptorMHP_AIT_dvb_j_application_location (b); break;
     case 0x05:  descriptorMHP_AIT_external_application_authorisation (b); break;
     // case 0x06: reserved
     // case 0x07: reserved
     case 0x08:  descriptorMHP_AIT_dvb_html_application (b); break;
     case 0x09:  descriptorMHP_AIT_dvb_html_application_location (b); break;
     case 0x0A:  descriptorMHP_AIT_dvb_html_application_boundary (b); break;
     case 0x0B:  descriptorMHP_AIT_application_icons (b); break;
     case 0x0C:  descriptorMHP_AIT_pre_fetch (b); break;
     case 0x0D:  descriptorMHP_AIT_DII_location (b); break;
     case 0x0E:  descriptorMHP_AIT_delegated_application (b); break;
     case 0x0F:  descriptorMHP_AIT_plug_in (b); break;
     case 0x10:  descriptorMHP_AIT_application_storage (b); break;
     case 0x11:  descriptorMHP_AIT_ip_signalling (b); break;

     case 0x5F:  descriptorDVB_PrivateDataSpecifier (b); break;

     default: 
	if (tag < 0x80) {
	    out_nl (0,"  ----> ERROR: unimplemented descriptor (MHP_AIT context), Report!");
	}
	descriptor_PRIVATE (b,MHP_AIT);
	break;
  } 


  return len+2;   // (descriptor total length)
}
Beispiel #17
0
u_long  BIOP_TAG_dispatch (int v, u_char *b)
{
  u_long   id_tag;
  u_long   len;


	id_tag = getBits (b, 0, 0, 32);		// ID_tag  prefetch

	switch (id_tag) {

	    case 0x42494F50:		// "BIOP"
		    // BIOP::FileMessage
		    // BIOP::DirectoryMessage
		    // BIOP::StreamMessage
		    // BIOP::StreamEventMessage
		    len = BIOP_Message (v, b);
		    break;

	    case 0x49534f05:		// TAG_LITE_OPTIONS
		    len = BIOP_LiteOptionsProfileBody (v, b);
		    break;

	    case 0x49534f06:		// TAG_BIOP
		    // BIOPProfileBody
		    len = BIOP_BIOPProfileBody (v, b);
		    break;

	    case 0x49534f40:		// TAG_ConnBinder
		    // DSM::ConnBinder
		    len = BIOP_DSM_ConnBinder (v, b);
		    break;

	    case 0x49534f46:		// TAG_SERVICE_LOCATION
		    len = BIOP_DSM_ServiceLocation (v, b);
		    break;

	    case 0x49534f50:		// TAG_ObjectLocation
		    // DSM::ConnBinder
		    len = BIOP_ObjectLocation (v, b);
		    break;

	    default:			// unknown !!!
		    // $$$ TODO:  we wildly guess, that there is a 32b length field!
		    // $$$ TODO:  this may break the decoding process, if not true
		    outBit_S2x_NL (v,"profileId_tag: ",			b,   0, 32,
 			(char *(*)(u_long)) dsmccStrIOP_ProfileID );
		    len = outBit_Sx_NL (v,"profile_data_length: ",	b,  32, 32);
		    print_databytes (v,"unkown profile_data:", b+8, len); 
		    len += 8;
		    break;

	}
		
  out_NL (v);
  return len;
}
void descriptorMHP_AIT_application (u_char *b)
{
  int        len;
  int        len2;

  // descriptor_tag	= b[0];
  len		        = b[1];


 len2 = outBit_Sx_NL (4,"application_profile_length: ",	b, 16, 8);
 b += 3;
 len -= 1;

 indent (+1);
 while (len2 > 0) {
	int x;

	out_NL(4);
	x =   mhp_application_profile_version (4, b);

	b += x;
	len -= x;
	len2 -= x;
 }
 out_NL(4);
 indent (-1);


 outBit_Sx_NL (4,"service_bound_flag: ",	b,   0,  1);
 outBit_S2x_NL(4,"visibility: ",		b,   1,  2,
	 	(char *(*)(u_long)) dsmccStrMHP_visibility_state );
 outBit_Sx_NL (4,"reserved: ",			b,   3,  5);
 outBit_Sx_NL (4,"application_priority: ",	b,   8,  8);
 b += 2;
 len -= 2;

 while (len > 0) {
 	outBit_Sx_NL (4,"transport_protocol_label: ",	b,   0, 8);
	b++;
	len--;
 }

}
Beispiel #19
0
static u_long  body_FileMessage (int v, u_char *b)
{
  u_char   *b_org = b;
  u_long   nx,n2,n5;


   n2 = outBit_Sx_NL   (v,"objectInfo_length: ",	b,   0,  16);
   b += 2;
   if (n2) {	// has to be >= 8
  	outBit64_Sx_NL (v,"DSM::File::ContentSize: ",	b,   0,  64);
	b  += 8;
	n2 -= 8;
	if (n2 > 0) {
	   	out_nl (v, "Descriptor_loop:");
   		indent (+1);
   		while (n2 > 0) {
			int    x;

			x   = descriptor (b,  DSMCC_CAROUSEL);
			b  += x;
			n2 -= x;
   			out_NL (v);
   		}
	} // if n2 > 0
	   indent (-1);
   } // if n2
   out_NL (v);


   nx = do_ServiceContentList (v, b);
   b += nx;


        outBit_Sx_NL   (v,"messageBody_length: ",	b,   0,   32);


   n5 = outBit_Sx_NL   (v,"content_length: ",		b,  32,   32);
 	print_databytes(v,"content__byte:", 		b+8, n5);
   b += 8 + n5;


   return (u_long)  (b - b_org);
}
Beispiel #20
0
/*
 * 0x84: Preferred Name List Descriptor
 * e-book_ed_2.02 corr-acro.doc
 */
void descriptor_PRIVATE_EictaORG_PreferredNameListDescriptor (u_char *b)
{
	unsigned int len = b[1];
	unsigned int i, j;

	out_nl(4, "--> eicta.org Preferred Name List Descriptor");

	b += 2;

	indent(+1);

	for (i = 0; i < len; i += 4) {
		unsigned int ISO_639_language_code = (b[i] << 16) | (b[i + 1] << 8) | b[i + 2];
		unsigned int name_count = b[i + 3];

		out_NL(4);
		out_SL_NL(4, "ISO_639_language_code: ", ISO_639_language_code);
		out_SB_NL(4, "name_count: ", name_count);

		indent(+1);

		for (j = 0; j < name_count; j++) {
			unsigned int name_id = b[i + 4];
			unsigned int name_length = b[i + 5];
			const char *name = &b[i + 6];

			out_NL(4);
			out_SB_NL(4, "name_id: ", name_id);
			out_SB_NL(4, "name_length: ", name_length);

			if (name_length > 0)
				out_nl(4, "name: %.s", name_length, name);

			i += name_length + 2;
		}

		indent(-1);
	}

	indent(-1);
	out_NL(4);
}
Beispiel #21
0
/*
 * 0x85: Preferred Name Identifier Descriptor
 * e-book_ed_2.02 corr-acro.doc
 */
void descriptor_PRIVATE_EictaORG_PreferredNameIdentifierDescriptor (u_char *b)
{
	out_nl(4, "--> eicta.org Preferred Name Identifier Descriptor");

	indent(+1);

	out_SB_NL(4, "name_id: ", b[2]);

	indent(-1);
	out_NL(4);
}
Beispiel #22
0
/*
 * 0x86: Eacem Stream Identifier Descriptor
 * e-book_ed_2.02 corr-acro.doc
 */
void descriptor_PRIVATE_EictaORG_EacemStreamIdentifierDescriptor (u_char *b)
{
	out_nl(4, "--> eicta.org Eacem Stream Identifier Descriptor");

	indent(+1);

	out_SB_NL(4, "version_byte: ", b[2]);

	indent(-1);
	out_NL(4);
}
Beispiel #23
0
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();
          }

       }

}
Beispiel #24
0
int  do_FE_Info (OPTION *opt)

{
  int        fd_fe = 0;



  if (opt->inpPidFile) {
	fprintf (stderr,"Error: FileMode not possible...\n");
	return -1;
  } 


  if((fd_fe = open(opt->devFE,O_RDONLY)) < 0){
     IO_error(opt->devFE);
     return -1;
  }



   indent (0);
   out_NL (2);
   out_nl (2,"---------------------------------------------------------");
   out_nl (2,"FrontEnd Info...");
   out_nl (2,"---------------------------------------------------------");
   out_NL (2);

   out_nl (2,"Device: %s",opt->devFE);
   out_NL (2);

  print_FE_BasicCapabilities (3, fd_fe);
  print_FE_CurrentParameters (2, fd_fe);

  close(fd_fe);
  return 0;
}
Beispiel #25
0
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);
       }

}
Beispiel #26
0
static void  out_SkipBuffer (int v, int len)

{
  int  lmax;
  int  l;

   lmax = (sizeof(SkipBuffer)/sizeof(u_char));
   l = (len > lmax) ? lmax : len;

   print_databytes (v,"Skipped bytes:", SkipBuffer, l);
   
   if (l == lmax) {
   	out_nl (v,"...");
   	out_NL (v);
   }

}
void descriptorMHP_AIT_delegated_application (u_char *b)
{
  int  len;


  // descriptor_tag	= b[0];
  len		        = b[1];
  b += 2;

  // indent(+1);
  while (len > 0) {
	out_NL (4);
  	outBit64_Sx_NL (4,"application_identifier: ",	b,  0,  48);
	b += 6;
	len -= 6;
  }
  // indent(-1);
}
void descriptorMHP_AIT_plug_in (u_char *b)
{
  int  len;


  // descriptor_tag	= b[0];
  len		        = b[1];

  outBit_Sx_NL (4,"application_type: ",	b+2,  0,  16);
  b += 4;
  len -= 2;

  indent(+1);
  while (len > 0) {
	int x;

	out_NL(4);
	x =   mhp_application_profile_version (4, b);
	b += x;
	len -= x;
  }
  // indent(-1);
}
Beispiel #29
0
int BIOP_TAP (int v, const char *str, u_char *b)
{
  u_char       *b_org = b;
  int          use;
  int          n;


   out_nl (v, "%s::TAP:");
   indent (+1);

         outBit_Sx_NL (v,"id: ",			b,  0, 16);
   use = outBit_S2x_NL(v,"use: ",			b, 16, 16,
			(char *(*)(u_long))dsmccStrBIOP_TAP_Use );

         outBit_Sx_NL (v,"association_tag: ",		b, 32, 16);



   n   = outBit_Sx_NL (v,"selector_length: ",		b, 48,  8);
   b += 7;


   // -- a TAP may have a Selector()
   if (n >= 2) {
	int stype;
	
	stype = outBit_S2x_NL(v,"selector_type: ",	b,  0, 16,
			(char *(*)(u_long))dsmccStrBIOP_TAP_SelectorType );
	indent (+1);
	switch (stype) {

		case 0x0001:			// MessageSelector
			dsmcc_print_transactionID_32 (v, b+2);
   			outBit_S2Tx_NL (v,"timeout: ",	b, 48,  32, "usec.");
			break;

		case 0x0109:			// ATSC A95: TSFS_selector
   			outBit_Sx_NL   (v,"carouselId: ",  b, 16,  32);
   			outBit_S2Tx_NL (v,"DSI_timeout: ", b, 48,  32, "usec.");
			if (n > 10) {
	 		   print_databytes (v,"URI_byte:",   b+10, n-10); 
			}
			break;

		case 0x0000:			// ISO/IEC reserved
		default:			// unknown, default
	 		print_databytes (v,"selector_data:", 	b+2, n-2); 
			break;

	}
	indent (-1);

   } else {
	if (n > 0) {
		print_databytes (v,"selector_data:", 	b, n); 
	}
   }


   b += n;


   indent (-1);
   out_NL (v);
   return (int) (b - b_org);
}
Beispiel #30
0
int dsmcc_DownloadInfoIndication (int v, u_char *b, u_int len)
{
   int   	len_org = len;
   int		n_modules;
   int 		len2;
   int		i, x;



	// already read  dsmcc_MessageHeader (v, b, len, &dmh);

	outBit_Sx_NL (v,"downloadId: ",		b   ,  0, 32);
	outBit_Sx_NL (v,"blockSize: ",		b+ 4,  0, 16);
	outBit_Sx_NL (v,"windowSize: ",		b+ 6,  0,  8);
	outBit_Sx_NL (v,"ackPeriod: ",		b+ 7,  0,  8);
	outBit_Sx_NL (v,"tCDownloadWindow: ",	b+ 8,  0, 32);
	outBit_Sx_NL (v,"tCDownloadScenario: ",	b+12,  0, 32);
	b += 16;
	len -= 16;

	x = dsmcc_CompatibilityDescriptor (b);
	b += x;
	len -= x;

	n_modules = outBit_Sx_NL (v,"numberOfModules: ",	b,  0, 16);
	b += 2;
	len -= 2;

	for (i=0; i < n_modules; i++) {
		u_int    mId;

		out_NL (v);
		out_nl (v, "Module (%d):",i);
		indent (+1);

		mId = outBit_Sx (v,"moduleId: ",	b,  0, 16);
		      out_nl (4, "%s", (mId < 0xFFF0) ? "" : "  [= DAVIC application]");
		outBit_Sx_NL (v,"moduleSize: "	,	b, 16, 32);
		outBit_Sx_NL (v,"moduleVersion: ",	b, 48,  8);
		len2 = outBit_Sx_NL (v,"moduleInfoLength: ",	b, 56,  8);
		b += 8;
		len -= 8;


		// moduleInfoByte: these fields shall convey a list of descriptors
		// which each define one or more attributes of the described module,
		// except when the moduleId is within the range of 0xFFF0-0xFFFF. In
		// this case, the moduleInfoByte structure contains the ModuleInfo
		// structure as defined by DAVIC with the privateDataByte field of that
		// structure as a loop of descriptors.
		// ISO 13818-6:2000  11.3.3.2

		if (mId < 0xFFF0) {
			BIOP_ModuleInfo (v, b, len2);
		} else {
			print_databytes (v, "moduleInfoBytes: ", b, len2);  // $$$ TODO Davic
		}
		b += len2;
		len -= len2;

		indent (-1);
	}
	out_NL (v);
	indent (-1);


	len2 = outBit_Sx_NL (v,"privateDataLength: ",	b,  0, 16);
	print_databytes (v, "privat Data: ", b+2, len2);   // $$$ TODO ???
	// b += 2 + len2;
	// len -= 2 + len2;


	return len_org;
}