Exemplo n.º 1
0
int main(int argc, char* argv[])
{
	char* buffer = NULL;
	size_t length = 0;
	MmsNotify* thiz = NULL;
	
	if(argc != 2)
	{
		MMS_PRINTF("%s notify\n", argv[0]);
		return 0;
	}
	
	buffer = mms_read_binary_file(argv[1], &length);
	if(buffer != NULL)
	{
		thiz = mms_notify_create(buffer, length, 1);

		mms_notify_dump(thiz, NULL);

		MMS_PRINTF("mms_notify_get_url: %s\n",            mms_notify_get_url(thiz, NULL));
		MMS_PRINTF("mms_notify_get_message_size:%d\n",    mms_notify_get_message_size(thiz));
		MMS_PRINTF("mms_notify_get_transaction_id: %s\n", mms_notify_get_transaction_id(thiz));
		MMS_PRINTF("mms_notify_get_from: %s\n",           mms_notify_get_from(thiz, NULL));
		dump_time("mms_notify_get_date",   mms_notify_get_date(thiz));
		dump_time("mms_notify_get_expiry", mms_notify_get_expiry(thiz));
		MMS_PRINTF("mms_notify_get_subject:%s\n",         mms_notify_get_subject(thiz, NULL));

		mms_notify_destroy(thiz);
	}

	return 0;
}
Exemplo n.º 2
0
void SubtrackerContext::do_table_tracking() {

  if (this->prev_frame_analysis != NULL) {
    this->frame_analysis->setup_from_prev_table_tracking(*this->prev_frame_analysis);
  } else {
    this->frame_analysis->setup_first_table_tracking();
  }
  this->frame_analysis->track_table();
  dump_time(this->panel, "cycle", "track table");
  this->frame_analysis->warp_table_frame();
  dump_time(this->panel, "cycle", "warp table frame");

}
Exemplo n.º 3
0
/* This dumps the payload only, used for udp frames without headers */
int dump_payloadpkt(char *prefix, void *buf, int len, struct TimeInternal *ti)
{
	if (ti)
		dump_time(prefix, ti);
	dump_payload(prefix, buf, len);
	return 0;
}
Exemplo n.º 4
0
void
dump_rule_array			(char		*name,
				 GArray		*rule_array,
				 FILE		*fp)
{
  static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
			    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

  RuleData *rule;
  int i;

#if 0
  fprintf (fp, "\n# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S");
#endif

  for (i = 0; i < rule_array->len; i++) {
    rule = &g_array_index (rule_array, RuleData, i);

    fprintf (fp, "Rule\t%s\t%s\t", name, dump_year (rule->from_year));

    if (rule->to_year == rule->from_year)
      fprintf (fp, "only\t");
    else
      fprintf (fp, "%s\t", dump_year (rule->to_year));

    fprintf (fp, "%s\t", rule->type ? rule->type : "-");

    fprintf (fp, "%s\t", months[rule->in_month]);

    fprintf (fp, "%s\t",
	     dump_day_coded (rule->on_day_code, rule->on_day_number,
			     rule->on_day_weekday));

    fprintf (fp, "%s\t", dump_time (rule->at_time_seconds, rule->at_time_code,
				    FALSE));

    fprintf (fp, "%s\t", dump_time (rule->save_seconds, TIME_WALL, TRUE));

    fprintf (fp, "%s", rule->letter_s ? rule->letter_s : "-");

    fprintf (fp, "\n");
  }
}
Exemplo n.º 5
0
/* This dumps everything, used for raw frames with headers and ptp payload */
int dump_1588pkt(char *prefix, void *buf, int len, struct TimeInternal *ti)
{
	struct ethhdr *eth = buf;
	void *payload = (void *)(eth + 1);

	if (ti)
		dump_time(prefix, ti);
	dump_eth(prefix, eth);
	dump_payload(prefix, payload, len - (payload - buf));
	return 0;
}
Exemplo n.º 6
0
void dump_cg2_channel(struct cg2_channel * p) 
{
    int i;
    
    dump_group_start    ("Channel Lineup");
    dump_time           ("Modification Time", p->mod_time);
    dump_u32            ("TMS ID",            p->tmsid);
    dump_u32            ("Data Length",       p->data_len);
    for (i = 0; i < p->num_programs; i++)
        dump_fixed_program_record(&p->programs[i]);
    dump_group_end      ();
}
Exemplo n.º 7
0
/* This dumps a complete udp frame, starting from the eth header */
int dump_udppkt(char *prefix, void *buf, int len, struct TimeInternal *ti)
{
	struct ethhdr *eth = buf;
	struct iphdr *ip = buf + ETH_HLEN;
	struct udphdr *udp = (void *)(ip + 1);
	void *payload = (void *)(udp + 1);

	if (ti)
		dump_time(prefix, ti);
	dump_eth(prefix, eth);
	dump_ip(prefix, ip);
	dump_udp(prefix, udp);
	dump_payload(prefix, payload, len - (payload - buf));
	return 0;
}
Exemplo n.º 8
0
int main()
{
  printf("{\n");

  dump_time();
  printf(",\n");

  dump_mem_stats();
  printf(",\n");

  dump_cpu_stats();
  printf(",\n");

  dump_proc_stats();
  printf("\n}\n");

  return 0;
}
Exemplo n.º 9
0
/**
 * @brief Print out info of a file in <code>ls -l</code> fashion.
 *
 * @param stream output stream
 * @param path path of file
 * @param pst pointer to stat structure of the file
 * @param link_target target of symbolic link, could be NULL
 * @param human_readable whether size should be printed in human readable
 *        format
 */
void node_print_stat_info(FILE *stream, const char *path,
    const struct stat *pst, const char *link_target, bool human_readable) {
  putc(dumpchr_stat_file_type(pst->st_mode), stream);
  dump_stat_perms(stream, pst->st_mode);
  fprintf(stream, " %d %4u %4u ", pst->st_nlink, pst->st_uid, pst->st_gid);
  if (human_readable)
    dump_sz_human(stream, pst->st_size, 5);
  else
    fprintf(stream, "%10" PRIuMAX, (uintmax_t) pst->st_size);
  putc(' ', stream);
  dump_time(stream, pst->st_mtime);
  putc(' ', stream);
  fputs(path, stream);
  if (link_target)
    fprintf(stream, " -> %s", link_target);

  // End of line
  putc('\n', stream);
}
Exemplo n.º 10
0
void dump_fixed_program_record(struct fixed_program_record * p) 
{
    dump_group_start    ("Program");
    dump_bitmapping     ("Flags",        p->flags, program_flags_mapping);
    dump_time           ("Event Time",   p->event_time);
    dump_u32            ("TMS ID",       p->tmsid);
    dump_u16            ("Minutes",      p->minutes);
    if (p->genre1)
        dump_mapping    ("Genre 1",      p->genre1, genre_mapping);
    if (p->genre2)
        dump_mapping    ("Genre 2",      p->genre2, genre_mapping);
    if (p->genre3)
        dump_mapping    ("Genre 3",      p->genre3, genre_mapping);
    if (p->genre4)
        dump_mapping    ("Genre 4",      p->genre4, genre_mapping);
    dump_u16            ("Record Length",p->record_len);
    if (p->flags & 0x0040)
        dump_parts      (               &p->parts);
    if (p->flags & 0x0020)
        dump_movie      (               &p->movie);
    if (p->title_len > 1)
        dump_string     ("Title",        p->datablock + p->title_offset);
    if (p->episode_len > 1)
        dump_string     ("Episode",      p->datablock + p->episode_offset);
    if (p->description_len > 1)
        dump_string     ("Description",  p->datablock + p->description_offset);
    if (p->actor_len > 1)
        dump_string     ("Actor",        p->datablock + p->actor_offset);
    if (p->guest_len > 1)
        dump_string     ("Guest",        p->datablock + p->guest_offset);
    if (p->suzuki_len > 1)
        dump_string     ("Suzuki",       p->datablock + p->suzuki_offset);
    if (p->producer_len > 1)
        dump_string     ("Producer",     p->datablock + p->producer_offset);
    if (p->director_len > 1)
        dump_string     ("Director",     p->datablock + p->director_offset);
    dump_group_end      ();
}
Exemplo n.º 11
0
void
dump_zone_data			(GArray		*zone_data,
				 char		*filename)
{
  static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
			    "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
  FILE *fp;
  ZoneData *zone;
  ZoneLineData *zone_line;
  int i, j;
  gboolean output_month, output_day, output_time;

  fp = fopen (filename, "w");
  if (!fp) {
    fprintf (stderr, "Couldn't create file: %s\n", filename);
    exit (1);
  }

  for (i = 0; i < zone_data->len; i++) {
    zone = &g_array_index (zone_data, ZoneData, i);

    fprintf (fp, "Zone\t%s\t", zone->zone_name);

    for (j = 0; j < zone->zone_line_data->len; j++) {
      zone_line = &g_array_index (zone->zone_line_data, ZoneLineData, j);

      if (j != 0)
	fprintf (fp, "\t\t\t");

      fprintf (fp, "%s\t", dump_time (zone_line->stdoff_seconds, TIME_WALL,
				      FALSE));

      if (zone_line->rules)
	fprintf (fp, "%s\t", zone_line->rules);
      else if (zone_line->save_seconds != 0)
	fprintf (fp, "%s\t", dump_time (zone_line->save_seconds, TIME_WALL,
					FALSE));
      else
	fprintf (fp, "-\t");

      fprintf (fp, "%s\t", zone_line->format ? zone_line->format : "-");

      if (zone_line->until_set) {
	fprintf (fp, "%s\t", dump_year (zone_line->until_year));

	output_month = output_day = output_time = FALSE;

	if (zone_line->until_time_code != TIME_WALL
	    || zone_line->until_time_seconds != 0)
	  output_month = output_day = output_time = TRUE;
	else if (zone_line->until_day_code != DAY_SIMPLE
		 || zone_line->until_day_number != 1)
	  output_month = output_day = TRUE;
	else if (zone_line->until_month != 0)
	  output_month = TRUE;

	if (output_month)
	  fprintf (fp, "%s", months[zone_line->until_month]);

	fprintf (fp, "\t");

	if (output_day)
	  fprintf (fp, "%s", dump_day_coded (zone_line->until_day_code,
					     zone_line->until_day_number,
					     zone_line->until_day_weekday));

	fprintf (fp, "\t");

	if (output_time)
	  fprintf (fp, "%s", dump_time (zone_line->until_time_seconds,
					zone_line->until_time_code, FALSE));

      } else {
	fprintf (fp, "\t\t\t");
      }

      fprintf (fp, "\n");
    }
  }

  fclose (fp);
}
Exemplo n.º 12
0
/*
 * Style: 0 = auto
 *       -1 = hex
 *       -2 = raw
 *       +? = that format number
 */
int dumpABIBlock(abi_index_t *ind, int style, int separator, int date_sep,
		 int line_sep) {
    if (style == -2) {
	dump_raw(ind->data, ind->size);
    } else {
	int hex = (style == -1);

	/*
	 * Guess some style. PBAS, APrX, MODL etc are type 2 (1-byte char),
	 * but are really strings. Conversly PCON is also type 2 and is a
	 * series of numbers.
	 */
	if (style == 0 && ind->format == 2) {
	    int i;
	    for (i = 0; i < ind->size; i++)
		if (!(isprint(ind->data[i]) || isspace(ind->data[i])))
		    break;
	    if (i == ind->size)
		style = 19; /* C-string */
	}


	if (style <= 0)
	    style = ind->format;

	switch(style) {
	case 2:
	    dump_int1(ind->data, ind->size, hex, separator);
	    break;
	    
	case 4:
	    dump_int2(ind->data, ind->size, hex, separator);
	    break;
	    
	case 5:
	    dump_int4(ind->data, ind->size, hex, separator);
	    break;
	    
	case 7:
	    dump_float(ind->data, ind->size, hex, separator);
	    break;
	    
	case 8:
	    dump_double(ind->data, ind->size, hex, separator);
	    break;
	    
	case 10:
	    dump_date(ind->data, ind->size, hex, separator, date_sep);
	    break;
	    
	case 11:
	    dump_time(ind->data, ind->size, hex, separator, date_sep);
	    break;
	    
	case 18:
	    dump_pstr(ind->data, ind->size, hex, separator);
	    break;
	    
	case 19:
	    dump_cstr(ind->data, ind->size, hex, separator);
	    break;
	    
	default:
	    /* Default to hex dump for unknown ones */
	    dump_int1(ind->data, ind->size, 1, separator);
	    break;
	}
    }

    if (separator != '\n')
	putchar(line_sep);

    return 0;
}