Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git] / lib / dummy.c
1 /*
2  * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc.
3  *
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:
7  *
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.
15  */
16
17 #include <config.h>
18
19 #include "dummy.h"
20
21 /* Enables support for "dummy" network devices and dpifs, which are useful for
22  * testing.  A client program might call this function if it is designed
23  * specifically for testing or the user enables it on the command line.
24  *
25  * If 'override' is false, then "dummy" dpif and netdev classes will be
26  * created.  If 'override' is true, then in addition all existing dpif and
27  * netdev classes will be deleted and replaced by dummy classes.
28  *
29  * There is no strong reason why dummy devices shouldn't always be enabled. */
30 void
31 dummy_enable(bool override)
32 {
33     netdev_dummy_register(override);
34     dpif_dummy_register(override);
35     timeval_dummy_register();
36     vlandev_dummy_enable();
37 }
38