Beispiel #1
0
 static void
 dump_a ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   strm << ( (dns::a_resource*) Ptr )->domain() << "\t" << ( (dns::a_resource*) Ptr )->ttl() << "\t"
       << get_class_string( ( (dns::a_resource*) Ptr )->rclass()) << "\t" << get_type_string(
       ( (dns::a_resource*) Ptr )->rtype()) << "\t" << ( (dns::a_resource*) Ptr )->address().to_string() << std::endl;
 }
Beispiel #2
0
 static void
 dump_ptr ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   strm << ( (dns::ptr_resource*) Ptr )->domain() << "\t" << ( (dns::ptr_resource*) Ptr )->ttl() << "\t"
       << get_class_string( ( (dns::ptr_resource*) Ptr )->rclass()) << "\t" << get_type_string(
       ( (dns::ptr_resource*) Ptr )->rtype()) << "\t" << ( (dns::ptr_resource*) Ptr )->pointer() << std::endl;
 }
Beispiel #3
0
 static void
 dump_hinfo ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   strm << ( (dns::hinfo_resource*) Ptr )->domain() << "\t" << ( (dns::hinfo_resource*) Ptr )->ttl() << "\t"
       << get_class_string( ( (dns::hinfo_resource*) Ptr )->rclass()) << "\t" << get_type_string(
       ( (dns::hinfo_resource*) Ptr )->rtype()) << "\t" << ( (dns::hinfo_resource*) Ptr )->cpu() << "\t"
       << ( (dns::hinfo_resource*) Ptr )->os() << std::endl;
 }
Beispiel #4
0
 static void
 dump_cname ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   strm << ( (dns::cname_resource*) Ptr )->domain() << "\t" << ( (dns::cname_resource*) Ptr )->ttl() << "\t"
       << get_class_string( ( (dns::cname_resource*) Ptr )->rclass()) << "\t" << get_type_string(
       ( (dns::cname_resource*) Ptr )->rtype()) << "\t" << ( (dns::cname_resource*) Ptr )->canonicalname()
       << std::endl;
 }
Beispiel #5
0
 static void
 dump_mx ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   strm << ( (dns::mx_resource*) Ptr )->domain() << "\t" << ( (dns::mx_resource*) Ptr )->ttl() << "\t"
       << get_class_string( ( (dns::mx_resource*) Ptr )->rclass()) << "\t" << get_type_string(
       ( (dns::mx_resource*) Ptr )->rtype()) << "\t" << ( (dns::mx_resource*) Ptr )->preference() << "\t"
       << ( (dns::mx_resource*) Ptr )->exchange() << std::endl;
 }
Beispiel #6
0
 static void
 dump_srv ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   strm << ( (dns::srv_resource*) Ptr )->domain() << "\t" << ( (dns::srv_resource*) Ptr )->ttl() << "\t"
       << get_class_string( ( (dns::srv_resource*) Ptr )->rclass()) << "\t" << get_type_string(
       ( (dns::srv_resource*) Ptr )->rtype()) << "\t" << ( (dns::srv_resource*) Ptr )->priority() << "\t"
       << ( (dns::srv_resource*) Ptr )->weight() << "\t" << ( (dns::srv_resource*) Ptr )->port() << "\t"
       << ( (dns::srv_resource*) Ptr )->targethost() << std::endl;
 }
Beispiel #7
0
 static void
 dump_soa ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   strm << ( (dns::soa_resource*) Ptr )->domain() << "\t" << ( (dns::soa_resource*) Ptr )->ttl() << "\t"
       << "SOA\t" << get_class_string( ( (dns::soa_resource*) Ptr )->rclass()) << "\t" << get_type_string(
       ( (dns::soa_resource*) Ptr )->rtype()) << "\t" << ( (dns::soa_resource*) Ptr )->master_name() << "\t"
       << ( (dns::soa_resource*) Ptr )->responsible_name() << "\t"
       << ( (dns::soa_resource*) Ptr )->serial_number() << "\t" << ( (dns::soa_resource*) Ptr )->refresh()
       << "\t" << ( (dns::soa_resource*) Ptr )->retry() << "\t" << ( (dns::soa_resource*) Ptr )->expire()
       << "\t" << ( (dns::soa_resource*) Ptr )->minttl() << std::endl;
 }
static void print_usbdevice(struct usbdevice *d, struct usbinterface *i)
{
	char subcls[128];

	get_class_string(subcls, sizeof(subcls), i->bInterfaceClass);

	if (i->bInterfaceClass == 9)
		printf("Port %u: Dev %u, If %u, Class=%s, Driver=%s/%up, %sM\n", d->portnum, d->devnum, i->ifnum, subcls,
		       i->driver, d->maxchild, d->speed);
	else
		printf("Port %u: Dev %u, If %u, Class=%s, Driver=%s, %sM\n", d->portnum, d->devnum, i->ifnum, subcls, i->driver,
		       d->speed);
}
Beispiel #9
0
 static void
 dump_a6 ( std::ostream& strm, dns::resource_base_t* Ptr )
 {
   try
   {
     strm << ( (dns::a6_resource*) Ptr )->domain() << "\t" << ( (dns::a6_resource*) Ptr )->ttl() << "\t"
         << get_class_string( ( (dns::a6_resource*) Ptr )->rclass()) << "\t" << get_type_string(
         ( (dns::a6_resource*) Ptr )->rtype()) << "\t" << ( (dns::a6_resource*) Ptr )->address().to_string()
         << std::endl;
   }
   catch( asio::error_code& ec )
   {
     strm << ec.message() << std::endl;
   }
 }
Beispiel #10
0
static void print_usbdevice(struct usbdevice *d, struct usbinterface *i)
{
	char subcls[128];
	char vendor[128], product[128];

	get_class_string(subcls, sizeof(subcls), i->bInterfaceClass);

	if (i->bInterfaceClass == 9)
		printf("Port %u: Dev %u, If %u, Class=%s, Driver=%s/%up, %sM\n", d->portnum, d->devnum, i->ifnum, subcls,
		       i->driver, d->maxchild, d->speed);
	else
		printf("Port %u: Dev %u, If %u, Class=%s, Driver=%s, %sM\n", d->portnum, d->devnum, i->ifnum, subcls, i->driver,
		       d->speed);
	if (verblevel >= 1) {
		printf(" %*s", indent, "    ");
		get_vendor_string(vendor, sizeof(vendor), d->idVendor);
		get_product_string(product, sizeof(product), d->idVendor, d->idProduct);
		printf("ID %04x:%04x %s %s\n", d->idVendor, d->idProduct, vendor, product);
	}
	if (verblevel >= 2) {
		printf(" %*s", indent, "    ");
		printf("%s/%s  /dev/bus/usb/%03d/%03d\n", sys_bus_usb_devices, d->name, d->busnum, d->devnum);
	}
}
eap_status_e asn1_der_type_c::debug_header(eap_variable_data_c * const debug_buffer)
{
	if (debug_buffer == 0)
	{
		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
		return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter);
	}

	const u32_t max_data_length(m_recursion * SIZE_OF_ONE_OCTET_STRING + m_offset_of_contents_field * SIZE_OF_ONE_OCTET_STRING);

	if (max_data_length > debug_buffer->get_buffer_length())
	{
		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
	}

	eap_status_e status = debug_buffer->set_data_length(max_data_length);
	if (status != eap_status_ok)
	{
		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
		return EAP_STATUS_RETURN(m_am_tools, status);
	}

	u32_t ind(0ul);
	u32_t offset(0ul);

	u8_t * const prefix = reinterpret_cast<u8_t *>(debug_buffer->get_data(max_data_length));

	if (prefix == 0)
	{
		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
		return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
	}

	status = debug_create_prefix(m_recursion, prefix, max_data_length, &offset);
	if (status != eap_status_ok)
	{
		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
		return EAP_STATUS_RETURN(m_am_tools, status);
	}

	for (ind = 0ul; ind < m_offset_of_length_field && ind < m_input_data_length; ++ind)
	{
		offset += m_am_tools->snprintf(
			debug_buffer->get_data_offset(offset, debug_buffer->get_data_length() - offset),
			debug_buffer->get_data_length() - offset,
			"%02x \0",
			m_input_data[ind]);
	}

	for (ind = m_offset_of_length_field; ind < m_offset_of_contents_field && ind < m_input_data_length; ++ind)
	{
		offset += m_am_tools->snprintf(
			debug_buffer->get_data_offset(offset, debug_buffer->get_data_length() - offset),
			debug_buffer->get_data_length() - offset,
			"%02x \0",
			m_input_data[ind]);
	}

	status = debug_buffer->add_end_null();
	if (status != eap_status_ok)
	{
		EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
		return EAP_STATUS_RETURN(m_am_tools, status);
	}

	eap_const_string tag_string = 0;
	eap_char buffer[MAX_STACK_BUFFER];

	if (get_class() == asn1_class_application)
	{
		m_am_tools->snprintf(
			reinterpret_cast<u8_t *>(buffer),
			MAX_STACK_BUFFER,
			"Application[%d]\0",
			get_tag());

		tag_string = buffer;
	}
	else if (get_class() == asn1_class_context_specific)
	{
		m_am_tools->snprintf(
			reinterpret_cast<u8_t *>(buffer),
			MAX_STACK_BUFFER,
			"[%d]\0",
			get_tag());

		tag_string = buffer;
	}
	else
	{
		tag_string = get_tag_string();
	}

	EAP_TRACE_DEBUG(
		m_am_tools,
		TRACE_FLAGS_DEFAULT,
		(EAPL("%s # %s, %s, %s, length=0x%x=%d, this=0x%08x, index=%d\n"),
			debug_buffer->get_data(max_data_length),
			get_class_string(),
			get_pc_string(),
			tag_string,
			get_content_length(),
			get_content_length(),
			this,
			m_index));

	EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
	return EAP_STATUS_RETURN(m_am_tools, status);
}
Beispiel #12
0
bstring Creature::getClassString() const {
    return get_class_string(static_cast<int>(cClass));
}