2 * Copyright (c) 2009 Nicira Networks.
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.
17 #ifndef NETDEV_LINUX_H
18 #define NETDEV_LINUX_H 1
20 /* These functions are specific to the Linux implementation of dpif and netdev.
21 * They should only be used directly by Linux-specific code. */
25 struct rtnetlink_change {
26 /* Copied from struct nlmsghdr. */
27 int nlmsg_type; /* e.g. RTM_NEWLINK, RTM_DELLINK. */
29 /* Copied from struct ifinfomsg. */
30 int ifi_index; /* Index of network device. */
32 /* Extracted from Netlink attributes. */
33 const char *ifname; /* Name of network device. */
34 int master_ifindex; /* Ifindex of datapath master (0 if none). */
37 typedef void rtnetlink_notify_func(const struct rtnetlink_change *,
40 struct rtnetlink_notifier {
42 rtnetlink_notify_func *cb;
46 int rtnetlink_notifier_register(struct rtnetlink_notifier *,
47 rtnetlink_notify_func *, void *aux);
48 void rtnetlink_notifier_unregister(struct rtnetlink_notifier *);
49 void rtnetlink_notifier_run(void);
50 void rtnetlink_notifier_wait(void);
52 #endif /* netdev-linux.h */