]> git.proxmox.com Git - mirror_ovs.git/blame - lib/rtbsd.h
ovsdb-idl: Fix iteration over tracked rows with no actual data.
[mirror_ovs.git] / lib / rtbsd.h
CommitLineData
f6eb6b20
GL
1/*
2 * Copyright (c) 2011 Gaetano Catalli.
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 RTBSD_H
18#define RTBSD_H 1
19
75f697bd 20#include <net/if.h>
b19bab5b 21#include "openvswitch/list.h"
f6eb6b20
GL
22
23/*
24 * A digested version of a message received from a PF_ROUTE socket which
25 * indicates that a network device has been created or destroyed or changed.
26 */
27struct rtbsd_change {
28 /* Copied from struct if_msghdr. */
29 int msg_type; /* e.g. XXX. */
30
31 /* Copied from struct if_msghdr. */
32 int if_index; /* Index of network device. */
33
34 char if_name[IF_NAMESIZE]; /* Name of network device. */
35 int master_ifindex; /* Ifindex of datapath master (0 if none). */
36};
37
38/*
39 * Function called to report that a netdev has changed. 'change' describes the
40 * specific change. It may be null if the buffer of change information
41 * overflowed, in which case the function must assume that every device may
42 * have changed. 'aux' is as specified in the call to
43 * rtbsd_notifier_register().
44 */
45typedef void rtbsd_notify_func(const struct rtbsd_change *, void *aux);
46
47struct rtbsd_notifier {
ca6ba700 48 struct ovs_list node;
f6eb6b20
GL
49 rtbsd_notify_func *cb;
50 void *aux;
51};
52
53int rtbsd_notifier_register(struct rtbsd_notifier *,
54 rtbsd_notify_func *, void *aux);
55void rtbsd_notifier_unregister(struct rtbsd_notifier *);
56void rtbsd_notifier_run(void);
57void rtbsd_notifier_wait(void);
58
59#endif /* rtbsd.h */