FreeBSD kernel netgraph code
|
Go to the source code of this file.
Data Structures | |
struct | ng_netflow_info |
struct | ng_netflow_ifinfo |
struct | ng_netflow_setdlt |
struct | ng_netflow_setifindex |
struct | ng_netflow_settimeouts |
struct | ng_netflow_setconfig |
struct | ng_netflow_settemplate |
struct | ng_netflow_setmtu |
struct | ngnf_show_header |
struct | ng_netflow_v9info |
struct | flow_rec |
struct | flow6_rec |
struct | flow_entry_data |
struct | flow6_entry_data |
struct | flow_entry |
struct | flow6_entry |
struct | ng_netflow_iface |
struct | netflow_export_item |
struct | fib_export |
struct | netflow |
struct | flow_hash_entry |
Typedefs | |
typedef struct ng_netflow_iface * | iface_p |
typedef struct ng_netflow_ifinfo * | ifinfo_p |
typedef struct fib_export * | fib_export_p |
typedef struct netflow * | priv_p |
Enumerations | |
enum | { NGM_NETFLOW_INFO = 1|NGM_READONLY|NGM_HASREPLY , NGM_NETFLOW_IFINFO = 2|NGM_READONLY|NGM_HASREPLY , NGM_NETFLOW_SHOW = 3|NGM_READONLY|NGM_HASREPLY , NGM_NETFLOW_SETDLT = 4 , NGM_NETFLOW_SETIFINDEX = 5 , NGM_NETFLOW_SETTIMEOUTS = 6 , NGM_NETFLOW_SETCONFIG = 7 , NGM_NETFLOW_SETTEMPLATE = 8 , NGM_NETFLOW_SETMTU = 9 , NGM_NETFLOW_V9INFO = 10|NGM_READONLY|NGM_HASREPLY } |
Functions | |
void | ng_netflow_cache_init (priv_p) |
void | ng_netflow_cache_flush (priv_p) |
int | ng_netflow_fib_init (priv_p priv, int fib) |
void | ng_netflow_copyinfo (priv_p, struct ng_netflow_info *) |
void | ng_netflow_copyv9info (priv_p, struct ng_netflow_v9info *) |
int | ng_netflow_flow_add (priv_p, fib_export_p, struct ip *, caddr_t, uint8_t, uint8_t, unsigned int) |
int | ng_netflow_flow6_add (priv_p, fib_export_p, struct ip6_hdr *, caddr_t, uint8_t, uint8_t, unsigned int) |
int | ng_netflow_flow_show (priv_p, struct ngnf_show_header *req, struct ngnf_show_header *resp) |
void | ng_netflow_v9_cache_init (priv_p) |
void | ng_netflow_v9_cache_flush (priv_p) |
item_p | get_export9_dgram (priv_p, fib_export_p, struct netflow_v9_packet_opt **) |
void | return_export9_dgram (priv_p, fib_export_p, item_p, struct netflow_v9_packet_opt *, int) |
int | export9_add (item_p, struct netflow_v9_packet_opt *, struct flow_entry *) |
int | export9_send (priv_p, fib_export_p, item_p, struct netflow_v9_packet_opt *, int) |
Variables | |
callout_func_t | ng_netflow_expire |
#define CACHEHIGHWAT (CACHESIZE * 9/10) |
Definition at line 421 of file ng_netflow.h.
#define CACHELOWAT (CACHESIZE * 3/4) |
Definition at line 420 of file ng_netflow.h.
#define CACHESIZE (65536*16) |
Definition at line 419 of file ng_netflow.h.
#define ERROUT | ( | x | ) | { error = (x); goto done; } |
Definition at line 494 of file ng_netflow.h.
#define fle_i_ifx r.misc.i.i_ifx |
Definition at line 274 of file ng_netflow.h.
#define fle_i_ifx r.misc.i.i_ifx |
Definition at line 274 of file ng_netflow.h.
#define IP6VERSION 6 |
Definition at line 500 of file ng_netflow.h.
#define m_pktlen | ( | m | ) | ((m)->m_pkthdr.len) |
Definition at line 499 of file ng_netflow.h.
#define MAXDLTNAMELEN 20 |
Definition at line 118 of file ng_netflow.h.
#define MILLIUPTIME | ( | t | ) |
Definition at line 509 of file ng_netflow.h.
#define MTAG_NETFLOW 1221656444 |
Definition at line 496 of file ng_netflow.h.
#define MTAG_NETFLOW_CALLED 0 |
Definition at line 497 of file ng_netflow.h.
#define NETFLOW_V9_MAX_FLOWSETS 2 |
Definition at line 473 of file ng_netflow.h.
#define NG_NETFLOW_CONF_EGRESS 0x02 /* Account on egress */ |
Definition at line 142 of file ng_netflow.h.
#define NG_NETFLOW_CONF_INGRESS 0x01 /* Account on ingress */ |
Definition at line 141 of file ng_netflow.h.
#define NG_NETFLOW_CONF_NODSTLOOKUP 0x20 /* No radix lookup on dst */ |
Definition at line 146 of file ng_netflow.h.
#define NG_NETFLOW_CONF_NOSRCLOOKUP 0x10 /* No radix lookup on src */ |
Definition at line 145 of file ng_netflow.h.
#define NG_NETFLOW_CONF_ONCE 0x04 /* Add tag to account only once */ |
Definition at line 143 of file ng_netflow.h.
#define NG_NETFLOW_CONF_THISONCE 0x08 /* Account once in current node */ |
Definition at line 144 of file ng_netflow.h.
#define NG_NETFLOW_FLOW_FLAGS |
Definition at line 149 of file ng_netflow.h.
#define NG_NETFLOW_HOOK_DATA "iface" |
Definition at line 45 of file ng_netflow.h.
#define NG_NETFLOW_HOOK_EXPORT "export" |
Definition at line 47 of file ng_netflow.h.
#define NG_NETFLOW_HOOK_EXPORT9 "export9" |
Definition at line 48 of file ng_netflow.h.
#define NG_NETFLOW_HOOK_OUT "out" |
Definition at line 46 of file ng_netflow.h.
#define NG_NETFLOW_IFINFO_TYPE |
Definition at line 311 of file ng_netflow.h.
#define NG_NETFLOW_INFO_TYPE |
Definition at line 91 of file ng_netflow.h.
#define NG_NETFLOW_IS_FRAG 0x01 |
Definition at line 148 of file ng_netflow.h.
#define NG_NETFLOW_MAXIFACES USHRT_MAX |
Definition at line 41 of file ng_netflow.h.
#define NG_NETFLOW_NODE_TYPE "netflow" |
Definition at line 37 of file ng_netflow.h.
#define NG_NETFLOW_SETCONFIG_TYPE |
Definition at line 341 of file ng_netflow.h.
#define NG_NETFLOW_SETDLT_TYPE |
Definition at line 320 of file ng_netflow.h.
#define NG_NETFLOW_SETIFINDEX_TYPE |
Definition at line 327 of file ng_netflow.h.
#define NG_NETFLOW_SETMTU_TYPE |
Definition at line 355 of file ng_netflow.h.
#define NG_NETFLOW_SETTEMPLATE_TYPE |
Definition at line 348 of file ng_netflow.h.
#define NG_NETFLOW_SETTIMEOUTS_TYPE |
Definition at line 334 of file ng_netflow.h.
#define NG_NETFLOW_V9INFO_TYPE |
Definition at line 361 of file ng_netflow.h.
#define NGM_NETFLOW_COOKIE 1365756954 |
Definition at line 38 of file ng_netflow.h.
#define NGM_NETFLOW_V9_COOKIE 1349865386 |
Definition at line 39 of file ng_netflow.h.
#define NGRESP_SIZE |
Definition at line 291 of file ng_netflow.h.
#define NREC6_AT_ONCE |
Definition at line 289 of file ng_netflow.h.
#define NREC_AT_ONCE 1000 |
Definition at line 288 of file ng_netflow.h.
Definition at line 502 of file ng_netflow.h.
#define r_dport ports.dir.d_port |
Definition at line 248 of file ng_netflow.h.
#define r_i_ifx misc.i.i_ifx |
Definition at line 244 of file ng_netflow.h.
#define r_ip_p misc.i.prot |
Definition at line 242 of file ng_netflow.h.
#define r_misc misc.all |
Definition at line 245 of file ng_netflow.h.
#define r_ports ports.both |
Definition at line 246 of file ng_netflow.h.
#define r_sport ports.dir.s_port |
Definition at line 247 of file ng_netflow.h.
#define r_tos misc.i.tos |
Definition at line 243 of file ng_netflow.h.
#define SORCVBUF_SIZE (NGRESP_SIZE + 2 * sizeof(struct ng_mesg)) |
Definition at line 293 of file ng_netflow.h.
typedef struct fib_export* fib_export_p |
Definition at line 405 of file ng_netflow.h.
typedef struct ng_netflow_iface* iface_p |
Definition at line 375 of file ng_netflow.h.
typedef struct ng_netflow_ifinfo* ifinfo_p |
Definition at line 376 of file ng_netflow.h.
Definition at line 487 of file ng_netflow.h.
anonymous enum |
Definition at line 54 of file ng_netflow.h.
int export9_add | ( | item_p | item, |
struct netflow_v9_packet_opt * | t, | ||
struct flow_entry * | fle | ||
) |
Definition at line 241 of file netflow_v9.c.
References _NETFLOW_V9_MAX_SIZE, flow_entry_data::bytes, flow6_entry_data::bytes, close_flowset(), netflow_v9_packet_opt::count, netflow_v9_record_ipv4_tcp::d_port, netflow_v9_record_ipv6_tcp::d_port, flow6_rec::dst, netflow_v9_record_ipv4_tcp::dst_addr, netflow_v9_record_ipv6_tcp::dst_addr, netflow_v9_record_ipv4_tcp::dst_as, netflow_v9_record_ipv6_tcp::dst_as, netflow_v9_record_ipv4_tcp::dst_mask, netflow_v9_record_ipv6_tcp::dst_mask, flow_entry_data::dst_mask, flow6_entry_data::dst_mask, flow_entry::f, netflow_v9_record_ipv4_tcp::first, netflow_v9_record_ipv6_tcp::first, flow_entry_data::first, flow6_entry_data::first, netflow_v9_record_ipv4_tcp::flags, netflow_v9_record_ipv6_tcp::flags, flow_entry_data::fle_o_ifx, flow6_entry_data::fle_o_ifx, netflow_v9_packet_opt::flow_header, netflow_v9_packet_opt::flow_type, flow_rec::flow_type, netflow_v9_record_ipv4_tcp::i_ifx, netflow_v9_record_ipv6_tcp::i_ifx, netflow_v9_record_ipv4_tcp::i_octets, netflow_v9_record_ipv6_tcp::i_octets, netflow_v9_record_ipv4_tcp::i_packets, netflow_v9_record_ipv6_tcp::i_packets, netflow_v9_flowset_header::id, netflow_v9_record_ipv4_tcp::last, netflow_v9_record_ipv6_tcp::last, flow_entry_data::last, flow6_entry_data::last, netflow_v9_flowset_header::length, m_pktlen, MILLIUPTIME, netflow_v9_packet_opt::mtu, flow6_entry_data::n, NETFLOW_V9_FLOW_V4_L4, NETFLOW_V9_FLOW_V6_L4, NETFLOW_V9_MAX_RESERVED_FLOWSET, netflow_v9_record_ipv4_tcp::next_hop, netflow_v9_record_ipv6_tcp::next_hop, flow_entry_data::next_hop, flow6_entry_data::next_hop6, NGI_M, netflow_v9_record_ipv4_tcp::o_ifx, netflow_v9_record_ipv6_tcp::o_ifx, netflow_v9_record_ipv4_tcp::o_octets, netflow_v9_record_ipv6_tcp::o_octets, netflow_v9_record_ipv4_tcp::o_packets, netflow_v9_record_ipv6_tcp::o_packets, flow_entry_data::packets, flow6_entry_data::packets, netflow_v9_record_ipv4_tcp::prot, netflow_v9_record_ipv6_tcp::prot, flow_entry_data::r, flow6_entry_data::r, flow_rec::r_dst, flow6_rec::r_dst6, flow_rec::r_src, flow6_rec::r_src6, netflow_v9_record_general::rec, netflow_v9_record_ipv4_tcp::s_port, netflow_v9_record_ipv6_tcp::s_port, flow6_rec::src, netflow_v9_record_ipv4_tcp::src_addr, netflow_v9_record_ipv6_tcp::src_addr, netflow_v9_record_ipv4_tcp::src_as, netflow_v9_record_ipv6_tcp::src_as, netflow_v9_record_ipv4_tcp::src_mask, netflow_v9_record_ipv6_tcp::src_mask, flow_entry_data::src_mask, flow6_entry_data::src_mask, flow_entry_data::tcp_flags, flow6_entry_data::tcp_flags, netflow_v9_record_ipv4_tcp::tos, netflow_v9_record_ipv6_tcp::tos, netflow_v9_record_general::v4_tcp, and netflow_v9_record_general::v6_tcp.
Referenced by expire_flow().
int export9_send | ( | priv_p | priv, |
fib_export_p | fe, | ||
item_p | item, | ||
struct netflow_v9_packet_opt * | t, | ||
int | flags | ||
) |
Definition at line 201 of file netflow_v9.c.
References close_flowset(), netflow_v9_packet_opt::count, fib_export::domain_id, flags, fib_export::flow9_seq, netflow_v9_packet_opt::flow_header, header, netflow_v9_export_dgram::header, m_pktlen, MILLIUPTIME, NG_FREE_ITEM, NG_FWD_ITEM_HOOK_FLAGS, and NGI_M.
Referenced by expire_flow(), ng_netflow_cache_flush(), and return_export9_dgram().
item_p get_export9_dgram | ( | priv_p | priv, |
fib_export_p | fe, | ||
struct netflow_v9_packet_opt ** | tt | ||
) |
Definition at line 369 of file netflow_v9.c.
References netflow_v9_header::count, netflow_v9_packet_opt::count, fib_export::exp, fib_export::export9_mtx, netflow_v9_packet_opt::flow_header, netflow_v9_export_dgram::header, netflow_export_item::item9, netflow_export_item::item9_opt, netflow_v9_flowset_header::length, mtu, netflow_v9_packet_opt::mtu, NETFLOW_V9, NG_NOFLAGS, ng_package_data(), fib_export::sent_packets, fib_export::templ_last_pkt, fib_export::templ_last_ts, and netflow_v9_header::version.
Referenced by expire_flow().
void ng_netflow_cache_flush | ( | priv_p | priv | ) |
Definition at line 572 of file netflow.c.
References expire_flow(), export9_send(), export_send(), flow_entry::f, flow_rec::fib, flow_hash_entry::mtx, NBUCKETS, ng_netflow_v9_cache_flush(), NG_QUEUE, priv_to_fib, and flow_entry_data::r.
Referenced by ng_netflow_close().
void ng_netflow_cache_init | ( | priv_p | priv | ) |
Definition at line 478 of file netflow.c.
References CACHESIZE, flow_hash_entry::mtx, NBUCKETS, and ng_netflow_v9_cache_init().
Referenced by ng_netflow_constructor().
void ng_netflow_copyinfo | ( | priv_p | priv, |
struct ng_netflow_info * | i | ||
) |
Definition at line 283 of file netflow.c.
References ng_netflow_info::nfinfo_act_exp, ng_netflow_info::nfinfo_act_t, ng_netflow_info::nfinfo_alloc_failed, ng_netflow_info::nfinfo_alloc_fibs, ng_netflow_info::nfinfo_bytes, ng_netflow_info::nfinfo_bytes6, ng_netflow_info::nfinfo_export9_failed, ng_netflow_info::nfinfo_export_failed, ng_netflow_info::nfinfo_inact_exp, ng_netflow_info::nfinfo_inact_t, ng_netflow_info::nfinfo_packets, ng_netflow_info::nfinfo_packets6, ng_netflow_info::nfinfo_realloc_mbuf, ng_netflow_info::nfinfo_sbytes, ng_netflow_info::nfinfo_sbytes6, ng_netflow_info::nfinfo_spackets, ng_netflow_info::nfinfo_spackets6, ng_netflow_info::nfinfo_used, and ng_netflow_info::nfinfo_used6.
Referenced by ng_netflow_rcvmsg().
void ng_netflow_copyv9info | ( | priv_p | priv, |
struct ng_netflow_v9info * | i | ||
) |
Definition at line 484 of file netflow_v9.c.
References ng_netflow_v9info::mtu, ng_netflow_v9info::templ_packets, and ng_netflow_v9info::templ_time.
Referenced by ng_netflow_rcvmsg().
int ng_netflow_fib_init | ( | priv_p | priv, |
int | fib | ||
) |
Definition at line 534 of file netflow.c.
References fib_export::domain_id, fib_export::export9_mtx, fib_export::export_mtx, fib_export::fib, and priv_to_fib.
Referenced by ng_netflow_rcvdata().
int ng_netflow_flow6_add | ( | priv_p | , |
fib_export_p | , | ||
struct ip6_hdr * | , | ||
caddr_t | , | ||
uint8_t | , | ||
uint8_t | , | ||
unsigned int | |||
) |
int ng_netflow_flow_add | ( | priv_p | , |
fib_export_p | , | ||
struct ip * | , | ||
caddr_t | , | ||
uint8_t | , | ||
uint8_t | , | ||
unsigned int | |||
) |
int ng_netflow_flow_show | ( | priv_p | priv, |
struct ngnf_show_header * | req, | ||
struct ngnf_show_header * | resp | ||
) |
Definition at line 909 of file netflow.c.
References data, flow_entry::f, flow6_entry::f, ngnf_show_header::hash_id, ngnf_show_header::list_id, flow_hash_entry::mtx, NBUCKETS, ngnf_show_header::nentries, NREC6_AT_ONCE, NREC_AT_ONCE, and ngnf_show_header::version.
Referenced by ng_netflow_rcvmsg().
void ng_netflow_v9_cache_flush | ( | priv_p | priv | ) |
Definition at line 473 of file netflow_v9.c.
Referenced by ng_netflow_cache_flush().
void ng_netflow_v9_cache_init | ( | priv_p | priv | ) |
Definition at line 462 of file netflow_v9.c.
References BASE_MTU, generate_v9_templates(), NETFLOW_V9_MAX_PACKETS_TEMPL, and NETFLOW_V9_MAX_TIME_TEMPL.
Referenced by ng_netflow_cache_init().
void return_export9_dgram | ( | priv_p | priv, |
fib_export_p | fe, | ||
item_p | item, | ||
struct netflow_v9_packet_opt * | t, | ||
int | flags | ||
) |
Definition at line 442 of file netflow_v9.c.
References fib_export::exp, fib_export::export9_mtx, export9_send(), flags, netflow_export_item::item9, and netflow_export_item::item9_opt.
Referenced by expire_flow().
callout_func_t ng_netflow_expire |
Definition at line 522 of file ng_netflow.h.
Referenced by ng_netflow_newhook().