]> git.proxmox.com Git - mirror_ovs.git/blame - lib/dpif-netlink.h
netdev-offload-tc: Use single 'once' variable for probing tc features
[mirror_ovs.git] / lib / dpif-netlink.h
CommitLineData
9fe3b9a2 1/*
837eefc7 2 * Copyright (c) 2010, 2011, 2014 Nicira, Inc.
9fe3b9a2
BP
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
93451a0a
AS
17#ifndef DPIF_NETLINK_H
18#define DPIF_NETLINK_H 1
9fe3b9a2
BP
19
20#include <stdbool.h>
9ea0bccc 21#include <stddef.h>
f0fef760 22#include <stdint.h>
c19e6535 23
4e022ec0
AW
24#include "flow.h"
25
c19e6535
BP
26struct ofpbuf;
27
93451a0a 28struct dpif_netlink_vport {
f0fef760
BP
29 /* Generic Netlink header. */
30 uint8_t cmd;
c19e6535 31
df2c07f4 32 /* ovs_vport header. */
254f2dc8 33 int dp_ifindex;
bfda5239 34 int netnsid; /* Network Namespace ID. */
4e022ec0 35 odp_port_t port_no; /* ODPP_NONE if unknown. */
df2c07f4 36 enum ovs_vport_type type;
c19e6535 37
69ebca1e
BP
38 /* Attributes.
39 *
40 * The 'stats' member points to 64-bit data that might only be aligned on
41 * 32-bit boundaries, so use get_unaligned_u64() to access its values.
42 */
df2c07f4 43 const char *name; /* OVS_VPORT_ATTR_NAME. */
1579cf67
AW
44 uint32_t n_upcall_pids;
45 const uint32_t *upcall_pids; /* OVS_VPORT_ATTR_UPCALL_PID. */
f613a0d7 46 const struct ovs_vport_stats *stats; /* OVS_VPORT_ATTR_STATS. */
df2c07f4 47 const struct nlattr *options; /* OVS_VPORT_ATTR_OPTIONS. */
c19e6535 48 size_t options_len;
c19e6535
BP
49};
50
93451a0a 51void dpif_netlink_vport_init(struct dpif_netlink_vport *);
c19e6535 52
93451a0a
AS
53int dpif_netlink_vport_transact(const struct dpif_netlink_vport *request,
54 struct dpif_netlink_vport *reply,
55 struct ofpbuf **bufp);
56int dpif_netlink_vport_get(const char *name, struct dpif_netlink_vport *reply,
57 struct ofpbuf **bufp);
9fe3b9a2 58
93451a0a 59bool dpif_netlink_is_internal_device(const char *name);
9fe3b9a2 60
c4e08753
EG
61enum ovs_vport_type netdev_to_ovs_vport_type(const char *type);
62
93451a0a 63#endif /* dpif-netlink.h */