bsnmp-pcap is a module for bsnmpd that allows you to measure arbitrary network traffic flows. The flows are defined in the tcpdump filter syntax.