FreeBSD kernel netgraph code
ng_netflow.h
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2010-2011 Alexander V. Chernikov <melifaro@ipfw.ru>
5 * Copyright (c) 2004-2005 Gleb Smirnoff <glebius@FreeBSD.org>
6 * Copyright (c) 2001-2003 Roman V. Palagin <romanp@unshadow.net>
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * $SourceForge: ng_netflow.h,v 1.26 2004/09/04 15:44:55 glebius Exp $
31 * $FreeBSD$
32 */
33
34#ifndef _NG_NETFLOW_H_
35#define _NG_NETFLOW_H_
36
37#define NG_NETFLOW_NODE_TYPE "netflow"
38#define NGM_NETFLOW_COOKIE 1365756954
39#define NGM_NETFLOW_V9_COOKIE 1349865386
40
41#define NG_NETFLOW_MAXIFACES USHRT_MAX
42
43/* Hook names */
44
45#define NG_NETFLOW_HOOK_DATA "iface"
46#define NG_NETFLOW_HOOK_OUT "out"
47#define NG_NETFLOW_HOOK_EXPORT "export"
48#define NG_NETFLOW_HOOK_EXPORT9 "export9"
49
50/* This define effectively disable (v5) netflow export hook! */
51/* #define COUNTERS_64 */
52
53/* Netgraph commands understood by netflow node */
54enum {
57 NGM_NETFLOW_SHOW = 3|NGM_READONLY|NGM_HASREPLY, /* show ip cache flow */
58 NGM_NETFLOW_SETDLT = 4, /* set data-link type */
59 NGM_NETFLOW_SETIFINDEX = 5, /* set interface index */
60 NGM_NETFLOW_SETTIMEOUTS = 6, /* set active/inactive flow timeouts */
61 NGM_NETFLOW_SETCONFIG = 7, /* set flow generation options */
62 NGM_NETFLOW_SETTEMPLATE = 8, /* set v9 flow template periodic */
63 NGM_NETFLOW_SETMTU = 9, /* set outgoing interface MTU */
65};
66
67/* This structure is returned by the NGM_NETFLOW_INFO message */
69 uint64_t nfinfo_bytes; /* accounted IPv4 bytes */
70 uint64_t nfinfo_packets; /* accounted IPv4 packets */
71 uint64_t nfinfo_bytes6; /* accounted IPv6 bytes */
72 uint64_t nfinfo_packets6; /* accounted IPv6 packets */
73 uint64_t nfinfo_sbytes; /* skipped IPv4 bytes */
74 uint64_t nfinfo_spackets; /* skipped IPv4 packets */
75 uint64_t nfinfo_sbytes6; /* skipped IPv6 bytes */
76 uint64_t nfinfo_spackets6; /* skipped IPv6 packets */
77 uint64_t nfinfo_act_exp; /* active expiries */
78 uint64_t nfinfo_inact_exp; /* inactive expiries */
79 uint32_t nfinfo_used; /* used cache records */
80 uint32_t nfinfo_used6; /* used IPv6 cache records */
81 uint32_t nfinfo_alloc_failed; /* failed allocations */
82 uint32_t nfinfo_export_failed; /* failed exports */
83 uint32_t nfinfo_export9_failed; /* failed exports */
84 uint32_t nfinfo_realloc_mbuf; /* reallocated mbufs */
85 uint32_t nfinfo_alloc_fibs; /* fibs allocated */
86 uint32_t nfinfo_inact_t; /* flow inactive timeout */
87 uint32_t nfinfo_act_t; /* flow active timeout */
88};
89
90/* Parse the info structure */
91#define NG_NETFLOW_INFO_TYPE { \
92 { "IPv4 bytes", &ng_parse_uint64_type },\
93 { "IPv4 packets", &ng_parse_uint64_type },\
94 { "IPv6 bytes", &ng_parse_uint64_type },\
95 { "IPv6 packets", &ng_parse_uint64_type },\
96 { "IPv4 skipped bytes", &ng_parse_uint64_type },\
97 { "IPv4 skipped packets", &ng_parse_uint64_type },\
98 { "IPv6 skipped bytes", &ng_parse_uint64_type },\
99 { "IPv6 skipped packets", &ng_parse_uint64_type },\
100 { "Active expiries", &ng_parse_uint64_type },\
101 { "Inactive expiries", &ng_parse_uint64_type },\
102 { "IPv4 records used", &ng_parse_uint32_type },\
103 { "IPv6 records used", &ng_parse_uint32_type },\
104 { "Failed allocations", &ng_parse_uint32_type },\
105 { "V5 failed exports", &ng_parse_uint32_type },\
106 { "V9 failed exports", &ng_parse_uint32_type },\
107 { "mbuf reallocations", &ng_parse_uint32_type },\
108 { "fibs allocated", &ng_parse_uint32_type },\
109 { "Inactive timeout", &ng_parse_uint32_type },\
110 { "Active timeout", &ng_parse_uint32_type },\
111 { NULL } \
112}
113
114/* This structure is returned by the NGM_NETFLOW_IFINFO message */
116 uint32_t ifinfo_packets; /* number of packets for this iface */
117 uint8_t ifinfo_dlt; /* Data Link Type, DLT_XXX */
118#define MAXDLTNAMELEN 20
119 uint16_t ifinfo_index; /* connected iface index */
120 uint32_t conf;
121};
122
123/* This structure is passed to NGM_NETFLOW_SETDLT message */
125 uint16_t iface; /* which iface dlt change */
126 uint8_t dlt; /* DLT_XXX from bpf.h */
127};
128
129/* This structure is passed to NGM_NETFLOW_SETIFINDEX */
131 uint16_t iface; /* which iface index change */
132 uint16_t index; /* new index */
133};
134
135/* This structure is passed to NGM_NETFLOW_SETTIMEOUTS */
137 uint32_t inactive_timeout; /* flow inactive timeout */
138 uint32_t active_timeout; /* flow active timeout */
139};
140
141#define NG_NETFLOW_CONF_INGRESS 0x01 /* Account on ingress */
142#define NG_NETFLOW_CONF_EGRESS 0x02 /* Account on egress */
143#define NG_NETFLOW_CONF_ONCE 0x04 /* Add tag to account only once */
144#define NG_NETFLOW_CONF_THISONCE 0x08 /* Account once in current node */
145#define NG_NETFLOW_CONF_NOSRCLOOKUP 0x10 /* No radix lookup on src */
146#define NG_NETFLOW_CONF_NODSTLOOKUP 0x20 /* No radix lookup on dst */
147
148#define NG_NETFLOW_IS_FRAG 0x01
149#define NG_NETFLOW_FLOW_FLAGS (NG_NETFLOW_CONF_NOSRCLOOKUP|\
150 NG_NETFLOW_CONF_NODSTLOOKUP)
151
152/* This structure is passed to NGM_NETFLOW_SETCONFIG */
154 uint16_t iface; /* which iface config change */
155 uint32_t conf; /* new config */
156};
157
158/* This structure is passed to NGM_NETFLOW_SETTEMPLATE */
160 uint16_t time; /* max time between announce */
161 uint16_t packets; /* max packets between announce */
162};
163
164/* This structure is passed to NGM_NETFLOW_SETMTU */
166 uint16_t mtu; /* MTU for packet */
167};
168
169/* This structure is used in NGM_NETFLOW_SHOW request/response */
171 u_char version; /* IPv4 or IPv6 */
172 uint32_t hash_id; /* current hash index */
173 uint32_t list_id; /* current record number in hash */
174 uint32_t nentries; /* number of records in response */
175};
176
177/* This structure is used in NGM_NETFLOW_V9INFO message */
179 uint16_t templ_packets; /* v9 template packets */
180 uint16_t templ_time; /* v9 template time */
181 uint16_t mtu; /* v9 MTU */
182};
183
184/* XXXGL
185 * Somewhere flow_rec6 is casted to flow_rec, and flow6_entry_data is
186 * casted to flow_entry_data. After casting, fle->r.fib is accessed.
187 * So beginning of these structs up to fib should be kept common.
188 */
189
190/* This is unique data, which identifies flow */
191struct flow_rec {
192 uint16_t flow_type;
193 uint16_t fib;
194 struct in_addr r_src;
195 struct in_addr r_dst;
196 union {
197 struct {
198 uint16_t s_port; /* source TCP/UDP port */
199 uint16_t d_port; /* destination TCP/UDP port */
201 uint32_t both;
203 union {
204 struct {
205 u_char prot; /* IP protocol */
206 u_char tos; /* IP TOS */
207 uint16_t i_ifx; /* input interface index */
208 } i;
209 uint32_t all;
211};
212
213/* This is unique data, which identifies flow */
214struct flow6_rec {
215 uint16_t flow_type;
216 uint16_t fib;
217 union {
218 struct in_addr r_src;
219 struct in6_addr r_src6;
221 union {
222 struct in_addr r_dst;
223 struct in6_addr r_dst6;
225 union {
226 struct {
227 uint16_t s_port; /* source TCP/UDP port */
228 uint16_t d_port; /* destination TCP/UDP port */
230 uint32_t both;
232 union {
233 struct {
234 u_char prot; /* IP protocol */
235 u_char tos; /* IP TOS */
236 uint16_t i_ifx; /* input interface index */
237 } i;
238 uint32_t all;
240};
241
242#define r_ip_p misc.i.prot
243#define r_tos misc.i.tos
244#define r_i_ifx misc.i.i_ifx
245#define r_misc misc.all
246#define r_ports ports.both
247#define r_sport ports.dir.s_port
248#define r_dport ports.dir.d_port
249
250/* A flow entry which accumulates statistics */
252 uint16_t version; /* Protocol version */
253 struct flow_rec r;
254 struct in_addr next_hop;
255 uint16_t fle_o_ifx; /* output interface index */
256#define fle_i_ifx r.misc.i.i_ifx
257 uint8_t dst_mask; /* destination route mask bits */
258 uint8_t src_mask; /* source route mask bits */
259 u_long packets;
260 u_long bytes;
261 long first; /* uptime on first packet */
262 long last; /* uptime on last packet */
263 u_char tcp_flags; /* cumulative OR */
264};
265
267 uint16_t version; /* Protocol version */
268 struct flow6_rec r;
269 union {
270 struct in_addr next_hop;
271 struct in6_addr next_hop6;
272 } n;
273 uint16_t fle_o_ifx; /* output interface index */
274#define fle_i_ifx r.misc.i.i_ifx
275 uint8_t dst_mask; /* destination route mask bits */
276 uint8_t src_mask; /* source route mask bits */
277 u_long packets;
278 u_long bytes;
279 long first; /* uptime on first packet */
280 long last; /* uptime on last packet */
281 u_char tcp_flags; /* cumulative OR */
282};
283
284/*
285 * How many flow records we will transfer at once
286 * without overflowing socket receive buffer
287 */
288#define NREC_AT_ONCE 1000
289#define NREC6_AT_ONCE (NREC_AT_ONCE * sizeof(struct flow_entry_data) / \
290 sizeof(struct flow6_entry_data))
291#define NGRESP_SIZE (sizeof(struct ngnf_show_header) + (NREC_AT_ONCE * \
292 sizeof(struct flow_entry_data)))
293#define SORCVBUF_SIZE (NGRESP_SIZE + 2 * sizeof(struct ng_mesg))
294
295/* Everything below is for kernel */
296
297#ifdef _KERNEL
298
300 TAILQ_ENTRY(flow_entry) fle_hash; /* entries in hash slot */
302};
303
305 TAILQ_ENTRY(flow_entry) fle_hash; /* entries in hash slot */
307};
308/* Parsing declarations */
309
310/* Parse the ifinfo structure */
311#define NG_NETFLOW_IFINFO_TYPE { \
312 { "packets", &ng_parse_uint32_type },\
313 { "data link type", &ng_parse_uint8_type }, \
314 { "index", &ng_parse_uint16_type },\
315 { "conf", &ng_parse_uint32_type },\
316 { NULL } \
317}
318
319/* Parse the setdlt structure */
320#define NG_NETFLOW_SETDLT_TYPE { \
321 { "iface", &ng_parse_uint16_type }, \
322 { "dlt", &ng_parse_uint8_type }, \
323 { NULL } \
324}
325
326/* Parse the setifindex structure */
327#define NG_NETFLOW_SETIFINDEX_TYPE { \
328 { "iface", &ng_parse_uint16_type }, \
329 { "index", &ng_parse_uint16_type }, \
330 { NULL } \
331}
332
333/* Parse the settimeouts structure */
334#define NG_NETFLOW_SETTIMEOUTS_TYPE { \
335 { "inactive", &ng_parse_uint32_type }, \
336 { "active", &ng_parse_uint32_type }, \
337 { NULL } \
338}
339
340/* Parse the setifindex structure */
341#define NG_NETFLOW_SETCONFIG_TYPE { \
342 { "iface", &ng_parse_uint16_type }, \
343 { "conf", &ng_parse_uint32_type }, \
344 { NULL } \
345}
346
347/* Parse the settemplate structure */
348#define NG_NETFLOW_SETTEMPLATE_TYPE { \
349 { "time", &ng_parse_uint16_type }, \
350 { "packets", &ng_parse_uint16_type }, \
351 { NULL } \
352}
353
354/* Parse the setmtu structure */
355#define NG_NETFLOW_SETMTU_TYPE { \
356 { "mtu", &ng_parse_uint16_type }, \
357 { NULL } \
358}
359
360/* Parse the v9info structure */
361#define NG_NETFLOW_V9INFO_TYPE { \
362 { "v9 template packets", &ng_parse_uint16_type },\
363 { "v9 template time", &ng_parse_uint16_type },\
364 { "v9 MTU", &ng_parse_uint16_type },\
365 { NULL } \
366}
367
368/* Private hook data */
370 hook_p hook; /* NULL when disconnected */
371 hook_p out; /* NULL when no bypass hook */
373};
374
375typedef struct ng_netflow_iface *iface_p;
377
382};
383
384/* Structure contatining fib-specific data */
386 uint32_t fib; /* kernel fib id */
387
388 /* Various data used for export */
390
391 struct mtx export_mtx; /* exp.item mutex */
392 struct mtx export9_mtx; /* exp.item9 mutex */
393 uint32_t flow_seq; /* current V5 flow sequence */
394 uint32_t flow9_seq; /* current V9 flow sequence */
395 uint32_t domain_id; /* Observartion domain id */
396 /* Netflow V9 counters */
397 uint32_t templ_last_ts; /* unixtime of last template announce */
398 uint32_t templ_last_pkt; /* packet count on last announce */
399 uint32_t sent_packets; /* packets sent by exporter; */
400
401 /* Current packet specific options */
403};
404
405typedef struct fib_export *fib_export_p;
406
407/* Structure describing our flow engine */
408struct netflow {
409 node_p node; /* link to the node itself */
410 hook_p export; /* export data goes there */
411 hook_p export9; /* Netflow V9 export data goes there */
412 struct callout exp_callout; /* expiry periodic job */
413
414 /*
415 * Flow entries are allocated in uma(9) zone zone. They are
416 * indexed by hash hash. Each hash element consist of tailqueue
417 * head and mutex to protect this element.
418 */
419#define CACHESIZE (65536*16)
420#define CACHELOWAT (CACHESIZE * 3/4)
421#define CACHEHIGHWAT (CACHESIZE * 9/10)
422 uma_zone_t zone;
424
425 /*
426 * NetFlow data export
427 *
428 * export_item is a data item, it has an mbuf with cluster
429 * attached to it. A thread detaches export_item from priv
430 * and works with it. If the export is full it is sent, and
431 * a new one is allocated. Before exiting thread re-attaches
432 * its current item back to priv. If there is item already,
433 * current incomplete datagram is sent.
434 * export_mtx is used for attaching/detaching.
435 */
436
437 /* IPv6 support */
438#ifdef INET6
439 uma_zone_t zone6;
440 struct flow_hash_entry *hash6;
441#endif
442
443 /* Statistics. */
444 counter_u64_t nfinfo_bytes; /* accounted IPv4 bytes */
445 counter_u64_t nfinfo_packets; /* accounted IPv4 packets */
446 counter_u64_t nfinfo_bytes6; /* accounted IPv6 bytes */
447 counter_u64_t nfinfo_packets6; /* accounted IPv6 packets */
448 counter_u64_t nfinfo_sbytes; /* skipped IPv4 bytes */
449 counter_u64_t nfinfo_spackets; /* skipped IPv4 packets */
450 counter_u64_t nfinfo_sbytes6; /* skipped IPv6 bytes */
451 counter_u64_t nfinfo_spackets6; /* skipped IPv6 packets */
452 counter_u64_t nfinfo_act_exp; /* active expiries */
453 counter_u64_t nfinfo_inact_exp; /* inactive expiries */
454 uint32_t nfinfo_alloc_failed; /* failed allocations */
455 uint32_t nfinfo_export_failed; /* failed exports */
456 uint32_t nfinfo_export9_failed; /* failed exports */
457 uint32_t nfinfo_realloc_mbuf; /* reallocated mbufs */
458 uint32_t nfinfo_alloc_fibs; /* fibs allocated */
459 uint32_t nfinfo_inact_t; /* flow inactive timeout */
460 uint32_t nfinfo_act_t; /* flow active timeout */
461
462 /* Multiple FIB support */
463 fib_export_p *fib_data; /* vector to per-fib data */
464 uint16_t maxfibs; /* number of allocated fibs */
465
466 /* Netflow v9 configuration options */
467 /*
468 * RFC 3954 clause 7.3
469 * "Both options MUST be configurable by the user on the Exporter."
470 */
471 uint16_t templ_time; /* time between sending templates */
472 uint16_t templ_packets; /* packets between sending templates */
473#define NETFLOW_V9_MAX_FLOWSETS 2
474 u_char flowsets_count; /* current flowsets used */
475
476 /* Count of records in each flowset */
478 uint16_t mtu; /* export interface MTU */
479
480 /* Pointers to pre-compiled flowsets */
483
485};
486
487typedef struct netflow *priv_p;
488
489/* Header of a small list in hash cell */
491 struct mtx mtx;
492 TAILQ_HEAD(fhead, flow_entry) head;
493};
494#define ERROUT(x) { error = (x); goto done; }
495
496#define MTAG_NETFLOW 1221656444
497#define MTAG_NETFLOW_CALLED 0
498
499#define m_pktlen(m) ((m)->m_pkthdr.len)
500#define IP6VERSION 6
501
502#define priv_to_fib(priv, fib) (priv)->fib_data[(fib)]
503
504/*
505 * Cisco uses milliseconds for uptime. Bad idea, since it overflows
506 * every 48+ days. But we will do same to keep compatibility. This macro
507 * does overflowable multiplication to 1000.
508 */
509#define MILLIUPTIME(t) (((t) << 9) + /* 512 */ \
510 ((t) << 8) + /* 256 */ \
511 ((t) << 7) + /* 128 */ \
512 ((t) << 6) + /* 64 */ \
513 ((t) << 5) + /* 32 */ \
514 ((t) << 3)) /* 8 */
515
516/* Prototypes for netflow.c */
519int ng_netflow_fib_init(priv_p priv, int fib);
522callout_func_t ng_netflow_expire;
523int ng_netflow_flow_add(priv_p, fib_export_p, struct ip *, caddr_t,
524 uint8_t, uint8_t, unsigned int);
525int ng_netflow_flow6_add(priv_p, fib_export_p, struct ip6_hdr *, caddr_t,
526 uint8_t, uint8_t, unsigned int);
528 struct ngnf_show_header *resp);
532 struct netflow_v9_packet_opt **);
534 struct netflow_v9_packet_opt *, int);
536 struct flow_entry *);
538 struct netflow_v9_packet_opt *, int);
539
540#endif /* _KERNEL */
541#endif /* _NG_NETFLOW_H_ */
#define NGM_HASREPLY
Definition: ng_message.h:75
#define NGM_READONLY
Definition: ng_message.h:73
struct netflow * priv_p
Definition: ng_netflow.h:487
void ng_netflow_cache_flush(priv_p)
Definition: netflow.c:572
int ng_netflow_fib_init(priv_p priv, int fib)
Definition: netflow.c:534
callout_func_t ng_netflow_expire
Definition: ng_netflow.h:522
struct ng_netflow_iface * iface_p
Definition: ng_netflow.h:375
#define NETFLOW_V9_MAX_FLOWSETS
Definition: ng_netflow.h:473
void ng_netflow_copyinfo(priv_p, struct ng_netflow_info *)
Definition: netflow.c:283
void ng_netflow_v9_cache_init(priv_p)
Definition: netflow_v9.c:462
struct ng_netflow_ifinfo * ifinfo_p
Definition: ng_netflow.h:376
int ng_netflow_flow_show(priv_p, struct ngnf_show_header *req, struct ngnf_show_header *resp)
Definition: netflow.c:909
struct fib_export * fib_export_p
Definition: ng_netflow.h:405
item_p get_export9_dgram(priv_p, fib_export_p, struct netflow_v9_packet_opt **)
Definition: netflow_v9.c:369
int ng_netflow_flow6_add(priv_p, fib_export_p, struct ip6_hdr *, caddr_t, uint8_t, uint8_t, unsigned int)
void ng_netflow_cache_init(priv_p)
Definition: netflow.c:478
int export9_send(priv_p, fib_export_p, item_p, struct netflow_v9_packet_opt *, int)
Definition: netflow_v9.c:201
@ NGM_NETFLOW_V9INFO
Definition: ng_netflow.h:64
@ NGM_NETFLOW_IFINFO
Definition: ng_netflow.h:56
@ NGM_NETFLOW_SETDLT
Definition: ng_netflow.h:58
@ NGM_NETFLOW_SETCONFIG
Definition: ng_netflow.h:61
@ NGM_NETFLOW_INFO
Definition: ng_netflow.h:55
@ NGM_NETFLOW_SETTIMEOUTS
Definition: ng_netflow.h:60
@ NGM_NETFLOW_SETTEMPLATE
Definition: ng_netflow.h:62
@ NGM_NETFLOW_SHOW
Definition: ng_netflow.h:57
@ NGM_NETFLOW_SETMTU
Definition: ng_netflow.h:63
@ NGM_NETFLOW_SETIFINDEX
Definition: ng_netflow.h:59
int ng_netflow_flow_add(priv_p, fib_export_p, struct ip *, caddr_t, uint8_t, uint8_t, unsigned int)
void return_export9_dgram(priv_p, fib_export_p, item_p, struct netflow_v9_packet_opt *, int)
Definition: netflow_v9.c:442
int export9_add(item_p, struct netflow_v9_packet_opt *, struct flow_entry *)
Definition: netflow_v9.c:241
void ng_netflow_v9_cache_flush(priv_p)
Definition: netflow_v9.c:473
void ng_netflow_copyv9info(priv_p, struct ng_netflow_v9info *)
Definition: netflow_v9.c:484
#define NG_NETFLOW_MAXIFACES
Definition: ng_netflow.h:41
struct mtx export9_mtx
Definition: ng_netflow.h:392
struct netflow_export_item exp
Definition: ng_netflow.h:389
uint32_t flow_seq
Definition: ng_netflow.h:393
uint32_t flow9_seq
Definition: ng_netflow.h:394
uint32_t sent_packets
Definition: ng_netflow.h:399
uint32_t templ_last_pkt
Definition: ng_netflow.h:398
uint32_t templ_last_ts
Definition: ng_netflow.h:397
uint32_t fib
Definition: ng_netflow.h:386
struct mtx export_mtx
Definition: ng_netflow.h:391
uint32_t domain_id
Definition: ng_netflow.h:395
struct netflow_v9_packet_opt * export9_opt
Definition: ng_netflow.h:402
Definition: ng_netflow.h:266
struct flow6_rec r
Definition: ng_netflow.h:268
uint8_t src_mask
Definition: ng_netflow.h:276
uint8_t dst_mask
Definition: ng_netflow.h:275
struct in6_addr next_hop6
Definition: ng_netflow.h:271
uint16_t fle_o_ifx
Definition: ng_netflow.h:273
union flow6_entry_data::@22 n
long first
Definition: ng_netflow.h:279
u_long packets
Definition: ng_netflow.h:277
struct in_addr next_hop
Definition: ng_netflow.h:270
u_long bytes
Definition: ng_netflow.h:278
u_char tcp_flags
Definition: ng_netflow.h:281
long last
Definition: ng_netflow.h:280
uint16_t version
Definition: ng_netflow.h:267
Definition: ng_netflow.h:304
struct flow6_entry_data f
Definition: ng_netflow.h:306
TAILQ_ENTRY(flow_entry) fle_hash
union flow6_rec::@19 misc
struct in_addr r_dst
Definition: ng_netflow.h:222
struct in6_addr r_dst6
Definition: ng_netflow.h:223
uint16_t s_port
Definition: ng_netflow.h:227
struct in_addr r_src
Definition: ng_netflow.h:218
struct in6_addr r_src6
Definition: ng_netflow.h:219
union flow6_rec::@16 src
uint16_t d_port
Definition: ng_netflow.h:228
struct flow6_rec::@19::@21 i
struct flow6_rec::@18::@20 dir
uint32_t all
Definition: ng_netflow.h:238
uint32_t both
Definition: ng_netflow.h:230
u_char prot
Definition: ng_netflow.h:234
u_char tos
Definition: ng_netflow.h:235
union flow6_rec::@18 ports
uint16_t flow_type
Definition: ng_netflow.h:215
union flow6_rec::@17 dst
uint16_t i_ifx
Definition: ng_netflow.h:236
uint16_t fib
Definition: ng_netflow.h:216
Definition: ng_netflow.h:251
u_char tcp_flags
Definition: ng_netflow.h:263
long last
Definition: ng_netflow.h:262
u_long bytes
Definition: ng_netflow.h:260
struct flow_rec r
Definition: ng_netflow.h:253
u_long packets
Definition: ng_netflow.h:259
uint16_t version
Definition: ng_netflow.h:252
struct in_addr next_hop
Definition: ng_netflow.h:254
uint16_t fle_o_ifx
Definition: ng_netflow.h:255
long first
Definition: ng_netflow.h:261
uint8_t dst_mask
Definition: ng_netflow.h:257
uint8_t src_mask
Definition: ng_netflow.h:258
Definition: ng_netflow.h:299
TAILQ_ENTRY(flow_entry) fle_hash
struct flow_entry_data f
Definition: ng_netflow.h:301
Definition: ng_netflow.h:490
TAILQ_HEAD(fhead, flow_entry) head
struct mtx mtx
Definition: ng_netflow.h:491
uint16_t s_port
Definition: ng_netflow.h:198
struct in_addr r_dst
Definition: ng_netflow.h:195
uint32_t both
Definition: ng_netflow.h:201
union flow_rec::@12 ports
uint16_t d_port
Definition: ng_netflow.h:199
u_char tos
Definition: ng_netflow.h:206
union flow_rec::@13 misc
uint32_t all
Definition: ng_netflow.h:209
struct flow_rec::@12::@14 dir
struct flow_rec::@13::@15 i
uint16_t fib
Definition: ng_netflow.h:193
uint16_t i_ifx
Definition: ng_netflow.h:207
uint16_t flow_type
Definition: ng_netflow.h:192
struct in_addr r_src
Definition: ng_netflow.h:194
u_char prot
Definition: ng_netflow.h:205
struct netflow_v9_packet_opt * item9_opt
Definition: ng_netflow.h:381
uint32_t nfinfo_export_failed
Definition: ng_netflow.h:455
uma_zone_t zone
Definition: ng_netflow.h:422
hook_p export
Definition: ng_netflow.h:410
counter_u64_t nfinfo_bytes6
Definition: ng_netflow.h:446
counter_u64_t nfinfo_packets6
Definition: ng_netflow.h:447
struct netflow_v9_flowset_header * v9_flowsets[NETFLOW_V9_MAX_FLOWSETS - 1]
Definition: ng_netflow.h:481
hook_p export9
Definition: ng_netflow.h:411
u_char flowsets_count
Definition: ng_netflow.h:474
counter_u64_t nfinfo_spackets6
Definition: ng_netflow.h:451
struct callout exp_callout
Definition: ng_netflow.h:412
uint32_t nfinfo_realloc_mbuf
Definition: ng_netflow.h:457
uint32_t nfinfo_alloc_failed
Definition: ng_netflow.h:454
uint16_t templ_packets
Definition: ng_netflow.h:472
uint32_t nfinfo_alloc_fibs
Definition: ng_netflow.h:458
uint16_t templ_time
Definition: ng_netflow.h:471
uint16_t mtu
Definition: ng_netflow.h:478
uint16_t maxfibs
Definition: ng_netflow.h:464
struct flow_hash_entry * hash
Definition: ng_netflow.h:423
counter_u64_t nfinfo_act_exp
Definition: ng_netflow.h:452
uint32_t nfinfo_export9_failed
Definition: ng_netflow.h:456
uint32_t nfinfo_inact_t
Definition: ng_netflow.h:459
struct ng_netflow_iface ifaces[NG_NETFLOW_MAXIFACES]
Definition: ng_netflow.h:484
counter_u64_t nfinfo_packets
Definition: ng_netflow.h:445
counter_u64_t nfinfo_inact_exp
Definition: ng_netflow.h:453
fib_export_p * fib_data
Definition: ng_netflow.h:463
counter_u64_t nfinfo_sbytes6
Definition: ng_netflow.h:450
uint32_t nfinfo_act_t
Definition: ng_netflow.h:460
node_p node
Definition: ng_netflow.h:409
counter_u64_t nfinfo_bytes
Definition: ng_netflow.h:444
counter_u64_t nfinfo_spackets
Definition: ng_netflow.h:449
u_char flowset_records[NETFLOW_V9_MAX_FLOWSETS - 1]
Definition: ng_netflow.h:477
counter_u64_t nfinfo_sbytes
Definition: ng_netflow.h:448
struct ng_netflow_ifinfo info
Definition: ng_netflow.h:372
uint8_t ifinfo_dlt
Definition: ng_netflow.h:117
uint32_t ifinfo_packets
Definition: ng_netflow.h:116
uint16_t ifinfo_index
Definition: ng_netflow.h:119
uint32_t nfinfo_used
Definition: ng_netflow.h:79
uint64_t nfinfo_sbytes6
Definition: ng_netflow.h:75
uint64_t nfinfo_packets
Definition: ng_netflow.h:70
uint64_t nfinfo_inact_exp
Definition: ng_netflow.h:78
uint64_t nfinfo_sbytes
Definition: ng_netflow.h:73
uint32_t nfinfo_export_failed
Definition: ng_netflow.h:82
uint64_t nfinfo_act_exp
Definition: ng_netflow.h:77
uint32_t nfinfo_used6
Definition: ng_netflow.h:80
uint64_t nfinfo_bytes
Definition: ng_netflow.h:69
uint32_t nfinfo_realloc_mbuf
Definition: ng_netflow.h:84
uint32_t nfinfo_export9_failed
Definition: ng_netflow.h:83
uint32_t nfinfo_alloc_failed
Definition: ng_netflow.h:81
uint32_t nfinfo_act_t
Definition: ng_netflow.h:87
uint64_t nfinfo_spackets6
Definition: ng_netflow.h:76
uint64_t nfinfo_spackets
Definition: ng_netflow.h:74
uint64_t nfinfo_bytes6
Definition: ng_netflow.h:71
uint32_t nfinfo_inact_t
Definition: ng_netflow.h:86
uint64_t nfinfo_packets6
Definition: ng_netflow.h:72
uint32_t nfinfo_alloc_fibs
Definition: ng_netflow.h:85
uint16_t templ_time
Definition: ng_netflow.h:180
uint16_t templ_packets
Definition: ng_netflow.h:179
uint32_t hash_id
Definition: ng_netflow.h:172
uint32_t list_id
Definition: ng_netflow.h:173
uint32_t nentries
Definition: ng_netflow.h:174
Definition: ng_sscfu.c:66