/src/openvswitch/lib/netdev-vport-private.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2010, 2011, 2013, 2015 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 | | #ifndef NETDEV_VPORT_PRIVATE_H |
18 | | #define NETDEV_VPORT_PRAVITE_H 1 |
19 | | |
20 | | #include <stdbool.h> |
21 | | #include <stddef.h> |
22 | | #include "compiler.h" |
23 | | #include "netdev.h" |
24 | | #include "netdev-provider.h" |
25 | | #include "ovs-atomic.h" |
26 | | #include "ovs-thread.h" |
27 | | |
28 | | struct netdev_vport { |
29 | | struct netdev up; |
30 | | |
31 | | OVSRCU_TYPE(const struct netdev_tunnel_config *) tnl_cfg; |
32 | | |
33 | | /* Sequence number for outgoing GRE packets. */ |
34 | | atomic_count gre_seqno; |
35 | | |
36 | | /* Protects all members below. */ |
37 | | struct ovs_mutex mutex; |
38 | | |
39 | | struct eth_addr etheraddr; |
40 | | struct netdev_stats stats; |
41 | | |
42 | | /* Tunnels. */ |
43 | | char egress_iface[IFNAMSIZ]; |
44 | | bool carrier_status; |
45 | | |
46 | | /* Patch Ports. */ |
47 | | char *peer; |
48 | | }; |
49 | | |
50 | | int netdev_vport_construct(struct netdev *); |
51 | | |
52 | | static bool |
53 | | is_vport_class(const struct netdev_class *class) |
54 | 0 | { |
55 | 0 | return class->construct == netdev_vport_construct; |
56 | 0 | } Unexecuted instantiation: netdev-vport.c:is_vport_class Unexecuted instantiation: netdev-native-tnl.c:is_vport_class |
57 | | |
58 | | static inline struct netdev_vport * |
59 | | netdev_vport_cast(const struct netdev *netdev) |
60 | 0 | { |
61 | 0 | ovs_assert(is_vport_class(netdev_get_class(netdev))); |
62 | 0 | return CONTAINER_OF(netdev, struct netdev_vport, up); |
63 | 0 | } Unexecuted instantiation: netdev-vport.c:netdev_vport_cast Unexecuted instantiation: netdev-native-tnl.c:netdev_vport_cast |
64 | | |
65 | | #endif |