Revert "tunneling: Disable IPv6 tunnel"
[cascardo/ovs.git] / lib / rtnetlink.h
1 /*
2  * Copyright (c) 2009, 2015 Nicira, Inc.
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
20 #include <stdbool.h>
21 #include <stdint.h>
22 #include <linux/if_ether.h>
23 #include <net/if.h>
24
25 #include "openvswitch/types.h"
26
27 struct ofpbuf;
28 struct nln_notifier;
29
30 /* These functions are Linux specific, so they should be used directly only by
31  * Linux-specific code. */
32
33 /* A digested version of an rtnetlink_link message sent down by the kernel to
34  * indicate that a network device's status (link or address) has been changed.
35  */
36 struct rtnetlink_change {
37     /* Copied from struct nlmsghdr. */
38     int nlmsg_type;             /* e.g. RTM_NEWLINK, RTM_DELLINK. */
39
40     /* Common attributes. */
41     int if_index;               /* Index of network device. */
42     char ifname[IFNAMSIZ];      /* Name of network device. */
43
44     /* Network device link status. */
45     int master_ifindex;         /* Ifindex of datapath master (0 if none). */
46     int mtu;                    /* Current MTU. */
47     struct eth_addr mac;
48     unsigned int ifi_flags;     /* Flags of network device. */
49
50     /* Network device address status. */
51     /* xxx To be added when needed. */
52 };
53
54 /* Function called to report that a netdev has changed.  'change' describes the
55  * specific change.  It may be null if the buffer of change information
56  * overflowed, in which case the function must assume that every device may
57  * have changed.  'aux' is as specified in the call to
58  * rtnetlink_notifier_register().  */
59 typedef
60 void rtnetlink_notify_func(const struct rtnetlink_change *change,
61                            void *aux);
62
63 bool rtnetlink_type_is_rtnlgrp_link(uint16_t type);
64 bool rtnetlink_type_is_rtnlgrp_addr(uint16_t type);
65 bool rtnetlink_parse(struct ofpbuf *buf, struct rtnetlink_change *change);
66 struct nln_notifier *
67 rtnetlink_notifier_create(rtnetlink_notify_func *, void *aux);
68 void rtnetlink_notifier_destroy(struct nln_notifier *);
69 void rtnetlink_run(void);
70 void rtnetlink_wait(void);
71 #endif /* rtnetlink.h */