diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2020-09-01 21:19:14 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2020-09-01 21:19:14 +0000 |
commit | 662c13053f4bf2d6245ba7e2b66c10d1cd5c1fb9 (patch) | |
tree | 5cffe4473640975abc443ef4b8047b34cdb4a039 /sys/netgraph/netflow | |
parent | 586ee69f09c5060621486b34722a4a806581f93d (diff) | |
download | src-662c13053f4bf2d6245ba7e2b66c10d1cd5c1fb9.tar.gz src-662c13053f4bf2d6245ba7e2b66c10d1cd5c1fb9.zip |
net: clean up empty lines in .c and .h files
Notes
Notes:
svn path=/head/; revision=365071
Diffstat (limited to 'sys/netgraph/netflow')
-rw-r--r-- | sys/netgraph/netflow/netflow.c | 6 | ||||
-rw-r--r-- | sys/netgraph/netflow/netflow.h | 1 | ||||
-rw-r--r-- | sys/netgraph/netflow/netflow_v9.c | 9 | ||||
-rw-r--r-- | sys/netgraph/netflow/ng_netflow.c | 13 | ||||
-rw-r--r-- | sys/netgraph/netflow/ng_netflow.h | 5 |
5 files changed, 10 insertions, 24 deletions
diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c index 34991784f74d..8e1bcddd6895 100644 --- a/sys/netgraph/netflow/netflow.c +++ b/sys/netgraph/netflow/netflow.c @@ -503,7 +503,6 @@ hash6_insert(priv_p priv, struct flow_hash_entry *hsh6, struct flow6_rec *r, } #endif - /* * Non-static functions called from ng_netflow.c */ @@ -598,7 +597,7 @@ ng_netflow_fib_init(priv_p priv, int fib) fib, fe, priv_to_fib(priv, fib)); priv->nfinfo_alloc_fibs++; } - + return (0); } @@ -864,7 +863,7 @@ ng_netflow_flow6_add(priv_p priv, fib_export_p fe, struct ip6_hdr *ip6, r.r_ip_p = upper_proto; r.r_i_ifx = src_if_index; - + counter_u64_add(priv->nfinfo_packets6, 1); counter_u64_add(priv->nfinfo_bytes6, plen); @@ -1078,7 +1077,6 @@ export_send(priv_p priv, fib_export_p fe, item_p item, int flags) return (error); } - /* Add export record to dgram. */ static int export_add(item_p item, struct flow_entry *fle) diff --git a/sys/netgraph/netflow/netflow.h b/sys/netgraph/netflow/netflow.h index d6e061a7ff14..894692bd4f90 100644 --- a/sys/netgraph/netflow/netflow.h +++ b/sys/netgraph/netflow/netflow.h @@ -145,7 +145,6 @@ struct netflow_v5_export_dgram { struct netflow_v5_record r[NETFLOW_V5_MAX_RECORDS]; } __attribute__((__packed__)); - /* RFC3954 field definitions */ #define NETFLOW_V9_FIELD_IN_BYTES 1 /* Input bytes count for a flow. Default 4, can be 8 */ #define NETFLOW_V9_FIELD_IN_PKTS 2 /* Incoming counter with number of packets associated with an IP Flow. Default 4 */ diff --git a/sys/netgraph/netflow/netflow_v9.c b/sys/netgraph/netflow/netflow_v9.c index e4f9c5faa534..798bf6fecc42 100644 --- a/sys/netgraph/netflow/netflow_v9.c +++ b/sys/netgraph/netflow/netflow_v9.c @@ -236,8 +236,6 @@ export9_send(priv_p priv, fib_export_p fe, item_p item, struct netflow_v9_packet return (error); } - - /* Add V9 record to dgram. */ int export9_add(item_p item, struct netflow_v9_packet_opt *t, struct flow_entry *fle) @@ -413,16 +411,15 @@ get_export9_dgram(priv_p priv, fib_export_p fe, struct netflow_v9_packet_opt **t t->count = 0; t->mtu = mtu; t->flow_header = m->m_len; - + /* * Check if we need to insert templates into packet */ struct netflow_v9_flowset_header *fl; - + if ((time_uptime >= priv->templ_time + fe->templ_last_ts) || (fe->sent_packets >= priv->templ_packets + fe->templ_last_pkt)) { - fe->templ_last_ts = time_uptime; fe->templ_last_pkt = fe->sent_packets; @@ -431,7 +428,6 @@ get_export9_dgram(priv_p priv, fib_export_p fe, struct netflow_v9_packet_opt **t t->flow_header = m->m_len; t->count += priv->flowset_records[0]; } - } *tt = t; @@ -492,4 +488,3 @@ ng_netflow_copyv9info(priv_p priv, struct ng_netflow_v9info *i) i->templ_packets = priv->templ_packets; i->mtu = priv->mtu; } - diff --git a/sys/netgraph/netflow/ng_netflow.c b/sys/netgraph/netflow/ng_netflow.c index ab09e3000d0e..6180fe573b60 100644 --- a/sys/netgraph/netflow/ng_netflow.c +++ b/sys/netgraph/netflow/ng_netflow.c @@ -220,7 +220,6 @@ static const struct ng_cmdlist ng_netflow_cmds[] = { { 0 } }; - /* Netgraph node type descriptor */ static struct ng_type ng_netflow_typestruct = { .version = NG_ABI_VERSION, @@ -340,7 +339,6 @@ ng_netflow_newhook(node_p node, hook_p hook, const char *name) iface->out = hook; } else if (strcmp(name, NG_NETFLOW_HOOK_EXPORT) == 0) { - if (priv->export != NULL) return (EISCONN); @@ -354,7 +352,6 @@ ng_netflow_newhook(node_p node, hook_p hook, const char *name) callout_reset(&priv->exp_callout, (1*hz), &ng_netflow_expire, (void *)priv); } else if (strcmp(name, NG_NETFLOW_HOOK_EXPORT9) == 0) { - if (priv->export9 != NULL) return (EISCONN); @@ -500,7 +497,7 @@ ng_netflow_rcvmsg (node_p node, item_p item, hook_p lasthook) ERROUT(EINVAL); priv->ifaces[set->iface].info.conf = set->conf; - + break; } case NGM_NETFLOW_SETTEMPLATE: @@ -638,7 +635,7 @@ ng_netflow_rcvdata (hook_p hook, item_p item) MTAG_NETFLOW_CALLED, mtag); } } - + if (bypass) { if (out == NULL) ERROUT(ENOTCONN); @@ -646,7 +643,7 @@ ng_netflow_rcvdata (hook_p hook, item_p item) NG_FWD_ITEM_HOOK(error, item, out); return (error); } - + if (iface->info.conf & (NG_NETFLOW_CONF_ONCE | NG_NETFLOW_CONF_THISONCE)) { mtag = m_tag_alloc(MTAG_NETFLOW, MTAG_NETFLOW_CALLED, @@ -918,7 +915,7 @@ loopend: src_if_index = m->m_pkthdr.rcvif->if_index; } else src_if_index = iface->info.ifinfo_index; - + /* Check packet FIB */ fib = M_GETFIB(m); if (fib >= priv->maxfibs) { @@ -948,7 +945,7 @@ loopend: #endif else goto bypass; - + acct = 1; bypass: if (out != NULL) { diff --git a/sys/netgraph/netflow/ng_netflow.h b/sys/netgraph/netflow/ng_netflow.h index 836b13b14a06..5086cff1c401 100644 --- a/sys/netgraph/netflow/ng_netflow.h +++ b/sys/netgraph/netflow/ng_netflow.h @@ -111,7 +111,6 @@ struct ng_netflow_info { { NULL } \ } - /* This structure is returned by the NGM_NETFLOW_IFINFO message */ struct ng_netflow_ifinfo { uint32_t ifinfo_packets; /* number of packets for this iface */ @@ -121,7 +120,6 @@ struct ng_netflow_ifinfo { uint32_t conf; }; - /* This structure is passed to NGM_NETFLOW_SETDLT message */ struct ng_netflow_setdlt { uint16_t iface; /* which iface dlt change */ @@ -248,7 +246,7 @@ struct flow6_rec { #define r_ports ports.both #define r_sport ports.dir.s_port #define r_dport ports.dir.d_port - + /* A flow entry which accumulates statistics */ struct flow_entry_data { uint16_t version; /* Protocol version */ @@ -493,7 +491,6 @@ struct flow_hash_entry { struct mtx mtx; TAILQ_HEAD(fhead, flow_entry) head; }; - #define ERROUT(x) { error = (x); goto done; } #define MTAG_NETFLOW 1221656444 |