forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathofproto-dpif-trace.h
62 lines (52 loc) · 2.39 KB
/
ofproto-dpif-trace.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* Copyright (c) 2016, 2017 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. */
#ifndef OFPROTO_DPIF_TRACE_H
#define OFPROTO_DPIF_TRACE_H 1
/* Tracing
* =======
*
* The Open vSwitch software datapath based switch implementation supports
* "tracing". A trace describes what happens to a particular kind of packet as
* it passes through the switch, including information on each table, flow, and
* action that would apply to the packet. The trace is internally represented
* as a tree that reflects control flow; for example, an OpenFlow switch
* top-level node (of type OFT_BRIDGE) has a child node for each table visited
* by a packet (of type OFT_TABLE), and each table node has a child node for
* each action (OFT_ACTION) executed in the table.
*/
#include "openvswitch/compiler.h"
#include "openvswitch/list.h"
/* Type of a node within a trace. */
enum oftrace_node_type {
/* Nodes that may have children (nonterminal nodes). */
OFT_BRIDGE, /* Packet travel through an OpenFlow switch. */
OFT_TABLE, /* Packet travel through a flow table. */
OFT_THAW, /* Thawing a frozen state. */
/* Nodes that never have children (terminal nodes). */
OFT_ACTION, /* An action. */
OFT_DETAIL, /* Some detail of an action. */
OFT_WARN, /* A worrisome situation. */
OFT_ERROR, /* An erroneous situation, worth logging. */
};
/* A node within a trace. */
struct oftrace_node {
struct ovs_list node; /* In parent. */
struct ovs_list subs; /* List of "struct oftrace_node" children. */
enum oftrace_node_type type;
char *text;
};
void ofproto_dpif_trace_init(void);
struct oftrace_node *oftrace_report(struct ovs_list *, enum oftrace_node_type,
const char *text);
#endif /* ofproto-dpif-trace.h */