]> git.proxmox.com Git - mirror_ovs.git/blame - ofproto/netflow.h
cirrus: Use FreeBSD 12.2.
[mirror_ovs.git] / ofproto / netflow.h
CommitLineData
064af421 1/*
44dbb3e4 2 * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2014, 2015 Nicira, Inc.
064af421 3 *
a14bc59f
BP
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
064af421 7 *
a14bc59f
BP
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
064af421
BP
15 */
16
9c8e276e
BP
17#ifndef OFPROTO_NETFLOW_H
18#define OFPROTO_NETFLOW_H 1
064af421 19
54e05b5f 20#include <stdint.h>
064af421 21#include "flow.h"
81e2083f 22#include "sset.h"
064af421 23
137fea8d
BP
24/* Default active timeout interval, in seconds.
25 *
26 * (The active timeout interval is the interval at which NetFlow records are
27 * sent for flows that do not expire, so that such flows are still
28 * accounted.) */
29#define NF_ACTIVE_TIMEOUT_DEFAULT 600
e9e2856e 30
0193b2af 31struct netflow_options {
81e2083f 32 struct sset collectors;
0193b2af
JG
33 uint8_t engine_type;
34 uint8_t engine_id;
35 int active_timeout;
36 bool add_id_to_iface;
37};
064af421 38
4e022ec0
AW
39#define NF_OUT_FLOOD OFP_PORT_C(UINT16_MAX)
40#define NF_OUT_MULTI OFP_PORT_C(UINT16_MAX - 1)
41#define NF_OUT_DROP OFP_PORT_C(UINT16_MAX - 2)
6a07af36 42
064af421 43struct netflow *netflow_create(void);
8e407f27
EJ
44struct netflow *netflow_ref(const struct netflow *);
45void netflow_unref(struct netflow *);
936604c0 46bool netflow_exists(void);
8e407f27 47
0193b2af 48int netflow_set_options(struct netflow *, const struct netflow_options *);
6fca1ffb 49
8bfaca5b 50void netflow_run(struct netflow *);
6fca1ffb 51void netflow_wait(struct netflow *);
064af421 52
44dbb3e4 53void netflow_mask_wc(const struct flow *, struct flow_wildcards *);
1dd35f8a 54
44dbb3e4 55void netflow_flow_clear(struct netflow *, const struct flow *);
8bfaca5b 56
230f02bc 57void netflow_flow_update(struct netflow *nf, const struct flow *flow,
8bfaca5b
EJ
58 ofp_port_t output_iface,
59 const struct dpif_flow_stats *);
0193b2af 60
064af421 61#endif /* netflow.h */