History log of /freebsd-10-stable/sys/netgraph/netflow/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
314667 04-Mar-2017 avg

MFC r283291: don't use CALLOUT_MPSAFE with callout_init()

The main purpose of this MFC is to reduce conflicts for other merges.
Parts of the original change have already "trickled down" via individual MFCs.


/freebsd-10-stable/sys/amd64/amd64/mp_watchdog.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
/freebsd-10-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
/freebsd-10-stable/sys/cddl/dev/profile/profile.c
/freebsd-10-stable/sys/compat/ndis/subr_ntoskrnl.c
/freebsd-10-stable/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
/freebsd-10-stable/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c
/freebsd-10-stable/sys/dev/ath/if_ath.c
/freebsd-10-stable/sys/dev/ce/if_ce.c
/freebsd-10-stable/sys/dev/cp/if_cp.c
/freebsd-10-stable/sys/dev/ctau/if_ct.c
/freebsd-10-stable/sys/dev/cx/if_cx.c
/freebsd-10-stable/sys/dev/cxgb/cxgb_main.c
/freebsd-10-stable/sys/dev/cxgb/cxgb_sge.c
/freebsd-10-stable/sys/dev/dcons/dcons_os.c
/freebsd-10-stable/sys/dev/drm2/drm_irq.c
/freebsd-10-stable/sys/dev/drm2/i915/intel_display.c
/freebsd-10-stable/sys/dev/glxsb/glxsb.c
/freebsd-10-stable/sys/dev/gxemul/cons/gxemul_cons.c
/freebsd-10-stable/sys/dev/hifn/hifn7751.c
/freebsd-10-stable/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
/freebsd-10-stable/sys/dev/if_ndis/if_ndis.c
/freebsd-10-stable/sys/dev/isci/isci_io_request.c
/freebsd-10-stable/sys/dev/mfi/mfi.c
/freebsd-10-stable/sys/dev/mwl/if_mwl.c
/freebsd-10-stable/sys/dev/nand/nandsim_chip.c
/freebsd-10-stable/sys/dev/ntb/ntb_hw/ntb_hw.c
/freebsd-10-stable/sys/dev/nxge/if_nxge.c
/freebsd-10-stable/sys/dev/oce/oce_if.c
/freebsd-10-stable/sys/dev/patm/if_patm_attach.c
/freebsd-10-stable/sys/dev/rndtest/rndtest.c
/freebsd-10-stable/sys/dev/safe/safe.c
/freebsd-10-stable/sys/dev/sound/midi/mpu401.c
/freebsd-10-stable/sys/dev/sound/pci/atiixp.c
/freebsd-10-stable/sys/dev/sound/pci/es137x.c
/freebsd-10-stable/sys/dev/sound/pci/hda/hdaa.c
/freebsd-10-stable/sys/dev/sound/pci/hda/hdac.c
/freebsd-10-stable/sys/dev/sound/pci/via8233.c
/freebsd-10-stable/sys/dev/twa/tw_osl_freebsd.c
/freebsd-10-stable/sys/dev/tws/tws.c
/freebsd-10-stable/sys/dev/ubsec/ubsec.c
/freebsd-10-stable/sys/dev/virtio/random/virtio_random.c
/freebsd-10-stable/sys/dev/xen/netfront/netfront.c
/freebsd-10-stable/sys/fs/nfs/nfs_commonport.c
/freebsd-10-stable/sys/gdb/gdb_cons.c
/freebsd-10-stable/sys/geom/gate/g_gate.c
/freebsd-10-stable/sys/geom/journal/g_journal.c
/freebsd-10-stable/sys/geom/mirror/g_mirror.c
/freebsd-10-stable/sys/geom/raid3/g_raid3.c
/freebsd-10-stable/sys/geom/sched/gs_rr.c
/freebsd-10-stable/sys/i386/i386/mp_watchdog.c
/freebsd-10-stable/sys/kern/init_main.c
/freebsd-10-stable/sys/kern/kern_synch.c
/freebsd-10-stable/sys/kern/kern_thread.c
/freebsd-10-stable/sys/kern/subr_vmem.c
/freebsd-10-stable/sys/kern/uipc_domain.c
/freebsd-10-stable/sys/mips/cavium/octe/ethernet.c
/freebsd-10-stable/sys/mips/cavium/octeon_rnd.c
/freebsd-10-stable/sys/mips/nlm/dev/net/xlpge.c
/freebsd-10-stable/sys/mips/rmi/dev/xlr/rge.c
/freebsd-10-stable/sys/net/if_spppsubr.c
/freebsd-10-stable/sys/net80211/ieee80211_ht.c
/freebsd-10-stable/sys/net80211/ieee80211_hwmp.c
/freebsd-10-stable/sys/net80211/ieee80211_mesh.c
/freebsd-10-stable/sys/net80211/ieee80211_node.c
/freebsd-10-stable/sys/net80211/ieee80211_proto.c
ng_netflow.c
/freebsd-10-stable/sys/netgraph/netgraph.h
/freebsd-10-stable/sys/netinet/in_pcb.c
/freebsd-10-stable/sys/netinet/ip_mroute.c
/freebsd-10-stable/sys/netinet/tcp_hostcache.c
/freebsd-10-stable/sys/netinet/tcp_subr.c
/freebsd-10-stable/sys/netinet6/in6_rmx.c
/freebsd-10-stable/sys/netpfil/ipfw/ip_dummynet.c
/freebsd-10-stable/sys/netpfil/ipfw/ip_fw_dynamic.c
/freebsd-10-stable/sys/netpfil/pf/if_pfsync.c
/freebsd-10-stable/sys/ofed/include/linux/timer.h
/freebsd-10-stable/sys/ofed/include/linux/workqueue.h
/freebsd-10-stable/sys/powerpc/mambo/mambo_console.c
/freebsd-10-stable/sys/powerpc/pseries/phyp_console.c
/freebsd-10-stable/sys/sys/callout.h
/freebsd-10-stable/sys/vm/uma_core.c
/freebsd-10-stable/sys/x86/x86/mca.c
260278 04-Jan-2014 dim

MFC r260048:

In sys/netgraph/netflow, use __FBSDID() instead of old-style rcs_id[].

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255202 04-Sep-2013 glebius

Make default cache size more modern.

Requested by: Slawa Olhovchenkov <slw zxy.spb.ru>


249400 12-Apr-2013 glebius

Attempt to clean up spacing and long lines.


248725 26-Mar-2013 glebius

Return ENOMEM if malloc() fails.


248724 26-Mar-2013 glebius

Cleanup: wrap long lines, cleanup comments, etc.


243882 05-Dec-2012 glebius

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags within sys.

Exceptions:

- sys/contrib not touched
- sys/mbuf.h edited manually


241446 11-Oct-2012 melifaro

Add NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specific
data.

Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com>
MFC after: 2 weeks


241369 09-Oct-2012 kevlo

Fix typo: s/unknow/unknown


237227 18-Jun-2012 melifaro

Make radix lookup on src and dst flow addresses optional
and configurable on per-interface basis.
Remove __inline__ for several functions being called once per
flow (e.g once per 10-20 packets on common traffic flows).
Update manual page to simplify search for BPF data link types.

Sponsored by Yandex LLC

Reviewed by: glebius
Approved by: ae(mentor)
MFC after: 2 weeks


237226 18-Jun-2012 melifaro

Simplify IP pointer recovery in case of mbuf reallocation.

Reviewed by: glebius (previous version)
Approved by: ae(mentor)
MFC after: 2 weeks


237164 16-Jun-2012 melifaro

Use time_uptime instead of getnanotime for accouting integer number of seconds.

Reviewed by: glebius
Approved by: ae(mentor)
MFC after: 1 week


237163 16-Jun-2012 melifaro

Set netflow v9 observation domain value to fib number instead of node id.
This fixes multi-fib netflow v9 export.

Reviewed by: glebius
Approved by: kib(mentor)
MFC after: 1 week


237162 16-Jun-2012 melifaro

Fix improper L4 header handling for IPv6 packets passed via DLT_RAW.

Reported by: Emil Muratov <gpm@hotplug.ru>
Reviewed by: glebius
Approved by: ae(mentor)
MFC after: 1 week


232921 13-Mar-2012 melifaro

Use rt_numfibs variable instead of compile-time RT_NUMFIBS.

Reviewed by: glebius (previous version)
Approved by: kib(mentor), ae(mentor)


223822 06-Jul-2011 glebius

Add missing unlocks.


223787 05-Jul-2011 glebius

o Eliminate flow6_hash_entry in favor of flow_hash_entry. We don't need
a separate struct to start a slist of semi-opaque structs. This
makes some code more compact.
o Rewrite ng_netflow_flow_show() and its API/ABI:
- Support for IPv6 is added.
- Request and response now use same struct. Structure specifies
version (6 or 4), index of last retrieved hash, and also index
of last retrieved entry in the hash entry.


223706 01-Jul-2011 glebius

Fix double free.

Submitted by: Alexander V. Chernikov <melifaro ipfw.ru>


220769 18-Apr-2011 glebius

ng_netflow_cache_init() can be void.


220768 18-Apr-2011 glebius

Node constructor methods are supposed to be called in syscall
context always. Convert nodes to consistently use M_WAITOK flag
for memory allocation.

Reviewed by: julian


219229 03-Mar-2011 bz

Unbreak the build for no options INET6.

PR: kern/155227
Submitted by: Dmitry Afanasiev (KOT MATPOCKuH.Ru)


219182 02-Mar-2011 glebius

Add support for NetFlow version 9 into ng_netflow(4) node.

Submitted by: Alexander V. Chernikov <melifaro ipfw.ru>


210500 26-Jul-2010 glebius

Zero padding fields of netflow records. This helps to reduce
size of compressed export logs.

Requested by: Alexey Illarionov <littlesavage orionet.ru>


205636 25-Mar-2010 glebius

Remove disabled code. In 99% cases exports are send to ng_ksocket(4), which
already forces queued mode, so what was suggested in disabled code is already
done.


192032 13-May-2009 mav

Fix copy-paste bug in NGM_NETFLOW_SETCONFIG argument size verification.

PR: kern/134220
Submitted by: Eugene Mychlo
MFC after: 1 week


186119 15-Dec-2008 qingli

This main goals of this project are:
1. separating L2 tables (ARP, NDP) from the L3 routing tables
2. removing as much locking dependencies among these layers as
possible to allow for some parallelism in the search operations
3. simplify the logic in the routing code,

The most notable end result is the obsolescent of the route
cloning (RTF_CLONING) concept, which translated into code reduction
in both IPv4 ARP and IPv6 NDP related modules, and size reduction in
struct rtentry{}. The change in design obsoletes the semantics of
RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland
applications such as "arp" and "ndp" have been modified to reflect
those changes. The output from "netstat -r" shows only the routing
entries.

Quite a few developers have contributed to this project in the
past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and
Andre Oppermann. And most recently:

- Kip Macy revised the locking code completely, thus completing
the last piece of the puzzle, Kip has also been conducting
active functional testing
- Sam Leffler has helped me improving/refactoring the code, and
provided valuable reviews
- Julian Elischer setup the perforce tree for me and has helped
me maintaining that branch before the svn conversion


184214 23-Oct-2008 des

Fix a number of style issues in the MALLOC / FREE commit. I've tried to
be careful not to fix anything that was already broken; the NFSv4 code is
particularly bad in this respect.


184205 23-Oct-2008 des

Retire the MALLOC and FREE macros. They are an abomination unto style(9).

MFC after: 3 months


183693 08-Oct-2008 mav

Add ability to generate egress netflow instead or in addition to ingress.
Use mbuf tagging for accounted packets to not account packets twice when
both ingress and egress netflow enabled.
To keep compatibility new "setconfig" message added to control new
functionality. By default node works as before, doing only ingress
accounting without using mbuf tags.

Reviewed by: glebius


178888 09-May-2008 julian

Add code to allow the system to handle multiple routing tables.
This particular implementation is designed to be fully backwards compatible
and to be MFC-able to 7.x (and 6.x)

Currently the only protocol that can make use of the multiple tables is IPv4
Similar functionality exists in OpenBSD and Linux.

From my notes:

-----

One thing where FreeBSD has been falling behind, and which by chance I
have some time to work on is "policy based routing", which allows
different
packet streams to be routed by more than just the destination address.

Constraints:
------------

I want to make some form of this available in the 6.x tree
(and by extension 7.x) , but FreeBSD in general needs it so I might as
well do it in -current and back port the portions I need.

One of the ways that this can be done is to have the ability to
instantiate multiple kernel routing tables (which I will now
refer to as "Forwarding Information Bases" or "FIBs" for political
correctness reasons). Which FIB a particular packet uses to make
the next hop decision can be decided by a number of mechanisms.
The policies these mechanisms implement are the "Policies" referred
to in "Policy based routing".

One of the constraints I have if I try to back port this work to
6.x is that it must be implemented as a EXTENSION to the existing
ABIs in 6.x so that third party applications do not need to be
recompiled in timespan of the branch.

This first version will not have some of the bells and whistles that
will come with later versions. It will, for example, be limited to 16
tables in the first commit.
Implementation method, Compatible version. (part 1)
-------------------------------
For this reason I have implemented a "sufficient subset" of a
multiple routing table solution in Perforce, and back-ported it
to 6.x. (also in Perforce though not always caught up with what I
have done in -current/P4). The subset allows a number of FIBs
to be defined at compile time (8 is sufficient for my purposes in 6.x)
and implements the changes needed to allow IPV4 to use them. I have not
done the changes for ipv6 simply because I do not need it, and I do not
have enough knowledge of ipv6 (e.g. neighbor discovery) needed to do it.

Other protocol families are left untouched and should there be
users with proprietary protocol families, they should continue to work
and be oblivious to the existence of the extra FIBs.

To understand how this is done, one must know that the current FIB
code starts everything off with a single dimensional array of
pointers to FIB head structures (One per protocol family), each of
which in turn points to the trie of routes available to that family.

The basic change in the ABI compatible version of the change is to
extent that array to be a 2 dimensional array, so that
instead of protocol family X looking at rt_tables[X] for the
table it needs, it looks at rt_tables[Y][X] when for all
protocol families except ipv4 Y is always 0.
Code that is unaware of the change always just sees the first row
of the table, which of course looks just like the one dimensional
array that existed before.

The entry points rtrequest(), rtalloc(), rtalloc1(), rtalloc_ign()
are all maintained, but refer only to the first row of the array,
so that existing callers in proprietary protocols can continue to
do the "right thing".
Some new entry points are added, for the exclusive use of ipv4 code
called in_rtrequest(), in_rtalloc(), in_rtalloc1() and in_rtalloc_ign(),
which have an extra argument which refers the code to the correct row.

In addition, there are some new entry points (currently called
rtalloc_fib() and friends) that check the Address family being
looked up and call either rtalloc() (and friends) if the protocol
is not IPv4 forcing the action to row 0 or to the appropriate row
if it IS IPv4 (and that info is available). These are for calling
from code that is not specific to any particular protocol. The way
these are implemented would change in the non ABI preserving code
to be added later.

One feature of the first version of the code is that for ipv4,
the interface routes show up automatically on all the FIBs, so
that no matter what FIB you select you always have the basic
direct attached hosts available to you. (rtinit() does this
automatically).

You CAN delete an interface route from one FIB should you want
to but by default it's there. ARP information is also available
in each FIB. It's assumed that the same machine would have the
same MAC address, regardless of which FIB you are using to get
to it.

This brings us as to how the correct FIB is selected for an outgoing
IPV4 packet.

Firstly, all packets have a FIB associated with them. if nothing
has been done to change it, it will be FIB 0. The FIB is changed
in the following ways.

Packets fall into one of a number of classes.

1/ locally generated packets, coming from a socket/PCB.
Such packets select a FIB from a number associated with the
socket/PCB. This in turn is inherited from the process,
but can be changed by a socket option. The process in turn
inherits it on fork. I have written a utility call setfib
that acts a bit like nice..

setfib -3 ping target.example.com # will use fib 3 for ping.

It is an obvious extension to make it a property of a jail
but I have not done so. It can be achieved by combining the setfib and
jail commands.

2/ packets received on an interface for forwarding.
By default these packets would use table 0,
(or possibly a number settable in a sysctl(not yet)).
but prior to routing the firewall can inspect them (see below).
(possibly in the future you may be able to associate a FIB
with packets received on an interface.. An ifconfig arg, but not yet.)

3/ packets inspected by a packet classifier, which can arbitrarily
associate a fib with it on a packet by packet basis.
A fib assigned to a packet by a packet classifier
(such as ipfw) would over-ride a fib associated by
a more default source. (such as cases 1 or 2).

4/ a tcp listen socket associated with a fib will generate
accept sockets that are associated with that same fib.

5/ Packets generated in response to some other packet (e.g. reset
or icmp packets). These should use the FIB associated with the
packet being reponded to.

6/ Packets generated during encapsulation.
gif, tun and other tunnel interfaces will encapsulate using the FIB
that was in effect withthe proces that set up the tunnel.
thus setfib 1 ifconfig gif0 [tunnel instructions]
will set the fib for the tunnel to use to be fib 1.

Routing messages would be associated with their
process, and thus select one FIB or another.
messages from the kernel would be associated with the fib they
refer to and would only be received by a routing socket associated
with that fib. (not yet implemented)

In addition Netstat has been edited to be able to cope with the
fact that the array is now 2 dimensional. (It looks in system
memory using libkvm (!)). Old versions of netstat see only the first FIB.

In addition two sysctls are added to give:
a) the number of FIBs compiled in (active)
b) the default FIB of the calling process.

Early testing experience:
-------------------------

Basically our (IronPort's) appliance does this functionality already
using ipfw fwd but that method has some drawbacks.

For example,
It can't fully simulate a routing table because it can't influence the
socket's choice of local address when a connect() is done.

Testing during the generating of these changes has been
remarkably smooth so far. Multiple tables have co-existed
with no notable side effects, and packets have been routes
accordingly.

ipfw has grown 2 new keywords:

setfib N ip from anay to any
count ip from any to any fib N

In pf there seems to be a requirement to be able to give symbolic names to the
fibs but I do not have that capacity. I am not sure if it is required.

SCTP has interestingly enough built in support for this, called VRFs
in Cisco parlance. it will be interesting to see how that handles it
when it suddenly actually does something.

Where to next:
--------------------

After committing the ABI compatible version and MFCing it, I'd
like to proceed in a forward direction in -current. this will
result in some roto-tilling in the routing code.

Firstly: the current code's idea of having a separate tree per
protocol family, all of the same format, and pointed to by the
1 dimensional array is a bit silly. Especially when one considers that
there is code that makes assumptions about every protocol having the
same internal structures there. Some protocols don't WANT that
sort of structure. (for example the whole idea of a netmask is foreign
to appletalk). This needs to be made opaque to the external code.

My suggested first change is to add routing method pointers to the
'domain' structure, along with information pointing the data.
instead of having an array of pointers to uniform structures,
there would be an array pointing to the 'domain' structures
for each protocol address domain (protocol family),
and the methods this reached would be called. The methods would have
an argument that gives FIB number, but the protocol would be free
to ignore it.

When the ABI can be changed it raises the possibilty of the
addition of a fib entry into the "struct route". Currently,
the structure contains the sockaddr of the desination, and the resulting
fib entry. To make this work fully, one could add a fib number
so that given an address and a fib, one can find the third element, the
fib entry.

Interaction with the ARP layer/ LL layer would need to be
revisited as well. Qing Li has been working on this already.

This work was sponsored by Ironport Systems/Cisco

Reviewed by: several including rwatson, bz and mlair (parts each)
Obtained from: Ironport systems/Cisco


178250 16-Apr-2008 kris

Replace callout_init(..., 1) with callout_init(..., CALLOUT_MPSAFE) for
better grep-compliance and to standardize with the rest of the kernel.

Reviewed by: jhb
MFC after: 1 week


176085 07-Feb-2008 glebius

Use rtalloc1() instead of rtalloc_ign(). It returns a locked
rtentry. We quickly copy the fields of interest, and then
RTFREE_LOCKED(). This should be faster then lock & unlock the
rtentry twice.


175934 03-Feb-2008 mav

Revert previous commit.
glebius@ noticed that it was not a bug, but undocumented feature.


175721 27-Jan-2008 mav

Run expire even without export hook connected.

PR: kern/119839


175718 27-Jan-2008 mav

Fix memory leak when export hook is not connected.


175717 27-Jan-2008 mav

Remove one very strange unneded if.


171744 06-Aug-2007 rwatson

Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which
previously conditionally acquired Giant based on debug.mpsafenet. As that
has now been removed, they are no longer required. Removing them
significantly simplifies error-handling in the socket layer, eliminated
quite a bit of unwinding of locking in error cases.

While here clean up the now unneeded opt_net.h, which previously was used
for the NET_WITH_GIANT kernel option. Clean up some related gotos for
consistency.

Reviewed by: bz, csjp
Tested by: kris
Approved by: re (kensmith)


167990 28-Mar-2007 glebius

Bump maximum number of interface hooks to the maximum possible value.
This will increase the memory consumption for more than 1 Mb, but this
is required for operation on multiinterface access concentrators running
mpd.

Requested by: Alexander Motin


163247 11-Oct-2006 glebius

Recognize 802.1q frames in Ethernet input and process them.

PR: kern/101162
Submitted by: CoolDavid (Tseng Guo-Fu) <cooldavid cdpa.nsysu.edu.tw>


163241 11-Oct-2006 glebius

Make it buildable.


163240 11-Oct-2006 glebius

Unbreak a short one.

Submitted by: maxim


163239 11-Oct-2006 glebius

Break long line.


163238 11-Oct-2006 glebius

Use hash functions with better distribution. Tested on live traffic.

Submitted by: Alexander Motin <mav alkar.net>


163234 11-Oct-2006 glebius

Use bitcount32() from sys/systm.h instead of my own.


158028 25-Apr-2006 maxim

o Replace disappeared URLs to Cisco docs by new ones, style.
No functional changes.


158027 25-Apr-2006 maxim

o Set to zero engine_type, engine_id and pad (cisco calls it
sampling_interval) fields in netflow v5 header. We do not use
them but some netflow tools show garbage.

PR: kern/96296
Submitted by: David Duchscher
Approved by: glebius
MFC after: 1 week


155468 09-Feb-2006 glebius

- Increase maximum number of interfaces to 2048.
- Regroup softc so that frequently used elements are
grouped in the beginning, while the interfaces
array is at the end.


154354 14-Jan-2006 glebius

Correct off-by-one errors.

Found with: Coverity Prevent(tm)


154277 12-Jan-2006 glebius

When sending export datagram from interrupt thread, use NG_QUEUE
in flags. When sending export datagram from expiry thread, then
use default zero flags. This removes unpleasant contention of the
interrupt thread on mutexes (usually ng_ksocket's socket buffer
mutex).


154267 12-Jan-2006 glebius

Mark appropriate commands with NGM_READONLY and NGM_HASREPLY and
bump type cookie.


153791 28-Dec-2005 glebius

In ng_netflow_disconnect() check whether we are working with "iface"
or with "out" hook, and clear the right pointer.

Reported by: Vitaliy Ovsyannikov <V.Ovsyannikov kr.ru>


152847 27-Nov-2005 glebius

- Update the flow sequence before converting count to
network byte order.
- Update the flow sequence in one atomic op instead of two.

Reported by: Denis Shaposhnikov <dsh vlink.ru>
Reported by: Daniil Kharoun <kdl chelcom.ru>
PR: kern/89417


151897 31-Oct-2005 rwatson

Normalize a significant number of kernel malloc type names:

- Prefer '_' to ' ', as it results in more easily parsed results in
memory monitoring tools such as vmstat.

- Remove punctuation that is incompatible with using memory type names
as file names, such as '/' characters.

- Disambiguate some collisions by adding subsystem prefixes to some
memory types.

- Generally prefer lower case to upper case.

- If the same type is defined in multiple architecture directories,
attempt to use the same name in additional cases.

Not all instances were caught in this change, so more work is required to
finish this conversion. Similar changes are required for UMA zone names.


148091 17-Jul-2005 glebius

Check that we have first fragment before pulling up TCP/UDP header.


146285 16-May-2005 glebius

Catch up with new ng_package_data().


146139 12-May-2005 glebius

- Gather statistics about failed mbuf+cluster+ng_item allocations.
- Adjust comments and variables names in nfinfo.


146092 11-May-2005 glebius

A new version of NetFlow node.

The most significant changes are:
- Use UMA zone instead of own chunk of memory.
- Lock each hash entry separately.
- Expire items "actively" - interrupt method can expire flows
from hash slot, when it searches through it.
- Remove global tailqueue. Make callout thread search through
every hash slot.
- Export datagram is detached from private data and filled. If
it is incomplete, it is attached back. Another thread will
continue working with it.

Lesser, but also important speedups:
- Flows in hash slot are stored in tailqueue. Whenever a flow is
hit, it is moved to the begging, so it can be located quicker.
- When callout thread works with hash slot it bails out if
slot mutex is contested.


144901 11-Apr-2005 glebius

Remove goto.


143988 22-Mar-2005 glebius

Add a possibility to bypass unmodified accounted data to special
hook(s). Data received on these hook(s) is sent back to ifaceX hook(s).


143924 21-Mar-2005 glebius

Refactor node so that it does not modify mbuf contents. Next step would
be pass-thru mode, when traffic is not copied by ng_tee, but passed thru
ng_netflow.

Changes made:

- In ng_netflow_rcvdata() do all necessary pulluping: Ethernet header,
IP header, and TCP/UDP header.
- Pass only pointer to struct ip to ng_netflow_flow_add(). Any TCP/UDP
headers are guaranteed to by after it.
- Merge make_flow_rec() function into ng_netflow_flow_add().


143923 21-Mar-2005 glebius

Refactor node so that it does not modify mbuf contents. Next step would
be pass-thru mode, when traffic is not copied by ng_tee, but passed thru
ng_netflow.

Changes made:

- In ng_netflow_rcvdata() do all necessary pulluping: Ethernet header,
IP header, and TCP/UDP header.
- Pass only pointer to struct ip to ng_netflow_flow_add(). Any TCP/UDP
headers are guaranteed to by after it.
- Merge make_flow_rec() function into ng_netflow_flow_add().


143912 21-Mar-2005 glebius

Plug item leak, which occured when m_pullup() failed.


143890 20-Mar-2005 glebius

- Don't lose TCP flags of the first packet in a flow.
- Don't account length of the first packet in a flow twice.


143103 03-Mar-2005 glebius

Cisco uses milliseconds for uptime. This is stupid. Nobody cares of such
precision when IP packet may travel through internet for several seconds.
Also uptime measured in milliseconds overflows every 48+ days.
But we have to do same to keep compatibility with Cisco and flow-tools.

Make a macro MILLIUPTIME, which does overflowable multiplication to 1000.

Requested by: Sergey Ryabin, Oleg Bulyzhin
MFC after: 1 week


141348 05-Feb-2005 glebius

Expire aged flows in normal expiry thread. This fixes the problem, when
a node disconnected from all sources of traffic never purges its cache.


141343 05-Feb-2005 glebius

Break long lines in code and comments.


141112 01-Feb-2005 glebius

In case of various tunneling protocols, mbuf may pass several interfaces
before entering ng_netflow. In this case it will have not NULL m_pkthdr.rcvif.
However, it will enter ng_iface soon with another index. So let in_ifIndex
value configured by user override m_pkthdr.rcvif.

Reported by: Damir Bikmuhametov
MFC after: 1 week


140511 20-Jan-2005 glebius

Use log() instead of printf(), to reduce flood on console.

MFC after: 1 week


139374 28-Dec-2004 glebius

- Plug a memory leak in ng_netflow_cache_init().
- Initialize error to 0 in ng_netflow_flow_add() (a nop change).
- Update cache statistics holding workqueue mutex.

MFC after: 3 days


138392 05-Dec-2004 glebius

- Use uint16_t to pass argument for NGM_NETFLOW_IFINFO, bump cookie.
- Always check that index number passed from userland
is <= NG_NETFLOW_MAXIFACES. [1]
- Increase NG_NETFLOW_MAXIFACES up to 512. [2]

Noticed by: Roman Palagin [1]
Requested by: Yuri Y. Bushmelev [2]
MFC after: 1 week


137115 01-Nov-2004 glebius

Removed bogus comment.


135400 17-Sep-2004 glebius

- Remove advertising clause from copyright [1]
- Change my email to glebius@FreeBSD.org

Requested by: ru [1]


135332 16-Sep-2004 glebius

A netgraph node implementing Netflow version 5.

Supported by: Bestcom ISP, Rinet ISP
Approved by: julian (mentor)