Commit Graph

108 Commits

Author SHA1 Message Date
Szabolcs Nagy
dda21f10a7 netinet/in.h: add INADDR_DUMMY from linux v5.13
see

  linux commit 321827477360934dc040e9d3c626bf1de6c3ab3c
  icmp: don't send out ICMP messages with a source address of 0.0.0.0

"RFC7600 reserves a dummy address to be used as a source for ICMP
messages (192.0.0.8/32), so let's teach the kernel to substitute that
address as a last resort if the regular source address selection procedure
fails."
2022-03-08 17:21:26 -05:00
Szabolcs Nagy
1ee8109ea0 netinet/tcp.h: add tcp_zerocopy_receive fields from linux v5.12
see

  linux commit 7eeba1706eba6def15f6cb2fc7b3c3b9a2651edc
  tcp: Add receive timestamp support for receive zerocopy.

  linux commit 3c5a2fd042d0bfac71a2dfb99515723d318df47b
  tcp: Sanitize CMSG flags and reserved args in tcp_zerocopy_receive.
2022-03-08 17:19:56 -05:00
Szabolcs Nagy
bc89c31112 netinet/tcp.h: add TCP_NLA_* values up to linux v5.12
TCP_NLA_EDT was new in v5.9, see

  linux commit 48040793fa6003d211f021c6ad273477bcd90d91
  tcp: add earliest departure time to SCM_TIMESTAMPING_OPT_STATS

TCP_NLA_TTL is new in v5.12, see

  linux commit e7ed11ee945438b737e2ae2370e35591e16ec371
  tcp: add TTL to SCM_TIMESTAMPING_OPT_STATS
2022-03-08 17:19:54 -05:00
Szabolcs Nagy
30c8a1456a netinet/tcp.h: add tcp zerocopy related changes from linux v5.11
see

  linux commit 18fb76ed53865c1b5d5f0157b1b825704590beb5
  net-zerocopy: Copy straggler unaligned data for TCP Rx. zerocopy.

  linux commit 94ab9eb9b234ddf23af04a4bc7e8db68e67b8778
  net-zerocopy: Defer vm zap unless actually needed.
2022-03-08 17:19:44 -05:00
Szabolcs Nagy
b54f481fbc netinet/if_ether.h: add ETH_P_CFM from linux v5.11
see

  linux commit fbaedb4129838252570410c65abb2036b5505cbd
  bridge: uapi: cfm: Added EtherType used by the CFM protocol.
2022-03-08 17:19:43 -05:00
Szabolcs Nagy
67f774625e netinet/in.h: add IP_RECVERR_4884 from linux v5.9
see

  linux commit eba75c587e811d3249c8bd50d22bb2266ccd3c0f
  icmp: support rfc 4884
2020-11-29 00:54:41 -05:00
Szabolcs Nagy
f035c7b1e6 netinet/if_ether.h: add ETH_P_MRP from linux v5.8
Ethernet protocol number for media redundancy protocol, see

  linux commit 4714d13791f831d253852c8b5d657270becb8b2a
  bridge: uapi: mrp: Add mrp attributes.
2020-09-09 17:22:04 -04:00
Szabolcs Nagy
616a8bf660 netinet/tcp.h: update to linux v5.7
add TCP_NLA_BYTES_NOTSENT and new tcp_zerocopy_receive fields, see

  linux commit c8856c051454909e5059df4e81c77b9c366c5515
  tcp-zerocopy: Return inq along with tcp receive zerocopy.

  linux commit 33946518d493cdf10aedb4a483f1aa41948a3dab
  tcp-zerocopy: Return sk_err (if set) along with tcp receive zerocopy.

  linux commit e08ab0b377a1489760533424437c5f4be7f484a4
  tcp: add bytes not sent to SCM_TIMESTAMPING_OPT_STATS
2020-09-09 17:20:57 -04:00
Szabolcs Nagy
1ab341e89b netinet/udp.h: add TCP_ENCAP_ESPINTCP from linux v5.6
The use of TCP_ in udp.h is not known, fortunately udp.h is not
specified by posix so there are no strict namespace rules, added in

  linux commit e27cca96cd68fa2c6814c90f9a1cfd36bb68c593
  xfrm: add espintcp (RFC 8229)
2020-09-09 17:20:19 -04:00
Szabolcs Nagy
c6321616b8 netinet/tcp.h: update for linux v5.6
TCP_NLA_TIMEOUT_REHASH queries timeout-triggered rehash attempts,
tcpm_ifindex limits the scope of TCP_MD5SIG* sockopt to a device.

see

  linux commit 32efcc06d2a15fa87585614d12d6c2308cc2d3f3
  tcp: export count for rehash attempts

  linux commit 6b102db50cdde3ba2f78631ed21222edf3a5fb51
  net: Add device index to tcp_md5sig
2020-09-09 17:20:18 -04:00
Szabolcs Nagy
8fca0ea4e9 netinet/in.h: add IPPROTO_ macros from linux v5.6
add IPPROTO_ETHERNET and IPPROTO_MPTCP, see

  linux commit 2677625387056136e256c743e3285b4fe3da87bb
  seg6: fix SRv6 L2 tunnels to use IANA-assigned protocol number

  linux commit faf391c3826cd29feae02078ca2022d2f912f7cc
  tcp: Define IPPROTO_MPTCP
2020-09-09 17:20:15 -04:00
Szabolcs Nagy
d4f298149c netinet/tcp.h: update tcp_info for linux v5.5
see

  linux commit 480274787d7e3458bc5a7cfbbbe07033984ad711
  tcp: add TCP_INFO status for failed client TFO
2020-09-09 17:19:50 -04:00
Rich Felker
2f2348c958 remove duplicate definitions of INET[6]_ADDRSTRLEN
these were leftover from early beginnings when arpa/inet.h was not
including netinet/in.h.
2020-03-04 12:33:35 -05:00
Szabolcs Nagy
5e0c9f246c netinet/tcp.h: add new tcp_info fields from linux v5.4
tcpi_rcv_ooopack for tracking connection quality:

  linux commit f9af2dbbfe01def62765a58af7fbc488351893c3
  tcp: Add TCP_INFO counter for packets received out-of-order

tcpi_snd_wnd peer window size for diagnosing tcp performance problems:

  linux commit 8f7baad7f03543451af27f5380fc816b008aa1f2
  tcp: Add snd_wnd to TCP_INFO
2019-12-30 18:14:08 -05:00
Szabolcs Nagy
167cbf1316 netinet/if_ether.h: add ETH_P_LLDP from linux v5.3
see

  linux commit c54c2c72b2b90a3ba61b8cad032a578ce2bf5b35
  net: Add a define for LLDP ethertype
2019-12-30 18:12:42 -05:00
Szabolcs Nagy
af2576e61d netinet/tcp.h: add TCP_TX_DELAY from linux v5.3
see

  linux commit a842fe1425cb20f457abd3f8ef98b468f83ca98b
  tcp: add optional per socket transmit delay
2019-12-30 18:12:40 -05:00
A. Wilcox
0738e6c19f add uapi guards for new netinet/ip.h conflict with struct iphdr
This ensures that the musl definition of 'struct iphdr' does not conflict
with the Linux kernel UAPI definition of it.

Some software, i.e. net-tools, will not compile against 5.4 kernel headers
without this patch and the corresponding Linux kernel patch.
2019-12-22 12:45:48 -05:00
Rich Felker
71d23fbeac remove indirect use of endian.h from public headers
building on commit 97d35a552e,
__BYTE_ORDER is now available wherever alltypes.h is included.
endian.h should not be used since, in the future, it will expose
identifiers that are not in the reserved namespace for the headers
which were previously using it.
2019-10-17 16:03:42 -04:00
Szabolcs Nagy
b5134ccd4d netinet/if_ether.h: add ETH_P_DSA_8021Q from linux v5.2
ethertype for fake VLAN header for DSA, see

  linux commit bf5bc3ce8a8f32a0d45b6820ede8f9fc3e9c23df
  ether: Add dedicated Ethertype for pseudo-802.1Q DSA tagging
2019-09-11 10:39:58 -04:00
Szabolcs Nagy
eea841e653 netinet/in.h: add INADDR_ALLSNOOPERS_GROUP from linux v5.1
RFC 4286: "The IPv4 multicast address for All-Snoopers is 224.0.0.106."
from

  linux commit 4effd28c1245303dce7fd290c501ac2c11052114
  bridge: join all-snoopers multicast address
2019-07-01 14:16:41 -04:00
Szabolcs Nagy
93b5f6c843 netinet/in.h: add IPV6_ROUTER_ALERT_ISOLATE from linux v5.1
restricts router alert packets received by the socket to the
socket's namespace only. see

  linux commit 9036b2fe092a107856edd1a3bad48b83f2b45000
  net: ipv6: add socket option IPV6_ROUTER_ALERT_ISOLATE
2019-07-01 14:12:14 -04:00
Szabolcs Nagy
9e06514e23 netinet/tcp.h: add TCP_NLA_SRTT from linux v5.0
smoothed RTT for SCM_TIMESTAMPING_OPT_STATS control messages.
added in linux commit e8bd8fca6773ef49390269bd467bf940a0841ccf
2019-03-13 12:33:54 -04:00
Szabolcs Nagy
292bda7ceb netinet/udp.h: add UDP_GRO from linux v5.0
sockopt to enable gro for udp.
added in linux commit e20cf8d3f1f763ad28a9cb3b41305b8a8a42653e
2019-03-13 12:33:51 -04:00
Szabolcs Nagy
0b026bbd69 netinet/in.h add IPV6_MULTICAST_ALL from linux v4.20
ipv6 analogue of IP_MULTICAST_ALL sockopt.

added in linux commit 15033f0457dca569b284bef0c8d3ad55fb37eacb
2019-03-13 12:32:59 -04:00
Szabolcs Nagy
3e52f99308 netinet/udp.h: add UDP_ENCAP_RXRPC from linux v4.19
used for optimizing the rxrpc protocol
added in linux commit 5271953cad31b97dea80f848c16e96ad66401199
2019-03-13 12:30:21 -04:00
Szabolcs Nagy
b47723ab3b netinet/tcp.h: add tcp_info fields from linux v4.19
new fields for RFC 4898 tcp stats in linux
tcpi_bytes_sent added in commit ba113c3aa79a7f941ac162d05a3620bdc985c58d
tcpi_bytes_retrans added in commit fb31c9b9f6c85b1bad569ecedbde78d9e37cd87b
tcpi_dsack_dups added in commit 7e10b6554ff2ce7f86d5d3eec3af5db8db482caa
tcpi_reord_seen added in commit 7ec65372ca534217b53fd208500cf7aac223a383

The new fields change the size of a public struct and thus an ABI break,
but this is how the getsockopt TCP_INFO api is designed: the tcp_info
type must only be used with a length parameter in extern interfaces.
2019-03-13 12:30:12 -04:00
Szabolcs Nagy
4b9b8c8ee6 update netinet/udp.h for linux v4.18
add UDP_NO_CHECK6_* to restrict zero UDP6 checksums, new in linux commit
1c19448c9ba6545b80ded18488a64a7f3d8e6998 (pre-v4.18 change, was missed)
add UDP_SEGMENT to support generic segmentation offload for udp datagrams,
bec1f6f697362c5bc635dacd7ac8499d0a10a4e7 (new in v4.18)
2018-12-09 22:23:48 -05:00
Szabolcs Nagy
ac1af87e1d update netinet/tcp.h for linux v4.18
add packet delivery info to tcp_info,
new in linux commit feb5f2ec646483fb66f9ad7218b1aad2a93a2a5c
add TCP_ZEROCOPY_RECEIVE socket option for zerocopy receive,
new in linux commit 05255b823a6173525587f29c4e8f1ca33fd7677d
add TCP_INQ socket option and TCP_CM_INQ cmsg to get in-queue bytes in cmsg
upon read, new in linux commit b75eba76d3d72e2374fac999926dafef2997edd2
add TCP_REPAIR_* to fix repair socket window probe patch,
new in linux commit 31048d7aedf31bf0f69c54a662944632f29d82f2
2018-12-09 22:23:30 -05:00
Szabolcs Nagy
5b85ed5cec add ETH_P_PREAUTH ethertype from linux v4.17
added in linux commit 4fe0de5b143762d327bfaf1d7be7c5b58041a18c
2018-06-19 13:26:41 -04:00
Szabolcs Nagy
ebeb1de288 add TCP_NLA_* from linux v4.17
new and missing netlink attributes types for SCM_TIMESTAMPING_OPT_STATS,
new ones were added in commits
7156d194a0772f733865267e7207e0b08f81b02b
be631892948060f44b1ceee3132be1266932071e
87ecc95d81d951b0984f2eb9c5c118cb68d0dce8
2018-06-19 13:26:36 -04:00
Szabolcs Nagy
3a81cbe643 netinet/if_ether.h: add ETH_TLEN from linux v4.16
octets in ethernet type field
added in linux commit 4bbb3e0e8239f9079bf1fe20b3c0cb598714ae61
2018-06-19 13:25:25 -04:00
Szabolcs Nagy
833df8675c netinet/if_ether.h: add ETH_P_ERSPAN2 from linux v4.16
protocol number for erspan v2 support
added in linux commit f551c91de262ba36b20c3ac19538afb4f4507441
2018-06-19 13:25:22 -04:00
Szabolcs Nagy
4001c51181 netinet/in.h: add new IPV6_FREEBIND from linux v4.15
new socekt option for AF_INET6 SOL_RAW sockets, added in linux commit
84e14fe353de7624872e582887712079ba0b2d56
2018-02-22 18:49:07 -05:00
Szabolcs Nagy
5f4ff22aa3 netinet/tcp.h: add TCP_* socket options from linux v4.15
TCP_FASTOPEN_KEY is new in 1fba70e5b6bed53496ba1f1f16127f5be01b5fb6
TCP_FASTOPEN_NO_COOKIE is new in 71c02379c762cb616c00fd5c4ed253fbf6bbe11b
2018-02-22 18:49:03 -05:00
Szabolcs Nagy
e69608700f netinet/tcp.h: add tcp_diag_md5sig struct from linux v4.14
for querying tcp md5 signing keys.
new in linux commit c03fa9bcacd9ac04595cc13f34f3445f0a5ecf13
2018-02-22 18:48:18 -05:00
Szabolcs Nagy
fba3059d72 netinet/if_ether.h: add new ETH_P_ macros from linux v4.14
new ethertypes in linux v4.14:
ETH_P_ERSPAN new in 84e54fe0a5eaed696dee4019c396f8396f5a908b
ETH_P_IFE new in 2804fd3af6ba5ae5737705b27146455eabe2e2f8
ETH_P_NSH new in 155e6f649757c902901e599c268f8b575ddac1f8
ETH_P_MAP new in 7373ae7e8f0bf2c0718422481da986db5058b005
2018-02-22 18:47:52 -05:00
Hauke Mehrtens
b583c5d3b4 add additional uapi guards for Linux kernel header files
With Linux kernel 4.16 it will be possible to guard more parts of the
Linux header files from a libc. Make use of this in musl to guard all
the structures and other definitions from the Linux header files which
are also defined by the header files provided by musl. This will make
it possible to compile source files which include both the libc
headers and the kernel userspace headers.

This extends the definitions done in commit 04983f2272 ("make
netinet/in.h suppress clashing definitions from kernel headers")
2018-01-09 13:08:25 -05:00
Rich Felker
d5029bb88a fix endian errors in netinet/icmp6.h due to failure to include endian.h 2017-12-15 12:58:33 -05:00
Szabolcs Nagy
6651ef1f06 add new tcp.h socket options from linux v4.13
TCP_ULP is new in linux commit 734942cc4ea6478eed125af258da1bdbb4afe578
TCP_MD5SIG_EXT is new in 8917a777be3ba566377be05117f71b93a5fd909d
2017-11-05 18:41:26 -05:00
Szabolcs Nagy
c519658cea add TCP_NLA_* enums from linux v4.11
two new stats for SCM_TIMESTAMPING_OPT_STATS, added in linux commit
7e98102f489775d8c000884fca8a0d995ea688a9
2017-11-05 18:41:09 -05:00
Szabolcs Nagy
ee3ae7827b add TCP_FASTOPEN_CONNECT tcp socket option from linux v4.11
new in linux commit 19f6d3f3c8422d65b5e3d2162e30ef07c6e21ea2
2017-11-05 18:41:08 -05:00
Szabolcs Nagy
3eb82f7338 add ETH_P_IBOE from linux v4.11
new in linux commit 69ae543969abeba48e04dd93277684c8c0895f3b
2017-11-05 18:41:06 -05:00
Szabolcs Nagy
f5638c22e3 add ETH_MIN_MTU and ETH_MAX_MTU from linux v4.10
min max mtu size definitions mostly for drivers.
new in linux commits a52ad514fdf3b8a57ca4322c92d2d8d5c6182485 and
d894be57ca92c8a8819ab544d550809e8731137b
2017-11-05 18:40:53 -05:00
Szabolcs Nagy
013696918b add IP_RECVFRAGSIZE and IPV6_RECVFRAGSIZE from linux v4.10
added in linux commit 70ecc24841326396a827deb55c3fefac582a729d
2017-11-05 18:39:29 -05:00
Szabolcs Nagy
5c596ed867 add SCM_TIMESTAMPING_OPT_STATS and related TCP_ enums from linux v4.10
for tcp timestamp control messages, new in linux commit
1c885808e45601b2b6f68b30ac1d999e10b6f606
and export time measurements via tcp_info, added in linux commit
efd90174167530c67a54273fd5d8369c87f9bd32
2017-11-05 18:39:25 -05:00
Rich Felker
5f7efb87a2 move IPPORT_RESERVED from netdb.h to netinet/in.h
it's in the reserved namespace for the latter, where it seems it was
historically defined, and some programs expect to find it there.
2017-08-29 20:50:48 -04:00
Szabolcs Nagy
60c46db80b update tcp_info struct to linux v4.9
export tcp data delivery rate in tcp_info struct.
see linux commit eb8329e0a04db0061f714f033b4454326ba147f4
2016-12-29 22:11:01 -05:00
Rich Felker
04983f2272 make netinet/in.h suppress clashing definitions from kernel headers
the linux kernel uapi headers provide their own definitions of the
structures from netinet/in.h, resulting in errors when a program
includes both the standard libc header and one or more of the
networking-related kernel headers that pull in the kernel definitions.

as before, we do not attempt to support the case where kernel headers
are included before the libc ones, since the kernel definitions may
have subtly incorrect types, namespace violations, etc. however, we
can easily support the inclusion of the kernel headers after the libc
ones, since the kernel headers provide a public interface for
suppressing their definitions. this patch adds the necessary macro
definitions for such suppression.
2016-11-07 23:19:19 -05:00
Daniel Sabogal
71e8392765 add missing if_ether.h constants
ETH_P_HSR (IEC 62439-3 HSRv1) added in
linux 4.7 commit ee1c27977284907d40f7f72c2d078d709f15811f

ETH_P_TSN (IEEE 1722) added in
linux 4.3 commit 1ab1e895492d8084dfc1c854efacde219e56b8c1
this constant breaks the ascending order to match the kernel header

ETH_P_XDSA (Multiplexed DSA protocol) added in
linux 3.18 commit 3e8a72d1dae374cf6fc1dba97cec663585845ff9
2016-10-20 16:55:57 -04:00
Szabolcs Nagy
87643335ac update icmphdr struct following linux v4.8
add union field that is used in the kernel for SIT/GRE tunneling ICMPv4
messages. see linux commit 20e1954fe238dbe5f8d3a979e593fe352bd703cf
2016-10-20 01:29:06 -04:00