Example #1
0
/**
 * Add IETF Product Information attribute to the send queue
 */
static void add_product_info(imc_msg_t *msg)
{
	pa_tnc_attr_t *attr;
	os_type_t os_type;
	pen_t vendor_id = PEN_IETF;
	int i;

	typedef struct vendor_pen_t {
		os_type_t os_type;
		pen_t pen;
	} vendor_pen_t;

	vendor_pen_t vendor_pens[] = {
		{ OS_TYPE_DEBIAN,  PEN_DEBIAN },
		{ OS_TYPE_UBUNTU,  PEN_CANONICAL },
		{ OS_TYPE_FEDORA,  PEN_FEDORA },
		{ OS_TYPE_REDHAT,  PEN_REDHAT },
		{ OS_TYPE_ANDROID, PEN_GOOGLE }
	};

	os_type = os->get_type(os);
	for (i = 0; i < countof(vendor_pens); i++)
	{
		if (os_type == vendor_pens[i].os_type)
		{
			vendor_id = vendor_pens[i].pen;
			break;
		}
	}
	attr = ietf_attr_product_info_create(vendor_id, 0, os->get_name(os));
	msg->add_attribute(msg, attr);
}
Example #2
0
/**
 * Add IETF Product Information attribute to the send queue
 */
static void add_product_info(imc_msg_t *msg)
{
	pa_tnc_attr_t *attr;

	attr = ietf_attr_product_info_create(PEN_IETF, 0, os->get_name(os));
	msg->add_attribute(msg, attr);
}
/**
 * Add IETF Product Information attribute to the send queue
 */
static void add_product_info(linked_list_t *attr_list)
{
	pa_tnc_attr_t *attr;
	chunk_t android_os = { "Android", 7 };

	attr = ietf_attr_product_info_create(PEN_IETF, 0, android_os);
	attr_list->insert_last(attr_list, attr);
}