Prepare Open vSwitch 1.1.2 release.
[sliver-openvswitch.git] / datapath / loop_counter.h
1 /*
2  * Copyright (c) 2010 Nicira Networks.
3  * Distributed under the terms of the GNU GPL version 2.
4  *
5  * Significant portions of this file may be copied from parts of the Linux
6  * kernel, by Linus Torvalds and others.
7  */
8
9 #ifndef LOOP_COUNTER_H
10 #define LOOP_COUNTER_H 1
11
12 #include "datapath.h"
13 #include "flow.h"
14
15 /* We limit the number of times that we pass into dp_process_received_packet()
16  * to avoid blowing out the stack in the event that we have a loop. */
17 #define MAX_LOOPS 5
18
19 struct loop_counter {
20         u8 count;               /* Count. */
21         bool looping;           /* Loop detected? */
22 };
23
24 struct loop_counter *loop_get_counter(void);
25 void loop_put_counter(void);
26 void loop_suppress(struct datapath *, struct sw_flow_actions *);
27
28 #endif /* loop_counter.h */