]> git.proxmox.com Git - ovs.git/blame - lib/dpif-linux.h
Global replace of Nicira Networks.
[ovs.git] / lib / dpif-linux.h
CommitLineData
9fe3b9a2 1/*
e0edde6f 2 * Copyright (c) 2010, 2011 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
17#ifndef DPIF_LINUX_H
18#define DPIF_LINUX_H 1
19
20#include <stdbool.h>
9ea0bccc 21#include <stddef.h>
f0fef760 22#include <stdint.h>
077257b8 23#include <linux/openvswitch.h>
c19e6535
BP
24
25struct ofpbuf;
26
27struct dpif_linux_vport {
f0fef760
BP
28 /* Generic Netlink header. */
29 uint8_t cmd;
c19e6535 30
df2c07f4 31 /* ovs_vport header. */
254f2dc8 32 int dp_ifindex;
c19e6535 33 uint32_t port_no; /* UINT32_MAX if unknown. */
df2c07f4 34 enum ovs_vport_type type;
c19e6535 35
69ebca1e
BP
36 /* Attributes.
37 *
38 * The 'stats' member points to 64-bit data that might only be aligned on
39 * 32-bit boundaries, so use get_unaligned_u64() to access its values.
40 */
df2c07f4 41 const char *name; /* OVS_VPORT_ATTR_NAME. */
a24a6574 42 const uint32_t *upcall_pid; /* OVS_VPORT_ATTR_UPCALL_PID. */
f613a0d7 43 const struct ovs_vport_stats *stats; /* OVS_VPORT_ATTR_STATS. */
df2c07f4 44 const uint8_t *address; /* OVS_VPORT_ATTR_ADDRESS. */
df2c07f4 45 const struct nlattr *options; /* OVS_VPORT_ATTR_OPTIONS. */
c19e6535 46 size_t options_len;
c19e6535
BP
47};
48
49void dpif_linux_vport_init(struct dpif_linux_vport *);
50
51int dpif_linux_vport_transact(const struct dpif_linux_vport *request,
52 struct dpif_linux_vport *reply,
53 struct ofpbuf **bufp);
54int dpif_linux_vport_get(const char *name, struct dpif_linux_vport *reply,
55 struct ofpbuf **bufp);
9fe3b9a2
BP
56
57bool dpif_linux_is_internal_device(const char *name);
58
7feba1ac
BP
59int dpif_linux_vport_send(int dp_ifindex, uint32_t port_no,
60 const void *data, size_t size);
61
9fe3b9a2 62#endif /* dpif-linux.h */