authorgravatar for jari.vetoniemi@cloudef.pwJari Vetoniemi <jari.vetoniemi@cloudef.pw> 2025-02-20 14:18:34+09:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-21 06:05:04+01:00
logaa5c6c027c3f69602f5bcd1ad0b4a89232c85ae1
tree31775121a1ea810d039846ed239bb74338de622d
parentbbd13ab961ab49e01d5699eec195929cae7bf25a

linux: add UDP socket options


1 files changed, 24 insertions(+), 0 deletions(-)

lib/std/os/linux.zig+24
...@@ -3622,6 +3622,30 @@ pub const TCP = struct {...@@ -3622,6 +3622,30 @@ pub const TCP = struct {
3622 pub const REPAIR_OFF_NO_WP = -1;3622 pub const REPAIR_OFF_NO_WP = -1;
3623};3623};
36243624
3625pub const UDP = struct {
3626 /// Never send partially complete segments
3627 pub const CORK = 1;
3628 /// Set the socket to accept encapsulated packets
3629 pub const ENCAP = 100;
3630 /// Disable sending checksum for UDP6X
3631 pub const NO_CHECK6_TX = 101;
3632 /// Disable accepting checksum for UDP6
3633 pub const NO_CHECK6_RX = 102;
3634 /// Set GSO segmentation size
3635 pub const SEGMENT = 103;
3636 /// This socket can receive UDP GRO packets
3637 pub const GRO = 104;
3638};
3639
3640pub const UDP_ENCAP = struct {
3641 pub const ESPINUDP_NON_IKE = 1;
3642 pub const ESPINUDP = 2;
3643 pub const L2TPINUDP = 3;
3644 pub const GTP0 = 4;
3645 pub const GTP1U = 5;
3646 pub const RXRPC = 6;
3647};
3648
3625pub const PF = struct {3649pub const PF = struct {
3626 pub const UNSPEC = 0;3650 pub const UNSPEC = 0;
3627 pub const LOCAL = 1;3651 pub const LOCAL = 1;