X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetlink-protocol.h;h=6281fb2c3af2678ec86587a55d71ecad60efbc78;hb=5397a37788602c329b98de45a1dfdf899c7ea3b9;hp=92694e8b340885399add2154f4e336e93d774f6a;hpb=064af42167bf4fc9aaea2702d80ce08074b889c0;p=openvswitch diff --git a/lib/netlink-protocol.h b/lib/netlink-protocol.h index 92694e8b..6281fb2c 100644 --- a/lib/netlink-protocol.h +++ b/lib/netlink-protocol.h @@ -1,17 +1,17 @@ /* - * Copyright (c) 2008 Nicira Networks. + * Copyright (c) 2008, 2010 Nicira Networks. * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef NETLINK_PROTOCOL_H @@ -19,13 +19,24 @@ /* Netlink protocol definitions. * - * These definitions are equivalent to those in the Linux 2.6 kernel headers, - * without requiring those headers to be available. */ + * Netlink is a message framing format described in RFC 3549 and used heavily + * in Linux to access the network stack. Open vSwitch uses AF_NETLINK sockets + * for this purpose on Linux. But on all platforms, Open vSwitch uses Netlink + * message framing internally for certain purposes. + * + * This header provides access to the Netlink message framing definitions + * regardless of platform. On Linux, it includes the proper headers directly; + * on other platforms it directly defines the structures and macros itself. + */ #include #include #include "util.h" +#ifdef HAVE_NETLINK +#include +#include +#else #define NETLINK_GENERIC 16 struct sockaddr_nl { @@ -137,5 +148,13 @@ enum { }; #define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1) +#endif /* !HAVE_NETLINK */ + +/* These were introduced all together in 2.6.24. */ +#ifndef NLA_TYPE_MASK +#define NLA_F_NESTED (1 << 15) +#define NLA_F_NET_BYTEORDER (1 << 14) +#define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER) +#endif #endif /* netlink-protocol.h */