]> git.proxmox.com Git - ovs.git/blame - lib/rtnetlink-link.h
notifiers: Rename run and wait functions.
[ovs.git] / lib / rtnetlink-link.h
CommitLineData
21d6e22e
EJ
1/*
2 * Copyright (c) 2009 Nicira Networks.
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 RTNETLINK_LINK_H
18#define RTNETLINK_LINK_H 1
19
ea83a2fc
EJ
20#include <stdbool.h>
21
22struct ofpbuf;
0a811051 23struct nln_notifier;
21d6e22e
EJ
24
25/* These functions are Linux specific, so they should be used directly only by
26 * Linux-specific code. */
27
28/* A digested version of an rtnetlink_link message sent down by the kernel to
29 * indicate that a network device has been created, destroyed or changed. */
30struct rtnetlink_link_change {
31 /* Copied from struct nlmsghdr. */
32 int nlmsg_type; /* e.g. RTM_NEWLINK, RTM_DELLINK. */
33
34 /* Copied from struct ifinfomsg. */
35 int ifi_index; /* Index of network device. */
36
37 /* Extracted from Netlink attributes. */
38 const char *ifname; /* Name of network device. */
39 int master_ifindex; /* Ifindex of datapath master (0 if none). */
40};
41
42/* Function called to report that a netdev has changed. 'change' describes the
43 * specific change. It may be null if the buffer of change information
44 * overflowed, in which case the function must assume that every device may
45 * have changed. 'aux' is as specified in the call to
46 * rtnetlink_link_notifier_register(). */
47typedef
48void rtnetlink_link_notify_func(const struct rtnetlink_link_change *change,
49 void *aux);
50
ea83a2fc
EJ
51bool rtnetlink_link_parse(struct ofpbuf *buf,
52 struct rtnetlink_link_change *change);
0a811051 53int rtnetlink_link_notifier_register(struct nln_notifier*,
21d6e22e 54 rtnetlink_link_notify_func *, void *aux);
0a811051 55void rtnetlink_link_notifier_unregister(struct nln_notifier *);
18a23781
EJ
56void rtnetlink_link_run(void);
57void rtnetlink_link_wait(void);
21d6e22e 58#endif /* rtnetlink-link.h */