示例#1
0
static void parse_descriptor(struct qeth_qoat_hdr *oat_hdr,
	struct qeth_print_hdr *phdr, char *buf, int *processed)
{
	int i;
	char *ptr;

	*processed += oat_hdr->len;
	for (i = 0; i < oat_hdr->type.descriptor.reply_entry_count; i++) {
		ptr = buf + *processed;
		switch (oat_hdr->type.descriptor.des_type) {
		case OAT_DES_TYPE_IP4:
			print_ip4((struct qeth_qoat_des_ip4 *)ptr, phdr->ip4_h);
			phdr->ip4_h = 0;
			break;
		case OAT_DES_TYPE_IP4MC:
			print_ip4mc((struct qeth_qoat_des_ip4mc *)ptr,
				phdr->ip4mc_h);
			phdr->ip4mc_h = 0;
			break;
		case OAT_DES_TYPE_IP6:
			print_ip6((struct qeth_qoat_des_ip6 *)ptr, phdr->ip6_h);
			phdr->ip6_h = 0;
			break;
		case OAT_DES_TYPE_IP6MC:
			print_ip6mc((struct qeth_qoat_des_ip6mc *)ptr,
				phdr->ip6mc_h);
			phdr->ip6mc_h = 0;
			break;
		case OAT_DES_TYPE_VMAC:
			print_vmac((struct qeth_qoat_des_vmac *)ptr,
				phdr->vmac_h);
			phdr->vmac_h = 0;
			break;
		case OAT_DES_TYPE_VLAN:
			print_vlan((struct qeth_qoat_des_vlan *)ptr,
				phdr->vlan_h);
			phdr->vlan_h = 0;
			break;
		case OAT_DES_TYPE_GMAC:
			print_gmac((struct qeth_qoat_des_gmac *)ptr,
				phdr->gmac_h);
			phdr->gmac_h = 0;
			break;
		case OAT_DES_TYPE_AIQ:
			print_aiq((struct qeth_qoat_des_aiq *)ptr,
				phdr->aiq_h);
			phdr->aiq_h = 0;
			break;
		default:
			printf("Unknown descriptor (0x%x)\n",
				oat_hdr->type.descriptor.des_type);
			hex_dump(ptr,
				oat_hdr->type.descriptor.reply_entry_len);
		}
		*processed += oat_hdr->type.descriptor.reply_entry_len;
	}
}
示例#2
0
static void cgi_interfaces(FILE *fp) {
	int i;
	for (i = 0; i < RCP_INTERFACE_LIMITS; i++) {
		if (shm->config.intf[i].name[0] != '\0') {
			RcpInterface *intf = &shm->config.intf[i];
			if (intf->type == IF_ETHERNET)
				print_eth(fp, intf);
			else if (intf->type == IF_BRIDGE)
				print_br(fp, intf);
			else if (intf->type == IF_LOOPBACK)
				print_lo(fp, intf);
			else if (intf->type == IF_VLAN)
				print_vlan(fp, intf);
		}
	}	
}