示例#1
0
fv3_float_t FV3_(efilter)::processR(fv3_float_t input)
{
  return processP(&hpfR,processZ(&lpfR,input));
}
示例#2
0
文件: Ether.c 项目: eson001/eos
int processEtherPacket(const void * data, int size, int length) {
	const PEtherPacket packet = (PEtherPacket) data;
	void * payload_data = ETHER_OVERLOAD_DATA(data);
	int    payload_size = ETHER_OVERLOAD_SIZE(size);

	processA(&gTotal, length);
	processA(&gCurrent, length);

	PSoderoPeriodResult result = getPeriodResult();
	processA(&result->protocol.l2.ether.total, size);

	processEtherCast(packet, size, payload_data, payload_size);

	PNodeValue sour = takeMACNode(&packet->head.sour);
	PNodeValue dest = takeMACNode(&packet->head.dest);

	if (sour)
		processP(&sour->l2.total.outgoing, size);
	if (dest)
		processP(&dest->l2.total.incoming, size);
	switch (packet->head.type) {
		case ETHER_TYPE_IPv4:
			processA(&result->protocol.l2.ether.ipv4, size);
			if (sour)
				processA(&sour->l2.ipv4.outgoing, size);
			if (dest)
				processA(&dest->l2.ipv4.incoming, size);
			payload_size = processIPv4Packet (payload_data, payload_size, size, &packet->head, 0);
			break;
		case ETHER_TYPE_ARP :
			processA(&result->protocol.l2.ether.arp, size);
			if (sour)
				processA(&sour->l2.arp.outgoing, size);
			if (dest)
				processA(&dest->l2.arp.incoming, size);
			payload_size = processARPPacket  (payload_data, payload_size, size, &packet->head);
			break;
		case ETHER_TYPE_VLAN:
			processA(&result->protocol.l2.ether.vlan, size);
			if (sour)
				processA(&sour->l2.vlan.outgoing, size);
			if (dest)
				processA(&dest->l2.vlan.incoming, size);
			payload_size = processVLANPacket (payload_data, payload_size, size, &packet->head);
			break;
		case ETHER_TYPE_MPLS:
			processA(&result->protocol.l2.ether.mpls, size);
			if (sour)
				processA(&sour->l2.mpls.outgoing, size);
			if (dest)
				processA(&dest->l2.mpls.incoming, size);
			payload_size = processMPLSPacket (payload_data, payload_size, size, &packet->head, 0);
			break;
		case ETHER_TYPE_LACP:
			processA(&result->protocol.l2.ether.lacp, size);
			if (sour)
				processA(&sour->l2.lacp.outgoing, size);
			if (dest)
				processA(&dest->l2.lacp.incoming, size);
			payload_size = processLACPPacket (payload_data, payload_size, size, &packet->head);
			break;
		case ETHER_TYPE_IPv6:
			processA(&result->protocol.l2.ether.ipv6, size);
			if (sour)
				processA(&sour->l2.ipv6.outgoing, size);
			if (dest)
				processA(&dest->l2.ipv6.incoming, size);
			payload_size = processIPv6Packet (payload_data, payload_size, size, &packet->head, 0);
			break;
		default:
			processA(&result->protocol.l2.ether.other, size);
			if (sour)
				processA(&sour->l2.other.outgoing, size);
			if (dest)
				processA(&dest->l2.other.incoming, size);
			payload_size = processOtherPacket(payload_data, payload_size, size, &packet->head);
			break;
	}
//	PSoderoFlowDatum datum = (PSoderoFlowDatum) sodero_map_ensure(gPeriodResult->items.ether, packet->head.type);
//	processA(datum, size);

	return payload_size;
}