]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/missing_network.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / basic / missing_network.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 #include <linux/loop.h>
5 #include <linux/rtnetlink.h>
6 #include <net/ethernet.h>
7
8 #include "missing_ethtool.h"
9 #include "missing_fib_rules.h"
10 #include "missing_fou.h"
11 #include "missing_if_bridge.h"
12 #include "missing_if_link.h"
13 #include "missing_if_tunnel.h"
14 #include "missing_vxcan.h"
15
16 /* if.h */
17 /* The following two defines are actually available in the kernel headers for longer, but we define them here anyway,
18 * since that makes it easier to use them in conjunction with the glibc net/if.h header which conflicts with
19 * linux/if.h. */
20 #ifndef IF_OPER_UNKNOWN
21 #define IF_OPER_UNKNOWN 0
22 #endif
23
24 #ifndef IF_OPER_UP
25 #define IF_OPER_UP 6
26 #endif
27
28 #ifndef IFF_LOWER_UP
29 #define IFF_LOWER_UP 0x10000
30 #endif
31
32 #ifndef IFF_DORMANT
33 #define IFF_DORMANT 0x20000
34 #endif
35
36 /* if_addr.h */
37 #if !HAVE_IFA_FLAGS
38 #define IFA_FLAGS 8
39 #endif
40
41 #ifndef IFA_F_MANAGETEMPADDR
42 #define IFA_F_MANAGETEMPADDR 0x100
43 #endif
44
45 #ifndef IFA_F_NOPREFIXROUTE
46 #define IFA_F_NOPREFIXROUTE 0x200
47 #endif
48
49 #ifndef IFA_F_MCAUTOJOIN
50 #define IFA_F_MCAUTOJOIN 0x400
51 #endif
52
53 /* if_arp.h */
54 #ifndef ARPHRD_IP6GRE
55 #define ARPHRD_IP6GRE 823
56 #endif
57
58 /* if_bonding.h */
59 #ifndef BOND_XMIT_POLICY_ENCAP23
60 #define BOND_XMIT_POLICY_ENCAP23 3
61 #endif
62
63 #ifndef BOND_XMIT_POLICY_ENCAP34
64 #define BOND_XMIT_POLICY_ENCAP34 4
65 #endif
66
67 /* if_tun.h */
68 #ifndef IFF_MULTI_QUEUE
69 #define IFF_MULTI_QUEUE 0x100
70 #endif
71
72 /* in6.h */
73 #ifndef IPV6_UNICAST_IF
74 #define IPV6_UNICAST_IF 76
75 #endif
76
77 /* ip.h */
78 #ifndef IPV4_MIN_MTU
79 #define IPV4_MIN_MTU 68
80 #endif
81
82 /* ipv6.h */
83 #ifndef IPV6_MIN_MTU
84 #define IPV6_MIN_MTU 1280
85 #endif
86
87 /* loop.h */
88 #if !HAVE_LO_FLAGS_PARTSCAN
89 #define LO_FLAGS_PARTSCAN 8
90 #endif
91
92 #ifndef LOOP_CTL_REMOVE
93 #define LOOP_CTL_REMOVE 0x4C81
94 #endif
95
96 #ifndef LOOP_CTL_GET_FREE
97 #define LOOP_CTL_GET_FREE 0x4C82
98 #endif
99
100 /* netdevice.h */
101 #ifndef NET_ADDR_PERM
102 #define NET_ADDR_PERM 0
103 #endif
104
105 #ifndef NET_ADDR_RANDOM
106 #define NET_ADDR_RANDOM 1
107 #endif
108
109 #ifndef NET_ADDR_STOLEN
110 #define NET_ADDR_STOLEN 2
111 #endif
112
113 #ifndef NET_ADDR_SET
114 #define NET_ADDR_SET 3
115 #endif
116
117 #ifndef NET_NAME_UNKNOWN
118 #define NET_NAME_UNKNOWN 0
119 #endif
120
121 #ifndef NET_NAME_ENUM
122 #define NET_NAME_ENUM 1
123 #endif
124
125 #ifndef NET_NAME_PREDICTABLE
126 #define NET_NAME_PREDICTABLE 2
127 #endif
128
129 #ifndef NET_NAME_USER
130 #define NET_NAME_USER 3
131 #endif
132
133 #ifndef NET_NAME_RENAMED
134 #define NET_NAME_RENAMED 4
135 #endif
136
137 /* netlink.h */
138 #ifndef NETLINK_LIST_MEMBERSHIPS /* b42be38b2778eda2237fc759e55e3b698b05b315 (4.2) */
139 #define NETLINK_LIST_MEMBERSHIPS 9
140 #endif
141
142 /* rtnetlink.h */
143 #ifndef RTA_PREF
144 #define RTA_PREF 20
145 #endif
146
147 #ifndef RTAX_QUICKACK
148 #define RTAX_QUICKACK 15
149 #endif
150
151 #ifndef RTA_EXPIRES
152 #define RTA_EXPIRES 23
153 #endif
154
155 /* Note that LOOPBACK_IFINDEX is currently not exported by the
156 * kernel/glibc, but hardcoded internally by the kernel. However, as
157 * it is exported to userspace indirectly via rtnetlink and the
158 * ioctls, and made use of widely we define it here too, in a way that
159 * is compatible with the kernel's internal definition. */
160 #ifndef LOOPBACK_IFINDEX
161 #define LOOPBACK_IFINDEX 1
162 #endif
163
164 /* Not exposed yet. Similar values are defined in net/ethernet.h */
165 #ifndef ETHERTYPE_LLDP
166 #define ETHERTYPE_LLDP 0x88cc
167 #endif