]>
git.proxmox.com Git - mirror_ovs.git/blob - lib/dummy.c
2 * Copyright (c) 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 /* Enables support for "dummy" network devices and dpifs, which are useful for
23 * testing. A client program might call this function if it is designed
24 * specifically for testing or the user enables it on the command line.
26 * 'arg' is parsed to determine the override level (see the definition of enum
29 * There is no strong reason why dummy devices shouldn't always be enabled. */
31 dummy_enable(const char *arg
)
33 enum dummy_level level
;
35 if (!arg
|| !arg
[0]) {
36 level
= DUMMY_OVERRIDE_NONE
;
37 } else if (!strcmp(arg
, "system")) {
38 level
= DUMMY_OVERRIDE_SYSTEM
;
39 } else if (!strcmp(arg
, "override")) {
40 level
= DUMMY_OVERRIDE_ALL
;
42 ovs_fatal(0, "%s: unknown dummy level", arg
);
45 netdev_dummy_register(level
);
46 dpif_dummy_register(level
);
47 timeval_dummy_register();
48 ofpact_dummy_enable();